Adding VMAIL users and MySQL files.
Let's create VMail, which will be responsible for the delivery:
# useradd vmail -r -u 150 -g mail -d /var/vmail -s /sbin/nologin
Now we will create the directory in which VMail will store the data:
# mkdir /var/vmail
# chmod 770 /var/vmail/
# chown vmail:mail /var/vmail/
To create the MySQL configuration files that Postfix can "communicate" with it, follow these steps:
# cd /etc/postfix
# joe mysql_virtual_alias_maps.cf
user = mail
password = mail
hosts = localhost
dbname = mail
table = alias
select_field = goto
where_field = address
additional_conditions = and active = '1'
#query = SELECT goto FROM alias WHERE address='%s' AND active = '1'
# joe mysql_virtual_domains_maps.cf
user = mail
password = mail
hosts = localhost
dbname = mail
table = domain
select_field = domain
where_field = domain
additional_conditions = and backupmx = '0' and active = '1'
#query = SELECT domain FROM domain WHERE domain='%s' AND backupmx = '0' AND active = '1'
joe mysql_virtual_mailbox_limit_maps.cf
user = mail
password = mail
hosts = localhost
dbname = mail
table = mailbox
select_field = quota
where_field = username
additional_conditions = and active = '1'
#query = SELECT quota FROM mailbox WHERE username='%s' AND active = '1'
joe mysql_virtual_mailbox_maps.cf
user = mail
password = mail
hosts = localhost
dbname = mail
table = mailbox
select_field = CONCAT(domain,'/',maildir)
where_field = username
additional_conditions = and active = '1'
#query = SELECT CONCAT(domain,'/',maildir) FROM mailbox WHERE username='%s' AND active = '1'
Edit /etc/postfix/master.cf and add the following
## DOVECOT ##
dovecot unix - n n - - pipe
flags=DRhu user=vmail:mail argv=/usr/libexec/dovecot/deliver -d $(recipient)
Last Updated (Saturday, 08 January 2011 03:56)




Comments
Great tutorial
Can you tell me, how to add quota for user.
Thank you
Anu
in Postfix master.cf file, there MUST BE a white character preceding line "flags=DRhu user=vmail:mail (...). Otherwise Posftix will die on startup.
These two lines must look EXACTLY like that:
dovecot unix - n n - - pipe
flags=DRhu user=vmail:mail argv=/usr/libexec/dovecot/deliver -d $(recipient)
And there is a small mistake on page 4 in the first "mv" command. It should look like that:
mv postfixadmin-2.3.2 postfixadmin
Thank you for great tutorial! You did great job!
One more thing worth to note: in postifx master.cf file the line "flags=DRhu user=vmail:mail..." MUST BE PRECEDED WITH WHITE CHARACTER. Otherwise fetchmail will die on startup.
It needs to look eactly like this:
dovecot unix - n n - - pipe
flags=DRhu user=vmail:mail argv=/usr/libexec/dovecot/deliver -d $(recipient)
And there is a small mistake on page 4, in first "mv" command:
WRONG: #mv postfixadmin-2.3.2.tar.gz postfixadmin
GOOD: # mv postfixadmin-2.3.2 postfixadmin
Thank you once again for great tutorial!
NOTE on comment #3: when you copy&paste into config files, look out for new line characters in copied lines. Remove new line characters in mysql queries in dovecot-sql.conf
[root@centos55 etc]# service dovecot start
Starting Dovecot Imap: [ OK ]
[root@centos55 etc]# service dovecot status
dovecot dead but subsys locked.
Result in /var/log/maillog. I can't find anything about this by Google searching. Have been beating my head on it for days. Any guidance with this would be awsome.
Oct 10 12:57:10 centos55 dovecot: Dovecot v1.0.7 starting up
Oct 10 12:57:10 centos55 dovecot: Auth process died too early - shutting down
Oct 10 12:57:10 centos55 dovecot: auth(default): Error in configuration file /etc/dovecot-sql.conf line 9: Unknown setting: concat('dirsize:storage
Oct 10 12:57:10 centos55 dovecot: child 25999 (auth) returned error 89
/etc/dovecot-sql.conf
i got the output error as show below:
Jul 22 11:01:29 isptestmail dovecot: auth-worker(default) : plain_md5_verif y(extranho@ispt estmail.tl): Invalid password encoding
Jul 22 11:01:29 isptestmail dovecot: imap-login: Aborted login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
what should I do now? i have change default_pass_sc heme to PLAIN, MD5 , but still got the same error...
thx before..
I am just wondering how do I create bulk email (about 100) at once? Is there any script to make this automated?
Thank you!
Jen
RSS feed for comments to this post.