procmail
[Top] [All Lists]

Please help with questions about Procmail as a filter...

1998-05-18 16:57:15
Dear Procmail Experts:

As someone who is not fluent in either Unix or programming languages in
general, I have searched my Internet Service Provider's "procmail manual"
pages in vain for the solutions to the following functions I wish to have
Procmail perform when filtering my mail. Can you advise, in layman's
terms?

1.      SEND MAIL TO DEFAULT FILE WITH HEADER INFORMATION AS NORMAL,
        AND/OR GROUP FORWARD WITHOUT HEADERS

From time to time I receive e-mail regarding special subjects that I wish
to receive in my default mail collection directory normally, PLUS 
sometimes forward to a group of other people without including the 
original header information in the forwarded mail. Can Procmail do this
for me via information in my .procmailrc file, or what does this require?


2.      FILTER MAIL FROM SELECTED SENDER OR HOST *EXCEPT* WHEN THE SUBJECT
        LINE CONTAINS SELECTED CHARACTERS

Can I simply alter my .procmailrc file so that mail from *(_at_)abc(_dot_)com, 
for 
example, will go to my default mail directory as normal, UNLESS the 
subject line contains offending characters, such as FREE OFFER or MONEY 
MAKER, in which case the mail would be sent to another designated file?

3.      AUTOMATIC FILTER TO DESIGNATED FILE *PLUS* RETURN TO SENDER'S ISP
        WITH A GENERIC MESSAGE FROM ME?

From time to time I receive mail from various e-mail junk mailers, and I
wish to simply forward their mail with complete headers to their Internet
service provider (such as postmaster(_at_)sender's host.com), along with a
request that the provider investigate and take appropriate action. I also
wish to keep a full copy of the offending e-mail for my records. Can I
configure Procmail to do this?


4.      THE PURPOSE OF THE SECOND COLON (:) IN THE .PROCMAILRC RECIPES

What is the purpose of the second (:) ? My Internet Service Provider
suggests that my recipes should include a second colon (:) in the first
line, like this:

:0:
* ^TO(_dot_)*newnet-list(_at_)(_dot_)*eskimo(_dot_)com
nn-list

However, the same recipe in my .procmailrc file would look like this:

:0
 ^TO(_dot_)*newnet-list(_at_)(_dot_)*eskimo(_dot_)com
nn-list

And the only recipes I use with the second (:) are like this:

:1Hw:
 ^Subject.*\$\$
/dev/null


5.      DIRECTING MAIL THAT IS ADDRESSED TO ME GENERICALLY RATHER THAN
        SPECIFICALLY

Occasionally I receive junk e-mail that is not addressed to me 
specifically, but instead is addressed to something like 
friend(_at_)myhost(_dot_)com(_dot_) Currently, the way I deal with this is:

:0
 *friend@
/dev/null

However, I would like to make a recipe that is more specific, to say that
if my actual e-mail address is not either the addressee, the CC or BCC
addressee of the e-mail, the mail is then deposited in the alternate
directory of my choice (which may or may not be /dev/null). Can Procmail
do this?


6.      THE MYSTERY OF THE LEADING *ASTERISK*

My Internet Service Provider assures me that my .procmailrc file should
include a leading asterisk (*) on the second line of each recipe, like
this:

PATH=/usr/bin:/usr/local/bin^M^M
MAILDIR=$HOME/procmail
DEFAULT=/var/spool/mail/georgem
LOGFILE=$HOME/.procmail.log
#LOGFILE=/dev/null

:0:
* ^TO(_dot_)*newnet-list(_at_)(_dot_)*eskimo(_dot_)com
nn-list

My ISP says this leading (*) may not be required for Procmail to
function, but that it may be required with future updated versions of
Procmail. Meanwhile, including this character works for their staff
members personally. However, when I try writing my recipes this way,
Procmail stops working for me altogether! I am reluctant to change my
.procmailrc file to their method because mine is now working. Why would
their method work for some and not for me? And are they correct about
future versions of Procmail requiring the leading (*) in the recipes?

Your patience with me (the novice!) and your insights into these questions
are greatly appreciated. I eagerly await your response. Could you please
reply to georgem(_at_)eskimo(_dot_)com and bgudgel(_at_)eskimo(_dot_)com?

Best Regards,
georgem(_at_)eskimo(_dot_)com
George Marshall
Seattle, Washington, USA


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