Loading ...
Sorry, an error occurred while loading the content.

Postfix 2.8.x and how to log "summary" into a mysql

Expand Messages
  • Josef Karliak
    Good morning, did anybody solved recording sender,recipient and date into a mysql ? Normally postfix log it into a maillog, I want it into a database record
    Message 1 of 6 , Sep 5, 2012
    • 0 Attachment
      Good morning,
      did anybody solved recording sender,recipient and date into a mysql
      ? Normally postfix log it into a maillog, I want it into a database
      record "sender recipient date". Or it is able to change postfix's
      logging, where is summary on a one line ?
      Thanks for tips and best regards
      J.K.

      --
      Ma domena pouziva zabezpeceni a kontrolu SPF (www.openspf.org) a
      DomainKeys/DKIM (with ADSP) . Pokud mate problemy s dorucenim emailu,
      zacnete pouzivat metody overeni puvody emailu zminene vyse. Dekuji.
      My domain use SPF (www.openspf.org) and DomainKeys/DKIM (with ADSP)
      policy and check. If you've problem with sending emails to me, start
      using email origin methods mentioned above. Thank you.

      ----------------------------------------------------------------
      This message was sent using IMP, the Internet Messaging Program.




      __________ Information from ESET Mail Security, version of virus signature database 7447 (20120905) __________

      The message was checked by ESET Mail Security.
      http://www.eset.com
    • Reindl Harald
      ... postfix is logging to syslog-daemon rsyslog supports mysql as target however sender recipient date is impossible
      Message 2 of 6 , Sep 5, 2012
      • 0 Attachment
        Am 05.09.2012 10:50, schrieb Josef Karliak:
        > Good morning,
        > did anybody solved recording sender,recipient and date into a mysql ? Normally postfix log it into a maillog, I
        > want it into a database record "sender recipient date". Or it is able to change postfix's logging, where is summary
        > on a one line ?

        postfix is logging to syslog-daemon

        rsyslog supports mysql as target
        however "sender recipient date" is impossible
      • Robert Schetterer
        ... depend on your syslog server look i.e here http://www.rsyslog.com/doc/rsyslog_mysql.html -- Best Regards MfG Robert Schetterer
        Message 3 of 6 , Sep 5, 2012
        • 0 Attachment
          Am 05.09.2012 10:50, schrieb Josef Karliak:
          > Good morning,
          > did anybody solved recording sender,recipient and date into a mysql ?
          > Normally postfix log it into a maillog, I want it into a database record
          > "sender recipient date". Or it is able to change postfix's logging,
          > where is summary on a one line ?
          > Thanks for tips and best regards
          > J.K.
          >

          depend on your syslog server
          look i.e here
          http://www.rsyslog.com/doc/rsyslog_mysql.html

          --
          Best Regards
          MfG Robert Schetterer
        • Robert Schetterer
          ... perhaps its possible with prefilter logging rsyslog mysql with template but it might not be trivial look ( sorry german )
          Message 4 of 6 , Sep 5, 2012
          • 0 Attachment
            Am 05.09.2012 10:57, schrieb Reindl Harald:
            >
            >
            > Am 05.09.2012 10:50, schrieb Josef Karliak:
            >> Good morning,
            >> did anybody solved recording sender,recipient and date into a mysql ? Normally postfix log it into a maillog, I
            >> want it into a database record "sender recipient date". Or it is able to change postfix's logging, where is summary
            >> on a one line ?
            >
            > postfix is logging to syslog-daemon
            >
            > rsyslog supports mysql as target
            > however "sender recipient date" is impossible
            >
            >

            perhaps its possible with prefilter logging rsyslog mysql with template

            but it might not be trivial

            look ( sorry german )

            http://lab4.org/wiki/Mailbounces_monitoren_mit_rsyslog_und_mysql

            for ideas

            --
            Best Regards
            MfG Robert Schetterer
          • Josef Karliak
            Great, thanks. I m logging, its easy. I must find variable for inserting sender email address into a mysql, hosts, time and recipient is done by your tip. Or
            Message 5 of 6 , Sep 5, 2012
            • 0 Attachment
              Great, thanks. I'm logging, its easy. I must find variable for
              inserting "sender" email address into a mysql, hosts, time and
              recipient is done by your tip. Or anybody knows ?
              Thanks a lot!
              J.K.

              Cituji Robert Schetterer <robert@...>:

              > Am 05.09.2012 10:57, schrieb Reindl Harald:
              >>
              >>
              >> Am 05.09.2012 10:50, schrieb Josef Karliak:
              >>> Good morning,
              >>> did anybody solved recording sender,recipient and date into a
              >>> mysql ? Normally postfix log it into a maillog, I
              >>> want it into a database record "sender recipient date". Or it is
              >>> able to change postfix's logging, where is summary
              >>> on a one line ?
              >>
              >> postfix is logging to syslog-daemon
              >>
              >> rsyslog supports mysql as target
              >> however "sender recipient date" is impossible
              >>
              >>
              >
              > perhaps its possible with prefilter logging rsyslog mysql with template
              >
              > but it might not be trivial
              >
              > look ( sorry german )
              >
              > http://lab4.org/wiki/Mailbounces_monitoren_mit_rsyslog_und_mysql
              >
              > for ideas
              >
              > --
              > Best Regards
              > MfG Robert Schetterer
              >
              >
              > __________ Information from ESET Mail Security, version of virus
              > signature database 7447 (20120905) __________
              >
              > The message was checked by ESET Mail Security.
              > http://www.eset.com
              >
              >
              >



              --
              Ma domena pouziva zabezpeceni a kontrolu SPF (www.openspf.org) a
              DomainKeys/DKIM (with ADSP) . Pokud mate problemy s dorucenim emailu,
              zacnete pouzivat metody overeni puvody emailu zminene vyse. Dekuji.
              My domain use SPF (www.openspf.org) and DomainKeys/DKIM (with ADSP)
              policy and check. If you've problem with sending emails to me, start
              using email origin methods mentioned above. Thank you.

              ----------------------------------------------------------------
              This message was sent using IMP, the Internet Messaging Program.




              __________ Information from ESET Mail Security, version of virus signature database 7447 (20120905) __________

              The message was checked by ESET Mail Security.
              http://www.eset.com
            • Wietse Venema
              ... In main.cf specify enable_long_queue_ids = yes to get unique queue identifiers. That will immensely simplify logfile analysis. Then extract (perhaps via
              Message 6 of 6 , Sep 5, 2012
              • 0 Attachment
                Josef Karliak:
                > Great, thanks. I'm logging, its easy. I must find variable for
                > inserting "sender" email address into a mysql, hosts, time and
                > recipient is done by your tip. Or anybody knows ?

                In main.cf specify "enable_long_queue_ids = yes" to get unique queue
                identifiers. That will immensely simplify logfile analysis.

                Then extract (perhaps via rsyslog) records with:

                time, queue_id, sender, recipient-count (logged by the qmgr process)
                time, queue_id, recipient, status (logged by delivery agents)

                You may also want these:

                time, queue_id, message-id (logged by the cleanup process)
                time, old_queueid, new_queue_id (logged by the bounce process)

                Based on the unique queue_id information you can then reconstruct
                all Postfix activity related to that message.

                Wietse
              Your message has been successfully submitted and would be delivered to recipients shortly.