procmail
[Top] [All Lists]

Re: Using Formail to remove headers

2005-08-02 11:34:00
Stephen also asked,

        -I "X-Loop: $LOGNAME(_at_)$HOSTNAME" -X X-Loop: \
        -I "To: procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE" -X To: \

a) I've used -I instead of -A, although it seems I could have used either
(or even -i or -a).  Is -I the 'normal' option to use?

If there's no preexisting header with the same name, there's no 
difference.  If there is, -I will remove the old one and leave only the 
new one; -A will leave the old one and add the new one.

With X-Loop: you should use -A.  It's very unfriendly to use -I.  If 
someone else's X-Loop: header is already there and the message gets 
forwarded back to that person, but someone along the way has removed the 
earlier X-Loop:, the removal victim's setup will forward it again.

With To:, well, if you're going to use $SENDMAIL -t, you should add the 
new To: with -I so that you aren't sending a copy to the old To: address.


    | "$SENDMAIL" $SENDMAILFLAGS -t \
        -F "Stephen Allen" \
        -f procmail(_at_)mydomain(_dot_)com

a) I've ommitted the From: header and used -f in the SENDMAIL command
instead.  Is this OK?

Not the same.  -f sents the From_ envelope-sender address, not the From: 
header address.

b) I've used -t in the SENDMAIL command so it relies on the TO fields, is
this OK too?

In this particular case, yes.

The one last little bit I'm not sure about is how to correct the Message-ID.
I was informed by someone that I could probably do with changing that to
reflect the actual source domain (ie. mydomain.com).  At the moment it's
just pegged with the name of my Windows machine.

       Message-ID: <017401c5952c$70bd9720$c800a8c0(_at_)dangermouse>

Just some more options on the call to formail you're already making:

  -a Message-Id: -XMessage-Id: \

and that should do it.


____________________________________________________________
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