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 Adam Crinklaw <ac...@gmail.com> on 2013/04/03 17:37:19 UTC

Change FROM address before mail leaves James server

Hello,

I have a client rejecting mail from us on the IIS platform.  I want to
switch to James because IIS cannot modify the FROM header in the mail
message before it delivers.  After much searching through the mailing list
here and on experts-exchange.com I was not able to find any indication
James can do this or if it can, how to do it.  I have done this with
sendmail before but the machine host is Windows.

Here is the situation:

The mail is normally sent as;

MAIL FROM: <us...@theirCompany.com>
RCPT TO: <us...@theirCompany.com>

When it is received by James on the local server, I want to change the
envelope and give the message a new FROM address before it leaves our
server and goes to theirs, so that this is what is sent to their mail
servers:

MAIL FROM: <no...@subdomain.ourCompany.com>
RCPT TO: <us...@theirCompany.com>

Recently they implemented Iron Port and its now blocking emails because we
utilize the logged in user's email address to send messages, in our case it
blocks the mail because the from address is one of their users whereas we
are not actually sending from within the customer's network.

Thank you,
Adam

Re: Change FROM address before mail leaves James server

Posted by Eric Charles <er...@apache.org>.
Hi,
You have to define a mailet to change the from address in 
mailetcontainer.xml (just before the RemoteDelivery mailet)

We don't have a mailet that does this, but it's quite easy to code in 
your custom mailet (see [1]).

     public void service(Mail mail) throws MessagingException {
             mail.getMessage().setFrom(new 
InternetAddress("noreply@subdomain.ourCompany.com"));
     }

However, the remote host may have more/other controls that will reject 
your mails (so this may not be the complete/correct solution to your 
problems).

Thx, Eric

[1] http://james.apache.org/server/3/dev-extend-mailet.html

On 03/04/2013 17:37, Adam Crinklaw wrote:
> Hello,
>
> I have a client rejecting mail from us on the IIS platform.  I want to
> switch to James because IIS cannot modify the FROM header in the mail
> message before it delivers.  After much searching through the mailing list
> here and on experts-exchange.com I was not able to find any indication
> James can do this or if it can, how to do it.  I have done this with
> sendmail before but the machine host is Windows.
>
> Here is the situation:
>
> The mail is normally sent as;
>
> MAIL FROM: <us...@theirCompany.com>
> RCPT TO: <us...@theirCompany.com>
>
> When it is received by James on the local server, I want to change the
> envelope and give the message a new FROM address before it leaves our
> server and goes to theirs, so that this is what is sent to their mail
> servers:
>
> MAIL FROM: <no...@subdomain.ourCompany.com>
> RCPT TO: <us...@theirCompany.com>
>
> Recently they implemented Iron Port and its now blocking emails because we
> utilize the logged in user's email address to send messages, in our case it
> blocks the mail because the from address is one of their users whereas we
> are not actually sending from within the customer's network.
>
> Thank you,
> Adam
>

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