Nick Karnik
Nick Karnik
Author

Computer Scientist | Hacker | Entrepreneur | Ex-Microsoft | YC

Share


Twitter


Dovecot IMAP Authorization Slow

My dovecot is setup to authenticate users from MySQL. However, the process was taking about 4 seconds and I kept wondering what the issue was for a while. Final…

Nick KarnikNick Karnik

My dovecot is setup to authenticate users from MySQL. However, the process was taking about 4 seconds and I kept wondering what the issue was for a while. Finally, I took some time to dig into it and here is what I discovered:

PAM was enabled, which is something I am not using. At the same time the PAM file in /etc/pam.d/dovecot contained the following:

#%PAM-1.0  
auth required pam_nologin.so  
auth include system-auth  
account include system-auth  
session include system-auth

To fix this, go to the dovecot configuration file (generally under /etc/dovecot.conf) and comment out the following section

passdb pam {  
 … generally comments  
}

Once you have commented the start and end of that section, restart dovecot

service dovecot restart

Try to connect to the IMAP server and login – It will be LIGHTNING FAST!!