You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Phil Spencer <ph...@gna.sh> on 2012/05/08 17:09:18 UTC

Taking James offline

I have a James Server instance that sits between two other MTAs and all is working very nicely

However I now need to take the James server offline if the downstream MTA is offline (the upstream server will then look for alternate means of delivery)

I could just create an external watchdog process but I wonder if there is a more elegant way of handling this with James itself

Any suggestions would be much appreciated

Phil

 
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Taking James offline

Posted by Eric Charles <er...@apache.org>.
Hi Phil,

James is started with a spring context (see [1]).

You could start with your own class and launch there your watchdog 
thread (it can be opening a socket to the downstream mta).

Once the mta down event is generated, you could call stop() and also 
hook in the JamesServerApplicationContext to override the doClose method 
to take any action you would like.

More elaborated, you could also simply disable the SMTPServer leaving 
all the james operational. Once the downstream mta up event is detected 
by the internal watchdog, you could re-enable the SMTPServer by code.

Thx
Eric

[1] 
https://svn.apache.org/repos/asf/james/app/trunk/src/main/java/org/apache/james/app/spring/JamesAppSpringMain.java

On 05/08/2012 05:09 PM, Phil Spencer wrote:
> I have a James Server instance that sits between two other MTAs and all is working very nicely
>
> However I now need to take the James server offline if the downstream MTA is offline (the upstream server will then look for alternate means of delivery)
>
> I could just create an external watchdog process but I wonder if there is a more elegant way of handling this with James itself
>
> Any suggestions would be much appreciated
>
> Phil
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>

-- 
eric | http://about.echarles.net | @echarles

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org