Gerhard Hofmann
2006-Jan-27 12:41 UTC
[Dovecot] Question about $pat in pop-before-smtp.conf
Hi, I have setup dovecot to log all successful pop3 and imap logins into /var/log/mail.log I want to use pop-before-smtp to process the log file and write a .db file where sendmail can look up ip addresses that are allowd to relay. mail.log entries look like this: dovecot: 2006-01-26 17:22:28 Info: pop3-login: Login: user=<planat25>, method=PLAIN, rip=213.83.32.125, lip=192.168.1.98 So the question is: how should $pat variable look in pop-before-smtp.conf? I tried the patterns suggested in the WIKI and they do not work. I must admit I'm a newbie to this regex stuff. BTW, would it be easier to patch my dovecot daemon to use DRAC instead? TIA Gerhard
Gerhard Hofmann
2006-Jan-30 11:11 UTC
[Dovecot] Re: Question about $pat in pop-before-smtp.conf
Gerhard Hofmann wrote:> I want to use pop-before-smtp to process the log file and write a .db > file where sendmail can look up ip addresses that are allowd to relay. > > mail.log entries look like this: > dovecot: 2006-01-26 17:22:28 Info: pop3-login: Login: user=<planat25>, > method=PLAIN, rip=213.83.32.125, lip=192.168.1.98 > > So the question is: how should $pat variable look in > pop-before-smtp.conf?In the meantime I have tried out this $pat = '^dovecot: (....-..-.. ..:..:..) Info: ' . '(?:imap|pop3)-login: Login: .* rip=[:f]*(\d+\.\d+\.\d+\.\d+),'; and this $pat = '^dovecot: (....-..-.. ..:..:..) Info: ' . '(?:imap|pop3)-login: Login: \S+, \S+, rip=(\d+\.\d+\.\d+\.\d+),'; Both do not work. Any ideas? TIA Gerhard