Torpey List
2012-Dec-31 23:37 UTC
[Dovecot] From Sendmail to Dovecot mdbox, what is missing.
Sendmail 8.14.4 dovecot 2.0.9 I have sendmail working and it is sending mail to /var/mail/%u. I have dovecot working in that I can move emails into IMAP folders and I can send email through IMAP. I have set up dovecot to use mdbox based on the following: mail_location = mdbox:~/mail However, I seem to be lacking a key piece of information. Sendmail is sending the mail to /var/mail/%u as a mbox (single file for all emails) format. Dovecot wants to read the mail in mdbox (Multiple messages per file, but unlike mbox multiple files per mailbox.) So the two programs are not working together. So, I cannot get dovecot to read new emails at /var/mail/%u. So I tried changing to the following: mail_location = mdbox:~/mail:INBOX=/var/mail/%u However, dovecot complains that it is NOT a directory. That is because sendmail is sending as mbox format. I have tried two lines of ?mail_location? but that did not work. example mail_location = mdbox:~/mail ----> for dovecot mail_location = mbox:INBOX=/var/mail/%u -----> for sendmail I have tried LMTP and dovecot-lda. LMTP ? I could not see any difference with this added or not. Dovecot-lda ? I have had issues getting it configured. Thanks for any help! Sendmail changes FEATURE(`local_procmail', `/usr/libexec/dovecot/dovecot-lda',`/usr/libexec/dovecot/dovecot-lda -d $u') MODIFY_MAILER_FLAGS(`LOCAL', `-f') MAILER(procmail)dnl Here is dovecot configuration [root at nala mail]# dovecot -n # 2.0.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-279.14.1.el6.x86_64 x86_64 Scientific Linux release 6.3 (Carbon) auth_mechanisms = plain login mail_gid = mail mail_location = mdbox:~/mail mail_uid = mail mbox_write_locks = fcntl passdb { driver = pam } plugin { mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename mail_log_group_events = yes } service auth { unix_listener auth-userdb { mode = 0600 user = mail } } service lmtp { inet_listener lmtp { address = 192.168.1.185 127.0.0.1 ::1 port = 24 } user = mail } ssl_cert = </etc/pki/dovecot/certs/dovecot.pem ssl_key = </etc/pki/dovecot/private/dovecot.pem userdb { driver = passwd } protocol lda { info_log_path = /var/log/maillog log_path = /var/log/maillog postmaster_address = postmaster at torpey.org }
Ben Morrow
2013-Jan-01 02:52 UTC
[Dovecot] From Sendmail to Dovecot mdbox, what is missing.
At 5PM -0600 on 31/12/12 you (Torpey List) wrote:> Sendmail 8.14.4 > dovecot 2.0.9 > > I have sendmail working and it is sending mail to /var/mail/%u. > I have dovecot working in that I can move emails into IMAP folders and > I can send email through IMAP. I have set up dovecot to use mdbox > based on the following: > mail_location = mdbox:~/mail > > However, I seem to be lacking a key piece of information. > Sendmail is sending the mail to /var/mail/%u as a mbox (single file > for all emails) format. > Dovecot wants to read the mail in mdbox (Multiple messages per file, > but unlike mbox multiple files per mailbox.) So the two programs are > not working together. > > So, I cannot get dovecot to read new emails at /var/mail/%u. > So I tried changing to the following: > mail_location = mdbox:~/mail:INBOX=/var/mail/%u > However, dovecot complains that it is NOT a directory. That is > because sendmail is sending as mbox format. > > I have tried two lines of ?mail_location? but that did not work. > example > mail_location = mdbox:~/mail ----> for dovecot > mail_location = mbox:INBOX=/var/mail/%u -----> for sendmailNo, that doesn't work: in fact, the second line will completely override the first. If you run 'doveconf -n' or 'doveconf mail_location' you will see that the first line doesn't have any effect. If you want to keep INBOX delivery to mboxes in /var/mail, you can do this using two namespaces. One points to mdbox:~/mail, and holds the users' ordinary IMAP folders in mdbox format, and the other has INBOX=/var/mail/%u and just holds the INBOX. There is an example in http://wiki2.dovecot.org/Namespaces of doing this with Maildir and mbox; adjusting it for mdbox shouldn't be hard. You will find you need a directory for each user to hold the other folders in the INBOX namespace, since Dovecot doesn't know there won't ever be any. This directory is also used to store Dovecot's index files for that namespace, and it should *not* be the same as the mdbox directory. According to http://wiki2.dovecot.org/MailLocation/mbox , you can skip this if you use location = mbox:/var/empty:INBOX=/var/mail/%u:INDEX=MEMORY (assuming /var/empty is a readonly root-owned empty directory), but since this tells Dovecot not to store index files on disk it may make INBOX access less efficient. If you use a real directory rather than /var/empty you may want to consider enabling the acl plugin and setting up a global ACL which prevents users from creating additional folders in the INBOX namespace. It's probably also a good idea to set mail_location = mdbox:~/mail and omit the location parameter from the mdbox namespace, since IIRC otherwise commands like 'doveadm purge' won't work correctly.> I have tried LMTP and dovecot-lda.If you want to deliver mail into the mdbox INBOX, and forget about /var/mail altogether, you will need to get one of these two working since Sendmail doesn't understand mdbox. This is probably the best option in the long run, unless you have other software which relies on mail being in /var/mail. If you pick this option you need to remove all references to /var/mail from dovecot.conf; with the two lines you had above Dovecot will simply carry on delivering into /var/mail just as Sendmail had been.> LMTP ? I could not see any difference with this added or not.If you had configured Dovecot to deliver into /var/mail, that's hardly surprising. Otherwise, are you sure you were delivering mail to the LMTP server? If you were you should have seen entries in Dovecot's log file, and the delivered mail should have ended up with a Received header from the LMTP server.> Dovecot-lda ? I have had issues getting it configured.What issues? If you were trying to get the LDA to deliver to /var/mail, it's possible you were running into permissions problems. The best solution is to deliver into the mdbox instead, or just leave Sendmail to deliver to /var/mail.> Sendmail changes > FEATURE(`local_procmail', > `/usr/libexec/dovecot/dovecot-lda',`/usr/libexec/dovecot/dovecot-lda > -d $u') > MODIFY_MAILER_FLAGS(`LOCAL', `-f') > MAILER(procmail)dnlI know nothing at all about Sendmail configuration, but going by the Dovecot wiki that looks correct. Are you sure mail for the appropriate users was actually getting routed through that mailer? What did you see in the logs (you need to check both Dovecot's and Sendmail's logs, wherever they may be). Ben