Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Migration

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-26-2008, 08:04 AM
Junior Member
 
Posts: 5
Default [SOLVED] pop before smtp authentication

We are migrating from Qmail/Vpopmail to Zimbra. On the qmail side, we have pop before smtp authentication configured for relay access.

Is some form of pop before smtp available for Zimbra?

Thanks,
Nick
Reply With Quote
  #2 (permalink)  
Old 03-26-2008, 01:55 PM
Junior Member
 
Posts: 5
Default Resolved pop before smtp auth

I was able to get this working. Zimbra team, maybe you should consider this as an option in the future..

1) Download and install Pop-before-smtp Home
- Changes in /etc/pop-before-smtp-conf.pl:
$dbfile = '/opt/zimbra/postfix/conf/pop-before-smtp';
$ENV{'PATH'} = '/opt/zimbra/postfix/sbin';
$logtime_pat = '(\d\d\d\d-\d\d-\d\d \d+:\d+:\d+)';

$pat = '[LOGTIME],\d+\ INFO \[Pop3Server-\d+\\] \[name=[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4};oip=(\d+\.\d+\.\d+\.\d+);\] pop \- user [A-Za-z0-9._%-
]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4} authenticated, mechanism=login';

$out_pat = '[LOGTIME],\d+\ INFO \[Pop3Server-\d+\\] \[name=[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4};oip=(\d+\.\d+\.\d+\.\d+);\] pop \- quit from client';


(you can download my pop-before-smtp-conf.pl file http://www.mnxsolutions.com/scripts/...e-smtp-conf.pl )

2) Change /opt/zimbra/conf/log4j.properties.in:
from: %%uncomment VAR:!zimbraLogToSyslog%%log4j.rootLogger=INFO,LOGF ILE
to: %%uncomment VAR:!zimbraLogToSyslog%%log4j.rootLogger=DEBUG,LOG FILE

3) add a line at the beginning of /opt/zimbra/conf/postfix_recipient_restrictions.cf

check_client_access hash:/opt/zimbra/postfix/conf/pop-before-smtp


Restart zimbra and start he pop-before-smtp daemon.

It would be nice if the INFO logging had the IP address of the authenticated user, rather than having to enable debug.

nick - mnxsolutions.com
Reply With Quote
  #3 (permalink)  
Old 03-26-2008, 03:55 PM
Junior Member
 
Posts: 5
Default [Resolved] Pop before smtp auth

I tried posting this here, but it did go through. Anyhow, I created a posting on our blog with all the details here:.


Quick summary:
1) Download and install Pop-before-smtp
2) Change /opt/zimbra/conf/log4j.properties.in
3) add a line at the beginning of opt/zimbra/conf/postfix_recipient_restrictions.cf
4) Restart zimbra and start the pop-before-smtp daemon.
__________________
MNX Solutions - Your Linux, UNIX and SAP Basis experts
Reply With Quote
  #4 (permalink)  
Old 03-26-2008, 10:53 PM
Zimbra Consultant
 
Posts: 5,814
Default

Cool & welcome to the forums!
I see you've already met our watchdog fido: Forum Spam & Security Update
-Don't worry, he won't bite ya too hard anymore
__________________
-Mike Morse (MCode151)

ZCS-to-ZCS Migrations & Moves | Admin Tools & Tidbits » ZimbraBlog.com | ZimbraCommunity.com
Reply With Quote
  #5 (permalink)  
Old 04-10-2008, 08:56 AM
OpenSource Builder
 
Posts: 44
Default

I have created RPM for centos-5 with patches you proposed in pop-before-smtp-conf.pl. For me it was required to patch pop-before-smtp to make it use perl Date::Format and Date::Parse installed with zimbra-core, instead of installing it from CPAN.
These changes for /opt/zimbra/conf/log4j.properties.in and /opt/zimbra/conf/postfix_recipient_restrictions.cf are done by post install script of the RPM and they are reverted at uninstall of the rpm by preun script.
If anybody interested I can place this rpm, spec and patch somewhere for viewing/downloading.

--
Sergey.
Reply With Quote
  #6 (permalink)  
Old 04-10-2008, 02:43 PM
Junior Member
 
Posts: 5
Default Update

I actually rewrote the pop-before-smtp configuration to support standard multi-line logging, no need to update the log4j properties.

Refer to the blog posting for the latest updated information: http://www.mnxsolutions.com/blog/lin...ion-howto.html

Use these rules in place of $pat and $out_pat in step 1:

$PID_pat = ‘^[LOGTIME],\d+\ INFO \[Pop3[A-Za-z]+-(\d+)\] ‘;
$IP_pat = $PID_pat . ‘\[ip=(\d+\.\d+\.\d+\.\d+);\] pop \- connected’;
$OK_pat = $PID_pat . ‘\[name=[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4};\] pop \- user [A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4} authenticated, mechanism=[A-Za-z]+’;
$FAIL_pat='sdfsdf';
__________________
MNX Solutions - Your Linux, UNIX and SAP Basis experts
Reply With Quote
  #7 (permalink)  
Old 04-10-2008, 04:31 PM
OpenSource Builder
 
Posts: 44
Default

How did you managed zimbra to write Pop3 authentication messages to /var/log/maillog?
Or have you changed it to be /opt/zimbra/log/mailbox.log and did not mentioned it here in your previous posts?
--
Sergey.
Reply With Quote
  #8 (permalink)  
Old 04-10-2008, 04:35 PM
Junior Member
 
Posts: 5
Default

I left that part out on accident. The config files are available for download on the blog posting, and point to the mailbox.log file.
__________________
MNX Solutions - Your Linux, UNIX and SAP Basis experts
Reply With Quote
  #9 (permalink)  
Old 06-01-2008, 01:14 AM
Starter Member
 
Posts: 1
Default Support for IMAP

Due to out zimbra implementation being a migration from an existing server with hundreds of users all using pop-before-smtp, we were require to enable this tool as well. Everything from the mnxsolutions blog posting above worked fine except that the INFO multiline authentication patterns did not catch IMAP logins, so we changed them to the following and everything appears to be working correctly, both POP3 and IMAP:

$PID_pat = '^[LOGTIME],\d+\ INFO \[(?:Pop3|Imap)[A-Za-z]+-(\d+)\] ';
$IP_pat = $PID_pat . '[\S\s]+(?:\[|=)(\d+\.\d+\.\d+\.\d+)[\S\s]+ connected';
$OK_pat = $PID_pat . '[\S\s]+name=[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}[\S\s]+(?op|imap) \- user [A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4} authenticated, mechanism=[A-Za-z]+';
Reply With Quote
  #10 (permalink)  
Old 10-31-2009, 07:59 PM
Member
 
Posts: 12
Default

Does the above pattern matching applicable for zimbra 6?
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0