In this tutorial we’ll install the Debian Linux 9 (squeeze), Apache 2 with mpm-itk (to run each web as a isolated user),...
Installing Dovecot IMAP and POP daemon with MySql backend
Ástþór IPDovecot is an open source IMAP and POP3 server for Linux/UNIX-like systems, written primarily with security in mind. Dovecot primarily aims to be a lightweight, fast and easy to set up open source mailserver.
It’s assumed that you have already installed and configured Postfix according to this tutorial:
Installing Postfix with MySql backend and SASL for SMTP authentication
1. Install required packages
apt-get install dovecot-imapd dovecot-pop3d
2. Configure Dovecot (pico /etc/dovecot/dovecot.conf)
protocols = imap imaps pop3 pop3s
ssl_disable = no
mail_location = maildir:/home/vmail/%d/%n
auth default {
passdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
userdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
}
disable_plaintext_auth = no
user = vmail
Add or edit the above properties and leave everything else with the default value or configure according to your needs
3. Configure the MySql connector (pico /etc/dovecot/dovecot-sql.conf)
driver = mysql
connect = host=127.0.0.1 dbname={database} user={username} password={password}
default_pass_scheme = CRYPT
password_query = SELECT email as user, password FROM users WHERE email = '%u'
user_query = SELECT CONCAT('/home/vmail/',SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') as home, '5000' as uid, '5000' as gid FROM users WHERE email = '%u'
{database} = MySql database name
{username} = MySql username
{password} = MySql password
4. Restart Dovecot daemon
/etc/init.d/dovecot restart
-
Hi,
i glued together 3 of the articles on this site, in order to create a mailsystem with postfix, dovecot(imaps), sasl (cyrus), dspam and clamav.
i ‘seems’ everything is working, except that any mail sent TO this server will consistently gets bounced with error code 550 550 5.1.1
Recipient address rejected: User unknown in virtual alias table (state 14).i already tried creating a /etc/postfix/virtual table and add the hash to virtual_alias_maps, but that’s not the solution…
any idea where i should look?btw, great howto’s, especially if this problem turns out to be my own stupid fault.;)
-
small additional question;
the virtual domains mappings file from this page:
http://www.debiantutorials.net/installing-postfix-with-mysql-backend-and-sasl-for-smtp-authentication/… defines “select_field = ‘virtual'” , while the table-definition only defines 1 table ‘domain’.
is that an error? or does this work because “right-hand content does not matter” virtual(5)?
-
…and a final word 🙂
on the internet you can find quite a numer of tuts/howto’s about setting-up a maileserver of some sort using any number and combination of an array of tools that need to be glued togerher. this glueing can become quite complex and require some serious concentration, reading etc.
I just finished a mailsetup using 3 artikels from this site plus a dozen others for several detaills. This roughly took me a day or so to finish.
But it took another 3 days before it was working properly, because all the time i was overlooking something very crucial, but super-obvious…
And not even 1 of all these sites/blogs that i used as a guide makes any mention of it. It is asumed taken care of and it’s another-/offtopic etc..
so to spare others the kind of the frustration i experienced last few days:
if you find your setup is not acting as it should, and although still learing, you think your config is right.. also make sure to CHECK YOUR DNS RECORDSone of mine was changed without me knowing it.. i guess in my sub-consious just asumed they were alright.. simply never thought to double-check those
thanks for the article, and your support,
gvr
a