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 Daniel Perry <d....@netcase.co.uk> on 2004/10/13 17:11:49 UTC

Matchers for local addresses (Was: failover configuration)

I was looking at this stuff again, and was wondering if there isnt a better
way to pick mail out as being 'for this machine' and dont use authorisation
or 'for a remote host' and use authorisation.

My thoughts are that maybe something similar to the existing matchers should
be used in an 'openrelay' block instead of having the servernames /
authorisation blocks.

So, for a simple setup you have somthing like match="HostIs=mydomain.com or
HostIs=myotherdomain".

Or you can have match="HostIsInDBTable=db://maildb/VirtualUserTable?domain"
which uses the database approach, and provides neater configuration than the
hack i currently use.

Going with this, you could then write any matchers you want.  You could add
ip address matchers that allow relaying without authentication for certain
ips.

This appears to be a lot more flexible than the current static approach,
which relies on java code hacks to get round it's limitations!

Daniel.



> -----Original Message-----
> From: Daniel Perry [mailto:d.perry@netcase.co.uk]
> Sent: 12 October 2004 11:53
> To: James Users List
> Subject: failover configuration
>
>
> Hi,
> I've got two james servers, and have been asked to set them up as failover
> for eachother.
>
> I found the example of the failover in the wiki:
>       <mailet match="HostIs=myfoo.com" class="RemoteDelivery">
>        <outgoing> file://var/mail/relay/ </outgoing>
>        <delayTime> 21600000 </delayTime>
>        <maxRetries> 5 </maxRetries>
>        <deliveryThreads> 1 </deliveryThreads>
>        <gateway> int.myfoo.com </gateway>
>        <gatewayPort>25</gatewayPort>
>       </mailet>
>
> However this example requires adding a mailet for each domain, which isnt
> going to be feasible.
>
> Adding a mailet for each server is an option, but i am not sure how to do
> this.  Here are my thoughts:
>
> I am using a customised version of james which uses the
> VirtualUserTable to
> recognise domains as local, rather than the manually entering every domain
> in the "servernames" block.  I could add to this code to use another table
> that contains columns: (mailservername, domain).  This way the
> messages will
> be accepted and wont request authorisation.
>
> Now for delivery: as the domains that will be relayed will be treated as
> local, they must be processed before they are delievered locally
> (or rather
> rejected with no such user error).
>
> So, first thing on the transport block add a mailet:
>
> <mailet match="FailoverForServer=blah.com" class="RemoteDelivery">
>        <outgoing> file://var/mail/failoverrelayblah/ </outgoing>
>        <delayTime>  5 minutes </delayTime>
>        <delayTime> 10 minutes </delayTime>
>        <delayTime> 45 minutes </delayTime>
>        <delayTime>  2 hours </delayTime>
>        <delayTime>  3 hours </delayTime>
>        <delayTime>  6 hours </delayTime>
>        <maxRetries> 25 </maxRetries>
>        <deliveryThreads> 1 </deliveryThreads>
>        <gateway> blah.com </gateway>
>        <gatewayPort>25</gatewayPort>
>       </mailet>
>
> The FailOverForServer matcher will look in my new table and check if the
> domain that the email is for is listed, and if it's mailserver matched the
> parameter.
>
> Would this work?  Has anyone already done this?  Is there an easier way?
>
> An alternative hack i thought of would be to make the changes so that mail
> is accepted for the domains based on a table, and then use a matcher that
> checks for the highest priority mail server: ie: HighestMX=blah.com, and
> deliver that mail to blah.com.
>
> Daniel.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>


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