procmail
[Top] [All Lists]

Re: handle outgoing mail?

1997-09-06 19:41:56
Dave Robbins asked,

| Can procmail handle outgoing mail in the sense of putting all my composed
| mail, say to this list, in a separate mailbox?  If so, could someone please
| explain how this might be accomplished while maintaining the status quo
| of my incoming mail?

That depends on the MUA (mail user agent) you use to compose and to dispatch
your outgoing mail to the MTA (mail transfer agent).  Some have a feature for
saving copies of outgoing mail, but it simply deposits them into a folder
without their seeing another program.  Some allow you to set a filtering
program for outgoing mail between the MUA and the MTA, and procmail's -m
option is perfect for that.  Although I use Elm (which does not have such
a capability) for mail that I send by hand, all my cron jobs that send mail
do it through Mail precisely because it can be told to hand mail to a filter
instead of giving it directly to the MTA; that way the mail they generate
can go through a procmail rcfile.  (One list member called such an rcfile
".backward" because it handles mail going in the opposite direction of a
.forward file.)

It has no effect on your incoming mail; however, if you do find a way to
filter your outgoing mail through procmail and there is a plain folder that
can receive both incoming and outgoing mail, be careful of your locking.

| Also, regarding my incoming mail, I want to have all mail from a particular
| list go to one mailbox but mail from a particular user on that list
| go into a separate mailbox.  For example, does this work since if the 
| first doesn't complete processing, procmail will just go on to the 
| next recipe?
| 
| :0
| * ^From.*procmail
| * ^From:(_dot_)*aks(_at_)sgi(_dot_)com
| aks
| 
| :0
| * ^From.*procmail
| procmail

Yes, that would work, and your logic is fine, though if $MAILDIR/aks and
$MAILDIR/procmail are plain folders, those recipes need local lockfiles. 
However, the following may be more efficient, because list posts that are not
by Alan will have their heads egrepped only twice instead of three times:

  :0
  * ^From.*procmail
  {
   :0:
   * ^From:(_dot_)*aks(_at_)sgi\(_dot_)com
   aks

   :0:
   procmail
  }

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