[wplug] procmail help

Chester R. Hosey chosey at nauticom.net
Fri May 19 11:00:31 EDT 2006


Gentgeen wrote:
> 1st - I am sure there is probably a "prettier way" to do that, but it is
> working right now (at least the To and Cc).  If anyone wants to help me
> make it prettier, great. :-)  

You can use the pipe character to specify either-or matches.

> :0:
> * ^(To).*kvsquire at comcast.net
> $MAILDIR/Other_Acct/kvsquire/.
>
> :0:
> * ^(Cc).*kvsquire at comcast.net
> $MAILDIR/Other_Acct/kvsquire/.

This could be consolidated as follows:

:0:
* ^(To|Cc).*kvsquire at comcast.net
$MAILDIR/Other_Acct/kvsquire/.

Also, it's probably not a bad idea to specify the header-tag delimiter
specifically -- all header tags should end in a colon, so it doesn't
hurt to make it explicit:

:0:
* ^(To|Cc):.*kvsquire at comcast.net
$MAILDIR/Other_Acct/kvsquire/.

Note that procmail is not case sensitive by default, which is entirely
reasonable in this case. You can write "TO|CC", "to|cc", or any
variation you desire.


> 2nd - My question really is how can I grap BCC mail?  Looking at the
> header of a test send did not show anything that I found helpful, and
> the test sends all went to the default folder.

BCC is stripped in transit, so procmail won't see it. There's probably
nothing reasonable that you can do about this, unless someone knows of a
clever way to get the local MTA to save the envelope information as
another header.

There's another possibility that _might_ be good enough for your
purposes, although there's a good chance of misidentifying mail
depending on your circumstances. You could check the "Received" headers
for anything that's gone through comcast.net, and this would catch mail
which ended up at your Comcast address.

This would _also_ catch mail sent by Comcast customers to any of your
email addresses, since that mail would also have gone through a Comcast
address. Finally, if the machine on which you're running your mail
server is on a Comcast address (such as a cable modem), it'll pretty
much catch everything that ends up there, since everything will have
gone through the local address.

If you're not sure, or if any of this is unclear, then feel free to
describe your setup in a little bit more detail (off-list is fine, if
you'd rather not make details public) and I'd be glad to help you sort
this all out.


Chet


More information about the wplug mailing list