procmail
[Top] [All Lists]

Re: archiving sent mail

2009-10-14 03:33:41
* Professional Software Engineering wrote :
At 11:04 2009-10-14 +1000, Troy Piggins wrote:
[snip]
I'd like to do similar with the sent mail.  I have set up postfix to
create a bcc mail of all mail originating from our domain name to
archiver(_at_)our(_dot_)domain(_dot_)name

Better then to just set up the archiver to be a program alias (i.e.
pipe directly to a procmail invocation).  No need for procmail to
check to see if that address was a recipient - if the recipe in
question is being run, obviously it was...

* ^TO_(_dot_)*archiver(_at_)our\(_dot_)domain\(_dot_)name

This may or may not match, depending upon whether your MTA inserts
the address into the headers anyplace when it creates the BCC.

Not sure if this email of yours and my followup to my own OP crossed
paths, but I have just replied to myself on this list that I've
changed the methodology slightly to make it (what I think is) a
little smarter.  (Umm - did that make sense?)

{
 FROM_USERNAME=`formail -rt -xTo: \
      | sed -e 's/[;\`\\]/ /g' \
      | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g' \
      | cut -f 1 -d @`

wow.  Local users won't ever mail out with different addresses?

No.  It's a small company with only about 12 users, and I have
configured all of their mail user agents.  If they use any address
other than the work ones, too bad they don't get archived.

BTW, you're aware that there will be issues for people who send mail
via SMTP which may not originate directly on your mailhost?

See above.  If they do, too bad, it doesn't get archived.  I'm only
interested in archiving mail going out of my server.

The mails do arrive in archiver's mbox, but they're not getting
copied to the sender's $HOME/Sent_0910.gz file.

So, what's your verbose logfile have to say about it?

Any ideas?  Initially I thought it might be the TO_ macro doesn't
handle BCC, but reading man procmailrc I think it does.

Only if the address APPEARS in a BCC header.  Generally speaking,
the header should never be present, except on mail being submitted
to an MSA.

Have you examined the messages arriving at the archiver mbox?

I have a working solution now as per my other mail.  There's
probably a more elegant way of achieving it, but at least it works.

Thanks, Sean.

-- 
Troy Piggins
____________________________________________________________
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>