On 21/04/2015 5:23 PM, Olivier CALVANO wrote:
i use smtp_header_checks = pcre:/etc/postfix/logs_sujets

i change to:
    smtp_header_checks = regexp:/etc/postfix/logs_sujets
?

To use PCRE you will have to compile your own postfix from source, which is why i use regexp, its simpler for a novice like me :)
Just make sure you create the file "logs_subjects" and in that file put

/^Subject: / WARN


That should do the trick, oh and don't forget to reload postfix!

Phil


2015-04-21 8:53 GMT+02:00 phil <p...@philfixit.info
<mailto:p...@philfixit.info>>:

    On 21/04/2015 4:44 PM, Olivier CALVANO wrote:

        Hi

        thanks at all for your help, that's work.

        Only one problems:

        ?utf-8?B?Vm90cmUgZGV2aXMgc3VyIG1lc3VyZSBvZmZlcnQ=?
        ?utf-8?B?Vm90cmUgZGV2aXMgc3VyIG1lc3VyZSBvZmZlcnQ=?
        ?utf-8?B?Y2hyaXN0ZWxsZSwgcHJvZml0ZXogdml0ZSBkZSB2b



    Which method did you use regexp or pcre?
    Using the regexp method i get in my logs


    Apr 21 16:45:48 milmx01 postfix/cleanup[7242]: 17E5C15C076B:
    warning: header Subject: Re: Add subject in logs or into a file ?
    from camomile.cloud9.net <http://camomile.cloud9.net>[168.100.1.3];
    from=<owner-postfix-us...@postfix.org
    <mailto:owner-postfix-us...@postfix.org>> to=<p...@philfixit.info
    <mailto:p...@philfixit.info>> proto=ESMTP helo=<camomile.cloud9.net
    <http://camomile.cloud9.net>>

    regards
    Phil



        a lot of subjet are saved into the log in utf-8, i can said at
        postfix
        that decode it ?

        thanks
        olivier


        2015-04-19 11:35 GMT+02:00 Marius Gologan
        <marius.golo...@gmail.com <mailto:marius.golo...@gmail.com>
        <mailto:marius.golo...@gmail.com
        <mailto:marius.golo...@gmail.com>>>:

             If you want to log the Subject during the SMTP delivery
        (will appear
             as <timestamp> <hostname> postfix/smtp log):____

             __ __

        main.cf <http://main.cf> <http://main.cf>:____

             smtp_header_checks = pcre:/etc/postfix/header_smtp.pcre____

             __ __

             header_smtp.pcre:____

             /^Subject: / info____

             __ __

             __ __

             __ __

             *From:*owner-postfix-us...@postfix.org
        <mailto:owner-postfix-us...@postfix.org>
             <mailto:owner-postfix-us...@postfix.org
        <mailto:owner-postfix-us...@postfix.org>>
             [mailto:owner-postfix-us...@postfix.org
        <mailto:owner-postfix-us...@postfix.org>
             <mailto:owner-postfix-us...@postfix.org
        <mailto:owner-postfix-us...@postfix.org>>] *On Behalf Of
        *Olivier CALVANO
             *Sent:* Sunday, April 19, 2015 11:18 AM
             *To:* phil
             *Cc:* postfix-users
             *Subject:* Re: Add subject in logs or into a file ?____

             __ __

             Thanks i test today ;=)____

             __ __

             2015-04-19 7:27 GMT+02:00 phil <p...@philfixit.info
        <mailto:p...@philfixit.info>
             <mailto:p...@philfixit.info <mailto:p...@philfixit.info>>>:____

             On 19/04/2015 3:21 PM, Olivier CALVANO wrote:____

             Hi

             Actually, i have a Postfix server and into the logs i have:

             Apr 14 20:06:00 mx postfix/smtpd[24600]: 01BF8301079A:
             client=o1.email.xx.com <http://o1.email.xx.com>
        <http://o1.email.xx.com>
             <http://o1.email.xx.com>[192.xx.xx.153]
             Apr 14 20:06:00 mx postfix/cleanup[24932]: 01BF8301079A:
             message-id=<14cb9189909.2c84.ab5ac@ismtpd-061
             <mailto:14cb9189909.2c84.ab5ac@ismtpd-061
        <mailto:14cb9189909.2c84.ab5ac@ismtpd-061>>>
             Apr 14 20:06:00 mx postfix/qmgr[20732]: 01BF8301079A:
             from=<bounces+701539-9339-xx=xx...@email.xx.com
        <mailto:xx...@email.xx.com>
             <mailto:xx...@email.xx.com <mailto:xx...@email.xx.com>>
             <mailto:xx...@email.xx.com <mailto:xx...@email.xx.com>
        <mailto:xx...@email.xx.com <mailto:xx...@email.xx.com>>>>,
             size=18397, nrcpt=1 (queue active)
             Apr 14 20:06:01 mx postfix/smtp[24933]: 01BF8301079A:
             to=<myu...@xx.fr <mailto:myu...@xx.fr> <mailto:myu...@xx.fr
        <mailto:myu...@xx.fr>>
             <mailto:myu...@xx.fr <mailto:myu...@xx.fr>
        <mailto:myu...@xx.fr <mailto:myu...@xx.fr>>>>,
             relay=spam.mydomain.org <http://spam.mydomain.org>
        <http://spam.mydomain.org>
             <http://spam.mydomain.org>[2a02:xx:xx:X:X::400]:25, delay=1.5,
             delays=0.92/0.04/0.16/0.34, dsn=2.0.0, status=sent (250
        2.0.0 Ok: queued
             as BDE043004F53)
             Apr 14 20:06:01 mx postfix/qmgr[20732]: 01BF8301079A: removed



             I am search a solution for put into the logs the subject of
        the mail.
             Directly into the logs, sample:
                  Apr 14 20:06:01 mx postfix/smtp[24933]: 01BF8301079A:
        subject=test
             logs subject

             or into a separate file, sample:
                  01BF8301079A;test logs subject;

             it's possible ?

             regards
             Olivier____


             You can do a header check with a regexp in main.cf
        <http://main.cf> <http://main.cf>
             . . .

             header_checks = regexp:/etc/postfix/header_checks

             and in that file put something like . . .

             /^Subject: / WARN

             regards
             phil____

             __ __



Reply via email to