procmail
[Top] [All Lists]

Re: Using $SENDMAIL $SENDMAILFLAGS

2010-03-03 13:49:39
At 10:21 2010-03-03 -0600, Harry Putnam wrote:
I've used this statement for yrs in ~/procmailrc

 :0
  * ^To: user(_at_)host(_dot_)some(_dot_)com
    |$SENDMAIL $SENDMAILFLAGS reader(_at_)newsguy(_dot_)com

But don't really know the details of what it really does.

SENDMAIL is set to the path to the binary for the MSA. SENDMAILFLAGS are the flags commonly used to invoke it. Normally, you shouldn't need to PIPE it. use ! (forward):

:0
* ^To: user(_at_)host\(_dot_)example\(_dot_)com
! reader(_at_)newsguy(_dot_)com

! basically invokeds $SENDMAIL $SENDMAILFLAGS _address_ Note that because ! is doing this, you can specifiy MSA flags right after the ! - everything needn't bee an address.

Having the two variables however is very handy. My sandbox configuration for example redefines $SENDMAIL to point to a helper script, which merely emits the message and commandline arguments to a logging mailbox - very useful for testing forward and remailing recipes without having to hack anything in the recipe itself (which is a leading way to introduce errors). Thus, when testing a recipe which generates mails, no actual mail is introduced to the real MSA - but I can review the logs to see how the MSA would have been invoked, and was was being handed to it.

I've run into a problem where I've set a filter on my Mail server
(newsguy.com) to delete messages not addressed to me.

You mean not "cleartext" addressed to you?

I'd suggest adding logic to your endpoint filter to allow messages coming from this forwarding host. That's better than rewriting the message headers, which only goes to conceal original message content.

But I assumed the

  |$SENDMAIL $SENDMAILFLAGS reader(_at_)newsguy(_dot_)com

Rewrote the To: line so it would be reader(_at_)newsguy(_dot_)com

No, the address specified on the commandline is treated as a BCC.

If you want to rewrite the to, pipe it through formail to do so, THEN forward it (but be wary of using arguments to sendmail to "parse the message for recipients" because you'll then resend to CC recipients, which isn't nice).

  |$SENDMAIL $SENDMAILFLAGS reader(_at_)newsguy(_dot_)com

actually does... what rewriting if any takes place?

None.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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