Hi,
I'm trying to implement pop-before-smtp in our server. I've followed the procedure mentioned here. But got stuck up in pop-before-smtp $pat pattern. The dovecot log format is like this:
2011.05.13-14:54:58, test@xyz.com, 180.234.47.11, pop3
2011.05.13-14:57:26, test@xyz.com, 180.234.47.12, pop3
2011.05.13-14:57:54, www@somedomain.com, 66.22.22.124, imap
2011.05.13-14:57:55, www@somedomain.com, 66.22.22.124, imap
2011.05.13-15:03:08, www@somedomain.com, 66.22.22.124, pop3
Pop-before-smtp script by default offer the following pattern for Dovecot. But it's not working for me
Code:
# For Dovecot POP3/IMAP when using syslog.
$pat = '^[LOGTIME] \S+ (?:dovecot: )?(?:imap|pop3)-login: ' .
'Login: .*? (?:\[|rip=)[:f]*(\d+\.\d+\.\d+\.\d+)[],]';
$out_pat = '^[LOGTIME] \S+ (?:dovecot: )?(?:imap|pop3)-login: ' .
'Disconnected.*? (?:\[|rip=)[:f]*(\d+\.\d+\.\d+\.\d+)[],]';
# For Dovecot POP3/IMAP when it does its own logging.
$logtime_pat = '(\d\d\d\d-\d+-\d+ \d+:\d+:\d+)';
$pat = '^dovecot: [LOGTIME] Info: (?:imap|pop3)-login: ' .
'Login: .+? rip=[:f]*(\d+\.\d+\.\d+\.\d+),';
$out_pat = '^dovecot: [LOGTIME] Info: (?:imap|pop3)-login: ' .
'Disconnected.*? rip=[:f]*(\d+\.\d+\.\d+\.\d+),';
# For older Dovecot POP3/IMAP when it does its own logging.
$pat = '^(?:imap|pop3)-login: [LOGTIME] Info: ' .
'Login: \S+ \[[:f]*(\d+\.\d+\.\d+\.\d+)\]';
$out_pat = '^(?:imap|pop3)-login: [LOGTIME] Info: ' .
'Disconnected.*? \[[:f]*(\d+\.\d+\.\d+\.\d+)\]';
Pop-before-smtp needs to read the IP from the log by regex.
Thanks for you help in advance.