procmail
[Top] [All Lists]

Re: Outgoing mail

1998-10-01 16:13:49
| Is it possible to store sent mail in different folders according to the
| "To" field of the message?

Yes; the trick is getting procmail to see your outgoing mail.

That is easiest with MUAs that, like Mutt or mailx, allow you to set a pre-
processing program to filter your outgoing email before it gets to the MTA.

I have no experience with Mutt, but with mailx, as long as your OS groks #!,
you can put this into your ~/.mailrc:

  set sendmail=$HOME/scripts/backward # or whatever path you like

(It was Era, I think, who coined the use of "backward file" for this, in
contrast to a .forward file for handling incoming mail.)  One caution is
that mailx won't stand for a space in the name, no matter how you try to
quote it [or at least no matter how I tried to quote it], so you can't
set sendmail="/path/to/procmail -m $HOME/.backward" in ~/.mailrc.

Then the backward file itself should be owner-executable, starting with

#!/path/to/your/procmail/binary -m

and ending with something on the order of 

:0
! "$@"

to finish by passing the text and the MUA's arguments to the MTA.

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