LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-13-2011, 03:36 PM   #1
moyorakkhi
Member
 
Registered: Jan 2011
Location: Dhaka
Posts: 80

Rep: Reputation: 1
POP before SMTP $pat


Hi,

I've installed pop-before-smtp in my mail server(iredmail). I need help to configure the $pat to read the pattern of my Dovecot file. Dovecote log file is like this:


Code:
2011-05-14 14:01:21 pop3-login: Info: Login: user=<test@example.com>, method=PLAIN, rip=180.234.45.133, lip=66.165.162.157
2011-05-14 14:01:22 POP3(test@example.com): Info: Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0
2011-05-14 14:01:52 pop3-login: Info: Login: user=<test@example.com>, method=PLAIN, rip=180.234.45.133, lip=66.165.162.157
2011-05-14 14:01:53 POP3(test@example.com): Info: Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0
Pop-before-smtp script by default offer this 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.
Kindly help me on this. Thanks

Last edited by moyorakkhi; 05-14-2011 at 02:42 PM.
 
Old 05-16-2011, 01:35 PM   #2
moyorakkhi
Member
 
Registered: Jan 2011
Location: Dhaka
Posts: 80

Original Poster
Rep: Reputation: 1
I've got it working with this regex format:

$pat = '^(\d\d\d\d-\d+-\d+ \d+:\d+:\d+) (?:imap|pop3)-login: Info: ' .
'Login: .*? (?:\[|rip=)[:f]*(\d+\.\d+\.\d+\.\d+)[],]';
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Smtp/pop rhlnewbie Linux - Newbie 2 04-11-2008 02:41 PM
Smtp +pop asi.linux Linux - Networking 1 11-23-2006 12:23 AM
pop before smtp ilnli Linux - Networking 16 09-22-2005 07:53 AM
Postfix or POP/SMTP jmirles Linux - Networking 2 12-16-2003 02:16 PM
Pop Smtp mjshel7 Linux - General 1 05-24-2002 07:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration