Drupal + Postfix Integration Under Ubuntu 8.04 (Hardy) - Page 6
Deliver Incoming Mails Through the Dovecot LDA
To make Postfix use Dovecot you need to append one line to /etc/postfix/master.cf:
vim /etc/postfix/master.cf
dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}
Reload Postfix:
/etc/init.d/postfix reload
Now make Postfix deliver mails through this service:
postconf -e virtual_transport=dovecot
postconf -e dovecot_destination_recipient_limit=1
Configure Dovecot
Dovecot supports PO3, POP3S, IMAP and IMAPS. To enable all these services modify /etc/dovecot/dovecot.conf to match the following settings:
vim /etc/dovecot/dovecot.conf
protocols = imap imaps pop3 pop3s mail_location = maildir:/home/vmail/%d/%n/Maildir auth default { mechanisms = plain login passdb sql { args = /etc/dovecot/dovecot-sql.conf } userdb static { args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes } socket listen { master { path = /var/run/dovecot/auth-master mode = 0600 user = vmail } client { path = /var/spool/postfix/private/auth mode = 0600 user = postfix group = postfix } } } protocol lda { log_path = /home/vmail/dovecot-deliver.log global_script_path = /home/vmail/globalsieverc postmaster_address = [email protected] auth_socket_path = /var/run/dovecot/auth-master mail_plugins = cmusieve }
Edit /etc/dovecot/dovecot-sql.conf and make sure the following directives are set:
vim /etc/dovecot/dovecot-sql.conf
driver = mysql connect = host=127.0.0.1 dbname=drupal_example_com user=drupal_example_com password=opensesame default_pass_scheme = PLAIN-MD5 password_query = SELECT mail AS user, pass AS password FROM users WHERE mail='%u';
Then you must restart Dovecot:
/etc/init.d/dovecot restart
That’s it! Now Drupal and Postfix share the same authentication repository.
References
- Falko Timme, © 2008, Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.04 LTS), https://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu8.04
- Christoph Haas, © 2007, Howto: ISP-style Email Server with Debian-Etch and Postfix, http://workaround.org/articles/ispmail-etch/
- Matt Butcher, Learning Drupal 6 Module Development, ISBN 190-4811-80-9, © 2008 Packt Publishing
- Thomas Barregren, Mailserver Drupal Module, http://drupal.org/project/mailserver
- Alex Saavedra, © 2008, Mailfix Drupal Module, http://drupal.org/project/mailfix