Email with Postfix, Dovecot and MySQL on Debian 7

Looking for info on getting this all working on Debian 7:

https://library.linode.com/email/postfi … -6-squeeze">https://library.linode.com/email/postfix/dovecot-mysql-debian-6-squeeze

The tutorial appears to be for an old version of PostFix and Dovecot.

When I run service postfix restart, I get:

[....] Stopping Postfix Mail Transport Agent: postfix/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
. ok
[....] Starting Postfix Mail Transport Agent: postfixpostconf: warning: /etc/postfix/main.cf: unused parameter:                                                                                                                              virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
. ok

For dovecot, one step was to copy the slq conf, this file doesn't exist, but there are a few files in this directory with .ext extension.

cp -a /etc/dovecot/dovecot-sql.conf /etc/dovecot/dovecot-sql.conf.bak

I put the dovecot-sql.conf tutorial code in the dovecot-sql.conf.ext file.

Finally, was mentioned to service dovecot restart, the n I see all this:

doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -n > dovecot-new.conf
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:1: 'imaps' protocol is no longer necessary, rem                                                                                                                             ove it
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:1: 'pop3s' protocol is no longer necessary, rem                                                                                                                             ove it
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:5: ssl_cert_file has been replaced by ssl_cert                                                                                                                              = <file doveconf:="" warning:="" obsolete="" setting="" in="" etc="" dovecot="" dovecot.conf:6:="" ssl_key_file="" has="" been="" replaced="" by="" ssl_key="<file" dovecot.conf:8:="" namespace="" private="" {}="" na="" mespace="" {="" type="private" }="" fatal:="" error="" configuration="" file="" dovecot.conf="" line="" 19:="" unknown="" setting:="" global_script_p="" ath="" [....]="" restarting="" imap="" pop3="" mail="" server:="" dovecotdoveconf:="" note:="" you="" can="" get="" a="" new="" clean="" config="" wit="" h:="" doveconf="" -n="">dovecot-new.conf
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:1: 'imaps' protocol is no longer necessary, rem                                                                                                                             ove it
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:1: 'pop3s' protocol is no longer necessary, rem                                                                                                                             ove it
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:5: ssl_cert_file has been replaced by ssl_cert                                                                                                                              =</file> 

Lots of old parameters, the conf file does in fact exist and so do the ssl, but postfix instructions on that tutorial had them created in a different place than dovecot is looking.

It appears to be a big mess. Should I uninstall postfix, dovecot, delete the mail mysql DB and start over from different tutorial?

6 Replies

Debian provides no software updates between releases (unless you count security fixes), meaning that anything in Squeeze is probably ancient compared to stuff provided by Wheezy. I know from trying the guide myself that a lot of stuff seems to have changed in Dovecot since whatever version is provided by Suqeeze.

Try following this tutorial instead. It's basically the same guide, except using the newer versions of Postfix and Dovecot.

This link tells how to add additional accounts towards bottom, but how do I remove an email account and it's files? I made a test account and now want to g et rid of it…then add real email accounts.

Log in to your MySQL database as described in the article (mysql -u root -p mailserver), then use the following MySQL commands (remember to include the ; at the end):

SELECT * FROM virtual_users;
DELETE FROM virtual_users WHERE id=#;
quit;

The SELECT command will show a list of curent email addresses. This should include the id number of each address. Find the one you want, and us e it's id number in the DELETE to replace the #.

As for deleting the files for each address, look under /var/mail/vhosts/ . You'll see a directory there for each domain you have configured. Under each of those, you'll see a directory for each email address under that domain. For example, if you're deleting test@mydomain.com, you would see a /var/mail/vhosts/mydomain.com/test/ , and you'd remove it by doing:

rm -rf /var/mail/vhosts/mydomain.com/test/

Thanks, thats kinda what I was thinking, just wanted to make sure all to do was delete in db and files. Simple enough.

It is possible to write a guide for Debian 7 and Ubuntu 12.04, as is done for Debian 6 and Ubuntu 10.04?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct