X Header Logging Postfix

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

X Header Logging Postfix

Matthias Schneider
Hello,

for incoming mails logging the X-Headers works pretty fine by using:

header_checks = regexp:/etc/postfix/header_checks

the file header_checks contains:
/^X-.*:/        INFO

Logfile:

Aug 17 16:56:31 mta01 postfix/cleanup[15387]: 3xY8Rz2rFJzDxk2: info:
header X-TEST: value from localhost[127.0.0.1]:54582;
from=<[hidden email]> to=<[hidden email]> proto=ESMTP
helo=<mta01.dev.local>

For sending mails using `smtp_header_checks` it _only_ logs the headers
if a connection to the destination server was established:

Aug 17 16:48:48 mta01 postfix/smtp[14811]: 3xY8Rz2rFJzDxk2: info: header
X-TEST: value

in case of a tempfail there is no header logged, is it possible to
change this behavior to always log the headers for each delivery attempt?


No header in delivery attampt:

Aug 17 16:49:57 mta01 postfix-10.223.1.218/smtp[14811]: connect to
127.0.0.1[127.0.0.1]:25666: Connection refused
Aug 17 16:49:57 mta01 postfix-10.223.1.218/smtp[14811]: 3xY8Hj5zmDzDxjx:
to=<[hidden email]>, relay=none, delay=36,
delays=36/0/0/0, dsn=4.4.1, status=deferred (connect to
127.0.0.1[127.0.0.1]:25666: Connection refused)


Best regards


Matthias Schneider

Reply | Threaded
Open this post in threaded view
|

Re: X Header Logging Postfix

Noel Jones-2
On 8/17/2017 10:33 AM, Matthias Schneider wrote:
> For sending mails using `smtp_header_checks` it _only_ logs the
> headers if a connection to the destination server was established:
>
> Aug 17 16:48:48 mta01 postfix/smtp[14811]: 3xY8Rz2rFJzDxk2: info:
> header X-TEST: value
>
> in case of a tempfail there is no header logged, is it possible to
> change this behavior to always log the headers for each delivery
> attempt?

Not possible.  The smtp_header_checks are processed *during*
delivery.  If there is no delivery, there is no opportunity for
postfix to examine the headers.



  -- Noel Jones