Hi monks, I have a postfix logfile /var/log/maillog. I want to send a blocked mail digest to users on daily basis. ( Let's say @ 10.30 am everyday). I want to print all lines from 10.30 a.m from yesterday to 10.30 am today from this /var/log/maillog to anoter file.
Then I will grep the BLOCKED mails from this file and send a Blocked mail Digest report to users.
How can I achieve this?
I found similar urls.
Extracting Log File data for a given date range
http://stackoverflow.com/questions/21995141/perl-script-to-extract-data-from-log-file-between-two-date-ranges-not-necessary
mail maillog looks like this
and so on I am still trying to write it. Can you monks help me on this.Feb 1 03:10:39 mailgw postfix/smtpd[31168]: disconnect from host.doma +in.net[8.3.14.x] Feb 1 03:10:41 mailgw postfix/smtpd[31175]: connect from localhost.lo +caldomain[127.0.0.1] Feb 1 03:10:41 mailgw postfix/smtpd[31175]: 42B1A1620467: client=loca +lhost.localdomain[127.0.0.1]
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |