On Fri, November 9, 2012 12:13 am, Odhiambo Washington wrote:
On Thu, Nov 8, 2012 at 11:36 AM, Patrick Shirkey
wrote:
On Thu, November 8, 2012 7:21 pm, Robert Schetterer wrote:
Am 08.11.2012 08:48, schrieb Patrick Shirkey:
Hi,
I have an exim4 and dovecot system. The system has multiple accounts. Exim4 is receiving emails in the /var/mail/user files and dovecot is configured to use /home/user/mail (mbox) folder.
I have one account that dovecot is not processing replies/bounces/etc... The data is being written in the /var/mail/user file by exim4 but as far as dovecot is aware there is nothing in the pop3 inbox.
Can anyone suggest how I can enable dovecot to know that the data is in the /var/mail/user file and deliver it to the pop3 inbox for this account?
-- Patrick Shirkey Boost Hardware Ltd
show logs and config like doveconf -n
There is nothing in the dovecot logs afaict
echo "my test" | mail -s "test message" test@xxx
2012-11-08 08:34:38 1TWNZO-0000TG-8s <= root@xxx U=root P=local S=398 2012-11-08 08:34:38 1TWNZO-0000TG-8s => xxx test@xxx R=local_user T=mail_spool 2012-11-08 08:34:38 1TWNZO-0000TG-8s Completed
exim -bt test@xxx R: system_aliases for xxx@localhost R: userforward for xxx@localhost R: procmail for xxx@localhost R: maildrop for xxx@localhost R: lowuid_aliases for xxx@localhost (UID 1238) R: local_user for xxx@localhost xxx@localhost <-- test@xxx router = local_user, transport = mail_spool
- Here's the dovecot config:
dovecot -n
# 1.2.15: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.6 log_timestamp: %Y-%m-%d %H:%M:%S protocols: pop3 pop3s listen: 127.0.0.1 login_dir: /var/run/dovecot/login login_executable: /usr/lib/dovecot/pop3-login mail_privileged_group: mail mail_location: mbox:~/mail mail_debug: yes mbox_write_locks: fcntl dotlock mail_executable: /usr/lib/dovecot/pop3 mail_plugin_dir: /usr/lib/dovecot/modules/pop3 auth default: debug: yes passdb: driver: pam userdb: driver: passwd
You are telling dovecot that mails are in mbox format (why you even use mbox instead of Maildir++ beats me, but that's not what you asked for help with) and are stored in /home/$user/mbox so go ahead at also tell Exim to deliver to the same location! If you want Exim to deliver to /var/mail/$user then change your mail_location in dovecot.conf to point to this too.
Thanks for your advice. I inherited this system and it is a live B2B system so I am trying not to break it as well as to keep it running :-)
I have seen some unusual behaviour now.
1: According to my script to process the inbox for each account the pop3 account was empty. The code was previously working for many months. I thought it might be related to the missing mail_location directive because the home/xxx/mail folder was missing for the specific account that was having a problem so I added it as above but it didn't appear to fix the problem.
2: I modified it as suggested : mail_location = INBOX=/var/mail/%u
That gave me an error
Nov 8 13:47:03 mail dovecot: POP3(xxx): mail_location: Ambiguous mail location setting, don't know what to do with it: INBOX=/var/mail/xxx (try prefixing it with mbox: or maildir:) Nov 8 13:47:03 mail dovecot: POP3(xxx): Fatal: Namespace initialization failed
3: I then disabled the directive and restarted dovecot. The processing script now appears to be working but I see this message in the maillog:
Nov 8 13:48:00 mail dovecot: POP3(xxx): fchown(/home/xxx/mail/.imap/INBOX/dovecot.index.tmp, -1, 8(mail)) failed: Operation not permitted (egid=1238(xxx), group based on /var/mail/xxx) Nov 8 13:48:00 mail dovecot: POP3(xxx): fchown(/home/xxx/mail/.imap/INBOX/dovecot.index.log.newlock, -1, 8(mail)) failed: Operation not permitted (egid=1238(xxx), group based on /var/mail/xxx) Nov 8 13:48:00 mail dovecot: POP3(xxx): fchown(/home/xxx/mail/.imap/INBOX/dovecot.index.cache.lock, -1, 8(mail)) failed: Operation not permitted (egid=1238(xxx), group based on /var/mail/xxx)
So it looks like setting the mail_location to the /home/user did actually help but only after the mbox was auto created by dovecot and then the directive disabled and dovecot restarted.
Based on this it appears that this system is configured to use both the /var/mail/user and /home/user/mail folders. I suppose it is a useful backup to have exim4 write to /var/mail/user and have dovecot transfer the data to /home/user/mail as it is received?
Everything was working for many months so I'm not sure why the /home/user/mail folder was not auto created for this new account. AFAICT it is supposed to be handled by dovecot when a mail is received and the default location is /home/user/mail so setting it in dovecot.conf is not explicitly required?
-- Patrick Shirkey Boost Hardware Ltd