Can’t view email in INBOX throught squirrelmail, only in /var/mail/user

dovecotpostfix

I have installed postfix+dovecot+squirrelmail+sasl in Debian Squeeze. I can send email through squirrelmail, but can't receive mails there. I can view received mails only through cat /var/mail/user. Also it created /var/mail/u/user dirs where ls list inbox INBOX INBOX.Drafts INBOX.Sent (where the sent messages are stored in squirrelmail) INBOX.Trash, so I think that I should redirect the inbox from /var/mail/user to /var/mail/u/user/inbox. The section in dovecot is:

mail_location = mbox:/var/mail
mail_location = Maildir:/var/mail/%n
mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n

I am not sure is it correct and where really is the problem.

Best Answer

Edit the file main.cf of Postfix and look for the setting home_mailbox and modify it to

home_mailbox=Maildir/

If you cannot find that line add it to the config. Then modify dovecot's config to use

mail_location=maildir:/var/mail/%u/Maildir

Comment out the other three. Postfix is then configured to drop one file for each email in /var/mail/username/Maildir/new. Restart postfix and dovecot afterwards. That should fix the issue with squirrelmail.

This setup is only suited for receiving and storing email for one domain. If you want to be able to effectively use and configure a the server as a mail-server for different domains, I'd recommend reading up on what you need, to set that up, how to set it up and how the different parts (dovecot for IMAP/POP3, postfix, squirrelmail) are configured.