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 amossbarger <am...@viatraining.com> on 2005/12/30 02:51:29 UTC

Setting different matcher based on domain

How do I set different matcher rules based upon the servername?  In
otherwords our James box has different names listed in the servernames
tag and I need to be able to specify different matchers depending on
which servername the mail came in on which won't neccessarily match the
from address?  Is this possible without running seperate instances of
James?  Sorry if this is an obvious question.

Thanks,
Andrew


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


Re: Setting different matcher based on domain

Posted by Stefano Bagnara <ap...@bago.org>.
> Bottom line: Is there a way to know which listening domain an email came
> through on? and how?


No. This is a TCP/IP limit: you know the 2 endpoints IP for a connection
 but you can't know what the domain name used is. In TCP/IP you have to
add multiple services binding to different IPs or different ports (for
SMTP you must use IPs because port default to 25).

Latest unreleased version of James (current trunk) should support
multiple smtpserver binded to the same james and custom command handler
in each smtpserver to be able to add an attribute to the mails based on
the receiving server).

Both way you need a custom IP for each domain you want to handle and to
write custom code.

Stefano

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


Re: Setting different matcher based on domain

Posted by amossbarger <am...@viatraining.com>.
Thank you for the suggestion, but we are using james as an intermediary 
relay filter for our testing department to catch and either redirect, 
kill, or send outgoing emails from different webapps being tested based 
on a white list database table.  I have everything working by using 
mail.getRemoteAddress() to determine which webapp is sending the email.  
The problem is that we have to give each webapp a unique ip.  I would 
rather point each webapp at different mail server domain names that 
James is listening to and then have james take action based upon which 
domain the mail came through on.  The problem with the HostIs matcher is 
that it is looking for recipient host address, but we are using james as 
a filter relay so we are trying to set different filters based on james 
listening domain then the recipient domain.  I hope this makes sense.  
In short we are using james so our testers don't inadvertently email 
thousands of real clients in the testing process but can instead at 
runtime block, redirect or send emails by toggling entries in our 
database depending on which app they are testing.

Bottom line: Is there a way to know which listening domain an email came 
through on? and how?

Thanks,
Andrew Mossbarger

Stefano Bagnara wrote:

>amossbarger wrote:
>  
>
>>How do I set different matcher rules based upon the servername?  In
>>otherwords our James box has different names listed in the servernames
>>tag and I need to be able to specify different matchers depending on
>>which servername the mail came in on which won't neccessarily match the
>>from address?  Is this possible without running seperate instances of
>>James?  Sorry if this is an obvious question.
>>    
>>
>
>
>You should add a matcher "HostIs=domain1.com" using the ToProcessor
>mailet and the provide host specific matcher/mailets in the new processor.
>
>Stefano
>
>---------------------------------------------------------------------
>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


Re: Setting different matcher based on domain

Posted by Stefano Bagnara <ap...@bago.org>.
amossbarger wrote:
> How do I set different matcher rules based upon the servername?  In
> otherwords our James box has different names listed in the servernames
> tag and I need to be able to specify different matchers depending on
> which servername the mail came in on which won't neccessarily match the
> from address?  Is this possible without running seperate instances of
> James?  Sorry if this is an obvious question.


You should add a matcher "HostIs=domain1.com" using the ToProcessor
mailet and the provide host specific matcher/mailets in the new processor.

Stefano

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


Setting different matcher based on domain

Posted by amossbarger <am...@viatraining.com>.
How do I set different matcher rules based upon the servername?  In
otherwords our James box has different names listed in the servernames
tag and I need to be able to specify different matchers depending on
which servername the mail came in on which won't neccessarily match the
from address?  Is this possible without running seperate instances of
James?  Sorry if this is an obvious question.

Thanks,
Andrew




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