[Dovecot] dovecot is confused about mail_location
IMAP logins via fetchmail are failing on my mailserver
root@grelber:/home/esr# tail -f /var/log/mail.err Nov 24 16:56:48 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 16:56:48 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 16:57:39 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 16:57:39 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 16:57:52 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 16:57:52 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 17:05:15 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 17:05:15 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 17:09:41 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 17:09:41 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed
However:
root@grelber:/home/esr# dovecot -n # 1.2.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-24-generic x86_64 Ubuntu 10.04.1 LTS log_timestamp: %Y-%m-%d %H:%M:%S login_dir: /var/run/dovecot/login login_executable: /usr/lib/dovecot/imap-login mail_privileged_group: mail mail_location: mbox:~/mail:/var/mail/%u mbox_write_locks: fcntl dotlock auth default: passdb: driver: pam userdb: driver: passwd
And cathy is a real user:
root@grelber:/home/esr# grep cathy /etc/passwd cathy:x:1001:1001:Cathy Raymond,,,:/home/cathy:/bin/bash oot@grelber:/home/esr# ls -l /var/mail/cathy -rw------- 1 cathy mail 14296599 2010-11-24 17:30 /var/mail/cathy
Dovecot appears confused about whether or not mail_location is set.
Just to make matters more perplexing, when *I* fetch from IMAP - using a fetchmail configuration identical except for username - it works.
This is driving me nuts. Help?
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
"Taking my gun away because I might shoot someone is like cutting my tongue out because I might yell `Fire!' in a crowded theater." -- Peter Venetoklis
Noel Butler noel.butler@ausics.net:
You have omitted the INBOX keyword, change it to ...
mbox:~/mail:INBOX=/var/mail/%u
Doesn't fix the problem. New results:
oot@grelber:/home/esr# tail /var/log/mail.err Nov 24 18:35:07 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:35:07 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed root@grelber:/home/esr# ssh cathy@minx cathy@minx's password:
cathy@minx:~$ fetchmail -d0 -a -v fetchmail: 6.3.9-rc2 querying grelber.thyrsus.com (protocol IMAP) at Wed 24 Nov 2010 06:41:24 PM EST: poll started Trying to connect to 192.168.1.31/143...connected. fetchmail: IMAP< * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS LOGINDISABLED] Dovecot ready. fetchmail: IMAP> A0001 CAPABILITY fetchmail: IMAP< * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH STARTTLS LOGINDISABLED fetchmail: IMAP< A0001 OK Capability completed. fetchmail: IMAP> A0002 STARTTLS fetchmail: IMAP< A0002 OK Begin TLS negotiation now. fetchmail: Issuer Organization: Dovecot mail server fetchmail: Issuer CommonName: hurkle fetchmail: Server CommonName: hurkle fetchmail: Server CommonName mismatch: hurkle != grelber.thyrsus.com fetchmail: grelber.thyrsus.com key fingerprint: 60:C9:15:A3:30:8D:7B:42:10:CF:94:2D:CC:20:BC:14 fetchmail: Server certificate verification error: self signed certificate fetchmail: IMAP> A0003 CAPABILITY fetchmail: IMAP< * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH AUTH=PLAIN fetchmail: IMAP< A0003 OK Capability completed. fetchmail: grelber.thyrsus.com: upgrade to TLS succeeded. fetchmail: IMAP> A0004 LOGIN "cathy" * fetchmail: IMAP> A0005 * fetchmail: Unknown login or authentication error on cathy@grelber.thyrsus.com fetchmail: socket error while fetching from cathy@grelber.thyrsus.com fetchmail: 6.3.9-rc2 querying grelber.thyrsus.com (protocol IMAP) at Wed 24 Nov 2010 06:41:24 PM EST: poll completed fetchmail: Query status=2 (SOCKET) fetchmail: normal termination, status 2 cathy@minx:~$ logout root@grelber:/home/esr# tail /var/log/mail.err Nov 24 18:39:19 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:39:19 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed root@grelber:/home/esr# dovecot -n # 1.2.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-24-generic x86_64 Ubuntu 10.04.1 LTS log_timestamp: %Y-%m-%d %H:%M:%S login_dir: /var/run/dovecot/login login_executable: /usr/lib/dovecot/imap-login mail_privileged_group: mail mail_location: mbox:~/mail:INBOX=/var/mail/%u mbox_write_locks: fcntl dotlock auth default: passdb: driver: pam userdb: driver: passwd
Some log lines have been trimmed for clarity. Note the timestamp on the second log; there's an identical failure with the variable set as you describe.
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
On Wed, 2010-11-24 at 18:47 -0500, Eric Raymond wrote:
Noel Butler noel.butler@ausics.net:
You have omitted the INBOX keyword, change it to ...
mbox:~/mail:INBOX=/var/mail/%u
Doesn't fix the problem. New results:
oot@grelber:/home/esr# tail /var/log/mail.err Nov 24 18:35:07 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:35:07 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed root@grelber:/home/esr# ssh cathy@minx cathy@minx's password:
c
Set mail_debug=yes
We dont need fetchmail stuff though, only dovecot logs
mail_location: mbox:~/mail:INBOX=/var/mail/%u Looks good
Noel Butler noel.butler@ausics.net:
Set mail_debug=yes
root@grelber:/etc# dovecot -n # 1.2.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-24-generic x86_64 Ubuntu 10.04.1 LTS log_timestamp: %Y-%m-%d %H:%M:%S login_dir: /var/run/dovecot/login login_executable: /usr/lib/dovecot/imap-login mail_privileged_group: mail mail_location: mbox:~/mail:INBOX=/var/mail/%u mail_debug: yes mbox_write_locks: fcntl dotlock auth default: passdb: driver: pam userdb: driver: passwd root@grelber:/etc# tail /var/log/mail.err Nov 24 17:09:41 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 17:09:41 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 18:34:40 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:34:40 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 18:34:54 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:34:54 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 18:35:07 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:35:07 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 18:39:19 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:39:19 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed root@grelber:/etc# # Running fetchmail, login fails... root@grelber:/etc# tail /var/log/mail.err Nov 24 18:34:40 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:34:40 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 18:34:54 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:34:54 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 18:35:07 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:35:07 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 18:39:19 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 18:39:19 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed Nov 24 19:46:35 grelber dovecot: IMAP(cathy): mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/cathy Nov 24 19:46:35 grelber dovecot: IMAP(cathy): Fatal: Namespace initialization failed
Does not seem to yield additional info. Is there somewhere else I should look.
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
On 24.11.2010, at 23.01, Eric Raymond wrote:
root@grelber:/home/esr# dovecot -n # 1.2.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-24-generic x86_64 Ubuntu 10.04.1 LTS
If you installed dovecot-postfix package, it actually uses a different config file (dovecot-postfix.conf or something).
On Thu, 2010-11-25 at 00:09 +0000, Timo Sirainen wrote:
On 24.11.2010, at 23.01, Eric Raymond wrote:
root@grelber:/home/esr# dovecot -n # 1.2.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-24-generic x86_64 Ubuntu 10.04.1 LTS
If you installed dovecot-postfix package, it actually uses a different config file (dovecot-postfix.conf or something).
*shakes head in disgust*
Timo Sirainen tss@iki.fi:
On 24.11.2010, at 23.01, Eric Raymond wrote:
root@grelber:/home/esr# dovecot -n # 1.2.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-24-generic x86_64 Ubuntu 10.04.1 LTS
If you installed dovecot-postfix package, it actually uses a different config file (dovecot-postfix.conf or something).
root@grelber:/etc# aptitude search dovecot
p dovecot-antispam - a Dovecot plugin that helps train spam fil
i A dovecot-common - secure mail server that supports mbox and
p dovecot-dbg - debug symbols for Dovecot
p dovecot-dev - header files for the dovecot mail server
i dovecot-imapd - secure IMAP server that supports mbox and
p dovecot-pop3d - secure POP3 server that supports mbox and
p dovecot-postfix - full mail server stack provided by Ubuntu
p dtc-postfix-dovecot - A meta package to setup a minimal DTC serv
p mysqmail-dovecot-logger - real-time logging system in MySQL - Doveco
Nope. In any case, if dovecot -n lies about the configuattion, that's a bug.
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
On 25.11.2010, at 0.53, Eric Raymond wrote:
If you installed dovecot-postfix package, it actually uses a different config file (dovecot-postfix.conf or something).
root@grelber:/etc# aptitude search dovecot .. Nope. In any case, if dovecot -n lies about the configuattion, that's a bug.
Newer versions (because of Ubuntu) have this warning when running dovecot -n:
Warning: Dovecot was last started using /etc/dovecot/dovecot-postfix.conf, but this config is /etc/dovecot.conf
It anyway looks to me like any changes done to dovecot.conf get ignored, so it most likely isn't reading the expected config file. If dovecot isn't using the default config file, it's been given -c parameter. Does ps show dovecot process with -c pointing to different config file?
Timo Sirainen tss@iki.fi:
It anyway looks to me like any changes done to dovecot.conf get ignored, so it most likely isn't reading the expected config file. If dovecot isn't using the default config file, it's been given -c parameter. Does ps show dovecot process with -c pointing to different config file?
No, but I found something relevant. I was operating under the mistaken assumption that dovecot was an inetd plugin, the way imap servers usually are. It isn't, which means dovecot.conf is not reread as often as I thought.
I need to redo my diagnostics with more dovecot restarts. Is there an incantation analogous to "postfix reload"?
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
On 25.11.2010, at 1.41, Eric Raymond wrote:
I need to redo my diagnostics with more dovecot restarts. Is there an incantation analogous to "postfix reload"?
v2.0 has "dovecot reload", but with v1.2 you need to send HUP signal to dovecot process. Maybe Ubuntu also has /etc/init.d/dovecot reload to do that, I don't know.
Timo Sirainen put forth on 11/24/2010 7:43 PM:
On 25.11.2010, at 1.41, Eric Raymond wrote:
I need to redo my diagnostics with more dovecot restarts. Is there an incantation analogous to "postfix reload"?
v2.0 has "dovecot reload", but with v1.2 you need to send HUP signal to dovecot process. Maybe Ubuntu also has /etc/init.d/dovecot reload to do that, I don't know.
The Debian Lenny script is probably similar to the Ubuntu LTS script:
Usage: /etc/init.d/dovecot {start|stop|restart|force-reload|status}
-- Stan
On Wed, 2010-11-24 at 20:41 -0500, Eric Raymond wrote:
No, but I found something relevant. I was operating under the mistaken assumption that dovecot was an inetd plugin, the way imap servers usually are. It isn't, which means dovecot.conf is not reread as often as I thought.
I need to redo my diagnostics with more dovecot restarts. Is there an
So, do we conclude from this your issue is now resolved?
Noel Butler noel.butler@ausics.net:
So, do we conclude from this your issue is now resolved?
Possible, but not verified. If I mess with the mail system for diagnostic purposes I risk breaking it before my wife has caught up with her week's backlog of email. This would make her more unhappy than the diagnostic information can justify. So I am not, not, *not* going to touch it for a few days.
I can say that I think I have narrowed the problem down to one of two causes:
(1) mail_location being misconfigured, with diagnostic problems bedeviling me because dovecot.conf is a persistent daemon that has to be SIGHUPped to read its config, rather than an inetd plugin.
(2) Some weird permissions problem scewing up location autodetection, which I solved shotgun-fashion by adding Cathy to all the groups I'm a member of.
The evidence for theory (2) is that I was able to fetch mail even when mail_location was misconfigured. At some point I'll back Cathy out of these groups and see if her fetches break.
Matters were not helped by the fact that Thunderbird is fluky and overcomplicated. When you have a fetch failure with one of these GUIfied MUAs like Thunderbird or KMail it can be difficult to tease apart client-side problems from IMAP server issues. Fetchmail plus mutt is way superior from a troubleshooting point of view.
I shall probably blog a rant about this latter issue soon.
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
On Thu, 2010-11-25 at 02:50 -0500, Eric Raymond wrote:
Noel Butler noel.butler@ausics.net:
So, do we conclude from this your issue is now resolved?
Possible, but not verified. If I mess with the mail system for diagnostic purposes I risk breaking it before my wife has caught up with her week's backlog of email. This would make her more unhappy than the diagnostic information can justify. So I am not, not, *not* going to touch it for a few days.
I can say that I think I have narrowed the problem down to one of two causes:
(1) mail_location being misconfigured, with diagnostic problems bedeviling me because dovecot.conf is a persistent daemon that has to be SIGHUPped to read its config, rather than an inetd plugin.
(2) Some weird permissions problem scewing up location autodetection, which I solved shotgun-fashion by adding Cathy to all the groups I'm a member of.
The evidence for theory (2) is that I was able to fetch mail even when mail_location was misconfigured. At some point I'll back Cathy out of these groups and see if her fetches break.
Matters were not helped by the fact that Thunderbird is fluky and overcomplicated. When you have a fetch failure with one of these GUIfied MUAs like Thunderbird or KMail it can be difficult to tease apart client-side problems from IMAP server issues. Fetchmail plus mutt is way superior from a troubleshooting point of view.
I shall probably blog a rant about this latter issue soon.
hehe, OK, so long as things are working which is the goal, TB is horrid, I detest it, my staff detest it, I tell em to tell users to use a real client :) being a Gnome fan, it has to be evolution.
fetchmail is good, I use it for my 'more general` mailing lists account which differs from this one, thats the one like linux kernel and bunch of others that gets around 300 msgs plus a day, so of course I only skim over them using pine :)
Noel Butler noel.butler@ausics.net:
fetchmail is good, I use it for my 'more general` mailing lists account which differs from this one, thats the one like linux kernel and bunch of others that gets around 300 msgs plus a day, so of course I only skim over them using pine :)
It's 14 years after I taught fetchmail to speak SMTP and I find people still often fail to grok what that actually demonstrates. What it means, I think, is that putting IMAP or POP in a MUA *at all* was wrong, a historical mistake; it confuses transport-level issues with user-agent-level stuff.
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
Eric Raymond
Noel Butler
: So, do we conclude from this your issue is now resolved?
Possible, but not verified. If I mess with the mail system for diagnostic purposes I risk breaking it before my wife has caught up with her week's backlog of email. This would make her more unhappy than the diagnostic information can justify. So I am not, not, *not* going to touch it for a few days.
I can say that I think I have narrowed the problem down to one of two causes:
(1) mail_location being misconfigured, with diagnostic problems bedeviling me because dovecot.conf is a persistent daemon that has to be SIGHUPped to read its config, rather than an inetd plugin.
(2) Some weird permissions problem scewing up location autodetection, which I solved shotgun-fashion by adding Cathy to all the groups I'm a member of.
The evidence for theory (2) is that I was able to fetch mail even when mail_location was misconfigured. At some point I'll back Cathy out of these groups and see if her fetches break.
Matters were not helped by the fact that Thunderbird is fluky and overcomplicated. When you have a fetch failure with one of these GUIfied MUAs like Thunderbird or KMail it can be difficult to tease apart client-side problems from IMAP server issues. Fetchmail plus mutt is way superior from a troubleshooting point of view.
I shall probably blog a rant about this latter issue soon.
I had pretty much the same problem, but not with all the accounts. When i tried telling dovecot where the mbox was I started running into the permission problems. In my case it turned out to be how I created the users. On one user I useradd -s /bin/nologin and it did not create a /home/directory nor the /home/user/mail directory. I added those two directories made sure the user owned them then set dovecot back to autodetection and everything worked fine. I still have an issue with squirrelmail not having permission to create a sent folder. So if you can completely delete then add the user. It should solve everything.
participants (6)
-
Eric Raymond
-
Eric Raymond
-
Jon Nowakowski
-
Noel Butler
-
Stan Hoeppner
-
Timo Sirainen