On Dec 31, 2008, at 6:11 PM, mouss wrote:

Jeff Weinberger a écrit :
Hi:

After reading http://www.irbs.net/internet/postfix/0703/1471.html and
http://www.irbs.net/internet/postfix/0703/1519.html to help with my
autoreply capability (and making sure i get it as close to "right" as
possible!), I am trying to ensure that I can take all reasonable
measures to get the autoreplies right (when they are sent). to this end,
it's important that I capture the envelope-sender of each message in
addition to the "From:" header, but I am having difficulty doing so.


yes, don't reply to From: addresses. if you can't get the envelope
sender, don't autoreply.

I have tried to send the message to my autoreply script via bcc: (via
always_bcc or recipient_bcc_maps) to a local autoreply address which
then has the transport autoreply: which calls the autoreply script via pipe or is a local alias that resolves to '|/path/to/autoreply/ script'.
The transport mechanism has the ability to pass information from
postfix, but doesn't seem to capture the envelope-sender correctly.


The envelope sender should be found in the Retrun-Path header. when
using a pipe, make sure to put the 'R' flag in the "flags=..." options.

you can also use -f ${sender} in your pipe and have your scrpit parse
command line args.
I have tried using every single one of the macros listed in
http://www.postfix.com/pipe.8.html to no avail. I have even used some
macros that are not listed, but I've found in other examples as I've
searched for solutions.

This happens with mail sent to alias addresses as well as virtual
mailboxes.

Some e-mails from lists to which I subscribe include a "Sender: " header which looks like it contains the envelope-sender. Mail that shows up in
my standard ISP account (not ever touching my postfix installation)
seems to include the "Return-Path: " header which includes the
envelope-sender.

Leading me to two questions:

1) on-topic: How can I be sure I can find the envelope-sender for every message and pass that to my script? Or maybe I should ask it this way:
How do I get postfix to keep the correct envelope-sender?


always_bcc does not change the envelope sender (it changes the envelope
recipient). so you get the "correct" envelope sender.


2) broader: Is the list of macros that can be used as arguments to a
pipe command (as listed in http://www.postfix.com/pipe.8.html) complete? or are there others (like the ones I've found)? and where can I find a
complete list?

I would appreciate any help, direction or pointers that anyone can offer.

It might help to know that messages entering my postfix server are then
passed to a content_filter (Dspam, specifically, using
content_filter=dspam:dspam), which then re-injects them back into
postfix which then handles them and sends them to a delivery agent
(mostly maildrop, sometimes virtual). If the order of this (and the
passing through dpsam is affecting the envelope-sender, is there way to either get the message to the autoreply script before it goes to dspam (I don't want that, since I don't autoreply to spam messages) or a way to pass the envelope-sender through dpsam, or something else I haven't
considered?


check your logs to see if the envelope sender is present at delivery
time. if your content filters and other stuff reinjects mail using the
sendmail command, make sure to use -f to passe the (original)
envelope-sender.


Thank you!

I've verified that the "R" flag is there and I use -f ${sender} on the command line (the script does parse the arguments)

I think the envelope-sender is missing before it enters the content filter. This from my mail.log:

Dec 31 19:50:07 s postfix/qmgr[3345]: A4C5E2943D74: from=<m...@myisp.tld>, size=1505, nrcpt=1 (queue active) Dec 31 19:50:07 s postfix/smtpd[3340]: disconnect from smtp120.isp.mail.sp1.myisp.tld[69.147.64.93] Dec 31 19:50:07 s dspam[3356]: query error: VERBOSE DEBUG (INFO ONLY - NOT AN ERROR): see sql.errors for more details
Dec 31 19:50:09 s postfix/smtpd[3348]: connect from localhost[127.0.0.1]
Dec 31 19:50:09 s postfix/smtpd[3348]: 646A62943D79: client=localhost[127.0.0.1] Dec 31 19:50:09 s postfix/cleanup[3344]: 646A62943D79: message-id=<fb0b0ed6-d05d-48c6-a077-10662907d...@myisp.tld > Dec 31 19:50:09 s postfix/qmgr[3345]: 646A62943D79: from=<>, size=2936, nrcpt=1 (queue active) Dec 31 19:50:09 s postfix/smtpd[3348]: disconnect from localhost[127.0.0.1] Dec 31 19:50:09 s postfix/pipe[3346]: A4C5E2943D74: to=<mypost...@virtualmailbox.tld >, relay=dspam, delay=5.1, delays=3.4/0/0/1.7, dsn=2.0.0, status=sent (delivered via dspam service)

(identifying information removed)

The "from=<>" in the third-to-last line I assume should be the envelope-sender?

This happens whether I send from my ISP mail address, another locally- hosted virtual mailbox or anywhere else.

Is this part of the problem?

If so, where can I start to look for a solution? or what information would be helpful?

Thank you!


Reply via email to