You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Serge Sozonoff <se...@globalbeach.com> on 2003/01/08 00:17:18 UTC

[PATCH] FetchPOP changes

Hi,

As discussed in the "FetchPOP configuration change" thread, here is patch
which adds an additional config parameter to the FetchPOP block.

The config parameter looks like this:
<recipient ignorercpt-header="false">user@mydomain.com</recipient>

If ignorercpt-header = true then fetched mail will always be re-spooled with
the specified address as the envelope recipient.
If ignorercpt-header = false, the header is parsed as follows to try and
determine the envelope recipient to use when the mail is spooled
in James.

First the Received: header is parsed to try and find the "for" parameter, if
this fails the To: header is checked and if it contains only one recipient
then this is used as the new envelope recipient for the newly spooled mail.
If both of these fail, the specified recipient from the configuration
parameter is used.
It is possible to do additional checks to try and find who the original
recipient is and if I am going in the right direction with this I will look
at
maybe adding a few more possibilities. I have been reading about Fetchmail.

I have also added a failsafe to avoid mail loops, I simply count the number
of times the X-fetched-from header occurs and if it is more than three I
change the mail state to ERROR before spooling.

I welcome any feedback.

Thanks,
Sergei