At 12:06 2003-07-30 +0100, Dan Hardiker wrote:
We have a floating sales person, and a secetary and currently carbon copy
all of the mail that ends up with the sales person to the secetary. I have
yet to work out how to add a custom header to the forwarded email so it
will appear only on that carboned email.
It might help if you describe your situation by way of an example of how
the message would arrive at your server (if it IS your server and not just
an account at an ISP, etc), and be forwarded.
The most appropriate method is to simply take the salesperson email alias
(in the MTA config) and set it up to deliver to their user account AND to
That's the most direct approach. It won't add any visible "cc:" header
though, and since the original sender DIDN'T address it with one, that
seems like the appropriate way to deal with it anyway. This approach is
the most straightforward, and doesn't involve procmail at all (check with
your MTA documentation at to how to compose an alias for it - the above is
suitable for Sendmail).
Alternatley, you could use procmail, at the user's account:
* ! ^FROM_MAILER
* ! ^X-Loop: floatingsalesperson
| formail -A "X-Loop: floatingsalesperson"
This says, "if the X-Loop header IS NOT equal to this text AND this isn't a
mailer message (such as possibly, a bounce), let's take a (c)opy of the
message and (f)ilter the (h)headers and (w)ait for the program and it's
exit code, to (A)dd a custom header to the message, then forward (!) the
message to the secretary."
Adding the header avoids mail loops caused by forwards which might be
present on the other account.
Sean B. Straw / Professional Software Engineering
Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
Please DO NOT carbon me on list replies. I'll get my copy from the list.
procmail mailing list