procmail
[Top] [All Lists]

Re: Outgoing filter?

1996-08-08 21:16:37
   How do I filter my OUTGOING mail with procmail? 

   I use several different email addresses, and I'd like to 
be able to munge my From: or Reply-To: addresses automatically 
on my outgoing mail. Any ideas?

It depends on how flexible your MUA (Mail User Agent) or MTA (Mail
Transfer Agent) is.  If you MUA can programmatically filter outgoing
mail, then you can easily write a procmail recipe and invoke it like:

    procmail -m filtername <composed-mail >mail-to-be-sent

If you use MH, as I do, "comp" invokes "send", which, in turn, invokes
"post".  It is fairly easy to intercept "post" with a filtering script
which is programmed according to your needs, and then invoke the real
version of the intercepted program.  This can be done with the
~/.mh_profile, for example:

    postproc: $HOME/bin/mypost

and then write $HOME/bin/mypost to do the appropriate filtering, and
then invoke /usr/local/lib/mh/post correctly.

If your MUA is not so flexible, then you should see if your MTA is
configurable.  Most Unix system's support sendmail which is very
configurable, albeit obscurely.  It is not too difficult to modify
sendmail.cf to insert rewrite rules for outgoing addresses such that the
mail is filtered before being sent.  See the procmail distribution
"examples" directory for hints.

Other MTA's, such as "deliver", etc., might be configurable also.

G'luck.
_____________________________________________________________________
Alan Stebbens           <stebbens(_at_)sgi(_dot_)com>             (415) 933-6437
Digital TV, Silicon Interactive Group,  Silicon Graphics, Inc.  (SGI)
M/S:9L991,     2011 N. Shoreline Blvd.,     Mountain View, CA   94043
PGP Key Fingerprint: 94 A7 4B AB 1C F0 4D 92  DD BC B5 D7 11 A0 DC B3

<Prev in Thread] Current Thread [Next in Thread>