Take the 2-minute tour ×

A couple of weeks ago, I configured my webserver to be able to send emails (e.g. registration emails for my website etc.) I used exim4 in Debian, which worked flawlessly. Now, the need has arisen to be able to receive emails, too (e.g. contact@mywebsite.com).

So, I removed exim, and followed this guide (http://johnny.chadda.se/article/mail-server-howto-postfix-and-dovecot-with-mysql-and-tlsssl-postgrey-and-dspam/) to install Postfix, Dovcot and RoundCube to be able to view my mails properly. I think everything went fine, but I have absolutely no idea how to test my new configuration.

When I try to log in using Roundcube, it keeps saying that the login failed (it can connect to the IMAP server, though). Where do I create IMAP accounts? Is there a default one? Also, I used the mail command:

echo 'body' | mail -s 'subject' to@company.com

In exim4 to send an email using PHP, which does not work anymore either. Any suggestions? Or something to get my on track again?

Greatly appreciated

share|improve this question
Sounds like a problem that could use a look at /var/log/mail/ –  LtWorf Feb 9 '13 at 20:46

2 Answers 2

up vote 0 down vote accepted

I've looked at that tutorial and they're describing a virtual mailbox setup utilizing MySQL. So, your "accounts" are stored in a MySQL database. If you want to adjust those accounts or create new ones, you'll have to manipulate that database.

To make this easier, there's PostfixAdmin. PostfixAdmin will manage your MySQL database so that you can manage your accounts through a simple web interface. I highly recommend using it.

If RoundCube login keeps failing, enable authentication debugging in Dovecot by setting the configuration parameter auth_debug=yes. Please also review the Dovecot documentation regarding this topic: http://wiki2.dovecot.org/Debugging/Authentication

That being said, you don't need Postfix and/or Dovecot to send email. PHP can just utilize sendmail or some other simple email tool. You only need to be able to connect to the target SMTP server to send someone an email.

share|improve this answer
If you directly connect to someone's SMTP server, chances are all your emails go to spam. –  LtWorf Feb 9 '13 at 20:45

So, it took a while to figure it all out, but at last I succeeded.

First of all, copying the configuration and pasting it in the configuration files messed up some quotes in the Postfix MySQL configuration files, preventing Postfix to properly connect to the database.

Secondly, Dovecot 2.x is not (yet) available for Debian, the operating system I use. I installed dovecot with the commands: apt-get install dovecot-imapd dovecot-mysql, and the second one caused the problems which prevented me from connection through RoundCube. Only dovecot-imapd is needed, so just don't install the mysql one (not sure what it's for anyway). Dovecot should use MD5-CRYPT and not MD5, too (Dovecot MySQL config file).

Lastly, the command tail -f /var/log/syslog proved to be really useful to be able to see what's going on, and, more importantly what's wrong.

I hope I can spare someone else the hassle with these notes

share|improve this answer

Your Answer


