Discussion:
Is the envelope sender available in header_checks?
(too old to reply)
Harald Weidner
22 years ago
Permalink
Hello,

The Subject already asks my question.

I use the header_checks feature together with a regexp table to pass
some mails to a FILTER target, depending on the sender address.

So far, the rule is of the type /^From:.*something/. But there are
cases where the header "From:" address differs from the envelope
"From " address, which really should be the key for filtering.

I tried a rule like /^From :*something/, but the mail seems not to be
in Unix MBOX format at this stage of processing. Also, a rule like
/^Return-Path:.*something/ did not match any e-mail in the
header_checks table.

Is there a way to match the envelope sender address in the header_checks
regexp table?

I use a Postfix-2.0.16 Debian package from http://www.backports.org/.

Regards,
Harald
--
Harald Weidner ***@gmx.net
Kyle Dent
22 years ago
Permalink
...
Is there a reason not to use check_sender_access?

Kyle
Wietse Venema
22 years ago
Permalink
Post by Harald Weidner
Is there a way to match the envelope sender address in the header_checks
regexp table?
There is no guarantee that headers contain envelope information.

If you must filter on envelope sender, try the FILTER action
in SMTPD access maps. man 5 access.

Wietse
Harald Weidner
22 years ago
Permalink
Hello,
Post by Kyle Dent
Is there a reason not to use check_sender_access?
As far as I understood, check_sender_access is something which appears
behind smtpd_sender_restrictions, and is therefore only useful for the
smtp server. Please correct me if I'm wrong.

I need this feature for locally generated mails, e.g. working
with postdrop/pickup/cleanup. Sorry that I didn't mention in my
first mail.

Regards,
Harald
--
Harald Weidner ***@gmx.net
Wietse Venema
22 years ago
Permalink
Post by Harald Weidner
Hello,
Post by Kyle Dent
Is there a reason not to use check_sender_access?
As far as I understood, check_sender_access is something which appears
behind smtpd_sender_restrictions, and is therefore only useful for the
smtp server. Please correct me if I'm wrong.
I need this feature for locally generated mails, e.g. working
with postdrop/pickup/cleanup. Sorry that I didn't mention in my
first mail.
Aha, in that case you have more control over what appears in message
headers. You could, for example, insert an X-Envelope-From: header
with the envelope sender address.

Wietse
Harald Weidner
22 years ago
Permalink
Hello,
Post by Wietse Venema
Post by Harald Weidner
I need this feature for locally generated mails, e.g. working
with postdrop/pickup/cleanup.
Aha, in that case you have more control over what appears in message
headers. You could, for example, insert an X-Envelope-From: header
with the envelope sender address.
Unfortunately, I have no control over the software generating those
mails, because it's proprietary closed source. That's why I seeked a
way to do it with Postfix.

Fortunately, this software runs under a dedicated user id, so I'll set
up a script that wraps /usr/sbin/sendmail, inserting an additional
header line if running under that id.

Thanks for your help.

Regards,
Harald
--
Harald Weidner ***@gmx.net
Wietse Venema
22 years ago
Permalink
Post by Harald Weidner
Hello,
Post by Wietse Venema
Post by Harald Weidner
I need this feature for locally generated mails, e.g. working
with postdrop/pickup/cleanup.
Aha, in that case you have more control over what appears in message
headers. You could, for example, insert an X-Envelope-From: header
with the envelope sender address.
Unfortunately, I have no control over the software generating those
mails, because it's proprietary closed source. That's why I seeked a
way to do it with Postfix.
Of course you do.
Post by Harald Weidner
Fortunately, this software runs under a dedicated user id, so I'll set
up a script that wraps /usr/sbin/sendmail, inserting an additional
header line if running under that id.
Exactly.

Wietse
Post by Harald Weidner
Thanks for your help.
Regards,
Harald
--
Continue reading on narkive:
Loading...