Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've followed this guide on setting up a mail server on my dedicated server. I've been able to send mails from the php application I'm using and the linux commandline (using telnet, php, etc).

The problem is that I cannot connect to the server via IMAP/POP which I've setup using Courier. I've tried using thunderbird but it complains that the username or password is wrong. I doubt it is the username/password but I don't know how to trouble shoot this.

Edit: Here's the messages in mail.log:

Jan  9 22:43:38 mail authdaemond: received auth request, service=imap, authtype=login
Jan  9 22:43:38 mail authdaemond: authmysql: trying this module
Jan  9 22:43:38 mail authdaemond: SQL query: SELECT id, crypt, "", uid, gid, home, "", "", name, "" FROM users WHERE id = 'peter@example.com'  AND (enabled=1)
Jan  9 22:43:38 mail authdaemond: password matches successfully
Jan  9 22:43:38 mail authdaemond: authmysql: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/var/spool/mail/virtual, address=peter@example.com, fullname=peter, maildir=<null>, quota=<null>, options=<null>
Jan  9 22:43:38 mail authdaemond: authmysql: clearpasswd=<null>, passwd=password
Jan  9 22:43:38 mail authdaemond: Authenticated: sysusername=<null>, sysuserid=5000, sysgroupid=5000, homedir=/var/spool/mail/virtual, address=peter@example.com, fullname=peter, maildir=<null>, quota=<null>, options=<null>
Jan  9 22:43:38 mail authdaemond: Authenticated: clearpasswd=peter, passwd=password
Jan  9 22:43:38 mail imapd: chdir Maildir: No such file or directory
share|improve this question
3  
That is not a postfix related question, as postfix doesn´t provide IMAP/POP. Try looking at your server side logs, courrier should say something about your login attempts. –  Flow Jan 9 '10 at 18:26
    
As above - you need to check your server logs and find out why your system is failing the login attempt. Until you do this you'll just be guessing in the dark. –  Coops Jan 9 '10 at 20:00
    
seems like your postfix config and courier config don't use the same storage format or storage path, which explains why courier can't chdir in the Maildir folder. –  aif Dec 25 '13 at 12:28

1 Answer 1

i'm using dovecot as i found it easier to configure and it does all i need (imap/pop).

tail -f /var/log/mail.log

and try connecting with imap/pop see if you get anything in the log.

also:

netstat -pntl

and see if you have courier listening on all interfaces (0.0.0.0) rather than local (127.0.0.1). You should have something like:

tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN     4845/dovecot        
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN     4845/dovecot        

If it is listening on 127.0.0.1 you need to change the configuration.

Also check this http://blog.edseek.com/~jasonb/articles/exim4_courier/courierimap.html there's a troubleshooting/testing section.

share|improve this answer
    
The error i keep getting in mail.log and when telneting to 127.0.0.1 is: Maildir: No such file or directory. I'm using a virtual user/domain setup and I've created the dir. /var/spool/mail/virtual where I have a sub-dir for each user, e.g. admin. If i list the contents of the admin/ i get these dirs: cur new tmp, which should mean that the mail dir is set up, right? –  MelkerOVan Jan 9 '10 at 18:39
    
that's postfix's directories. imap (courier in you case) needs to know where to find the mail. that configured in /etc/courier/authdaemonrc. Check that config file and see if it's pointing to /var spool rather than default /home/<user>/Maildir I'm looking at the guide you said you've followed and it looks like courier is told to use authmysql file with this setting: MYSQL_MAILDIR_FIELD concat(home,'/',maildir) that'd be ok for local users, but postfix is told to store stuff for virtual users in /var/spool. repoint that to /var/spool and you should be ok –  rytis Jan 9 '10 at 20:27
    
right, 'home' seems to be correctly set in the database, but maildir is 'blah/' that's clearly not right. so no need to change courier's config, check that user's maildir is correct in mysql db –  rytis Jan 9 '10 at 20:32
    
yes, the 'home' table is set to '/var/spool/mail/virtual' for all user and the 'maildir' column is set to lisa/, peter/, etc. What should this be corrected to? –  MelkerOVan Jan 9 '10 at 21:00
    
ok, then try upping debug level in courier and see if it gives more details about the missing dir. things to check: are the permissions right (ie can courier process read the directory?) –  rytis Jan 10 '10 at 8:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.