[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 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
On Mon, Jan 30, 2006 at 10:10:39AM +0100, Gerhard Hofmann wrote:
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?
Both look good. Both should match the mail.log line you've quoted. (You did quote all of the line, right? The ^ matches the beginning of the line). Check elsewhere (like file names, the modification times of .db files may help you diagnose chroot problems), insert debugging in the perl script . . .
HTH
participants (2)
-
Gerhard Hofmann
-
Lorens Kockum