procmail
[Top] [All Lists]

Re: archiving outgoing mail

2008-02-21 21:52:09
* Professional Software Engineering is quoted & my replies are inline below :
At 11:57 2008-02-22 +1000, Troy Piggins wrote:

Been thinking about this some more.  I was thinking I'd need to set up rules
for every user.  But if I was to bcc some user I set up, say I named it
"outgoing-archiver" although it doesn't matter really, I could set up a
system-wide procmail rule like:

:0:
* ! ^TO_$LOGNAME
* ^From:.*$LOGNAME
| gzip -fc9 >> $HOME/Sent_$DATE.gz

Except that $LOGNAME is the shell login name of the user for which this 
mail is being processed.  If you're bcc'ing some user, LOGNAME is going to 
be the account that mail is delivered for, not the user who originated the 
message that was bcc'd.

Further, there's really no reason to have the mail run through the global 
procmailrc -- the alias you bcc to can itself be a program delivery to 
procmail.  I don't use postfix, but in sendmail parlance, the alias would 
be something like:

outgoing-archiver:      "|/usr/bin/procmail -m 
/etc/procmailrcs/outgoing-archiver.rc"

NO global procmailrc will be invoked.

I use this sort of invocation all the time to invoke procmail as a 
front-end processor for a large number of majordomo listserves.

Thanks Sean.  I'll look into that.

FYI Postfix's "parlance" for alias is very close to sendmail's - it copies the
/etc/aliases file format and after changes to it you still use "newaliases"
etc.  There is also a command "sendmail" for compatibility with some software,
similar/same commandline arguments.

-- 
Troy Piggins | http://piggo.com/~troy                           
RLU#415538                                                      ,-O   (o-    O  
                                                               O   )  //\     O 
                                                                `-O   V_/_  OOO
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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