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

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

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

Josef Karliak-2
   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


attachment0 (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Reindl Harald-2


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



signature.asc (267 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Robert Schetterer
In reply to this post by Josef Karliak-2
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
Reply | Threaded
Open this post in threaded view
|

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

Robert Schetterer
In reply to this post by Reindl Harald-2
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
Reply | Threaded
Open this post in threaded view
|

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

Josef Karliak-2
   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 <[hidden email]>:

> 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


attachment0 (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Wietse Venema
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