Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email firstname.lastname@example.org
From: mouss (moussnetoyen.net)
Date: Wed Jul 23 2008 - 02:44:41 CDT
Swati Meghanand wrote:
> 2008/7/22 mouss <moussnetoyen.net>:
>> Duane Hill wrote:
>>> On Tue, 22 Jul 2008, Swati Meghanand wrote:
>>>> Is possible to retrive information like
>>>> 'sender','recipient','message_size','date' from incoming mail using postfix.
>>>> I want to retrive this information from every incoming message and store
>>>> it to database or text file for reference
>>>> (some thing like 'exilog' for exim dose')
>>> You would need to create a policy service:
>>> You would need to use it in the smtpd_end_of_data_restrictions:
>>> as the message size is not known until then.
>> the problem is that at this stage, he doesn't get the recipients
>> (multi-rcpt mail), so he needs to call the policy service at rcpt stage as
>> an alternative is to parse logs.
> Thanks for ur replies
> I am running a postfix mail server with (MySQL based) virtual users and
> domains running more than 60 domains. I want to grab various information on
> per-user and per-domain basis. so my idea was to store all incoming mail
> information in MySQL database,parsing the log file was the pretty good
> option but I need to update this information in db quickly, it requires
> continuous parsing the log file as it grows I am not sure that weather this
> will be possible but currently working on the same.
you can either use a policy server as Duane suggested (but you'll need
to call it at both rcpt stage and end of data stage. the end of data
stage would not be needed if you don't care about the size), or parse
logs in real time (aka tail -f, but you need to handle log rotation).
the advantage with the policy service is that you don't need to
correlate multiple log lines. the advantage of log parsing is that it is
"out of band" (it does not "distrub" the smtp transactions) and can run
on another machine (since syslog can send logs to a remote machine).
the choice is yours...