It's generally not possible to properly distribute mail based on mail header entries.
Sometimes the recipient's address won't be in mail headers.
It may be multi-drop at the other end, but you should want it to be multiple mailboxes at your end.
Unless your upstream mail server is scripted to specifically add a special message header based on the actual recipient address list that was submitted with MAIL FROM (which could be intended for MULTIPLE local recipients, e.g. the message could be intended for two of the users of the domain), this may not be a tractible problem.
This is especially true of Bcc'd mail, commonly utilized for mailing list traffic.
FETCHMAIL has a multidrop mode that may help you "pull" mail like this, from the fetchmail man page (install fetchmail and type 'man fetchmail'):
*With multidrop-mode, fetchmail is not able to assume that there is only
a single recipient, but rather that the mail server account actually
contains mail intended for any number of different recipients.
*Therefore, fetchmail must attempt to deduce the proper "envelope recipient"
from the mail headers of each message. In this mode of operation,
fetchmail almost resembles an MTA, however it is important to note that
* neither the POP nor IMAP protocols were intended for use in this fashion, and hence envelope information is often not directly available. Instead, fetchmail must resort to a process of informed guess-work in an attempt to discover the true envelope recipient of a message, unless the ISP stores the envelope information in some header (not all do).
* Even if this information is present in the headers, the process can be error-prone and is dependent upon the specific mail server used for mail retrieval.
* Multidrop-mode is used when more than one local user is specified for a particular server account in the configuration file. Note that the forgoing discussion of singledrop- and multidrop-modes does not apply to the ESMTP ETRN or ODMR retrieval methods, since they are based upon the SMTP protocol which specifically provides the envelope recipient to fetchmail.
Main Topics
Browse All Topics





by: arnoldPosted on 2009-06-27 at 09:53:12ID: 24728440
How do the users in the remote offices access their emails?
com.
com.
domain.com .
Unless you configure qmail to handle email for user1@somedomain.com different than user2@somedomain.com, the catch-all.
Are the remote users have their own email address to which the email could be forwarded?
user1@somedomain.com has an email address of name.last@someotherdomain.
You could then setup forwarding directions for emails sent to user1@somedomain.com to be rerouted to name.last@someotherdomain.
Depending on what the "email server" that retrieves the catch-all can do and whether the same email server exist in the other offices?
I.e. is there a tie in among the multiple location such that an email to user1@somedomain.com at the main office to push that email to user1@alternateoffice.some
The setup though is puzzling, whereby you are collecting all emails and then having a different server redistribute the email based on header entries.