<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 28/05/2021 06:43, Aki Tuomi wrote:
</div>
<blockquote type="cite"
cite="mid:983891049.1215.1622176996826@appsuite-dev-gw1.open-xchange.com">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">On 27/05/2021 22:24 Jeff Abrahamson <a class="moz-txt-link-rfc2396E" href="mailto:jeff@p27.eu"><jeff@p27.eu></a> wrote:
I've started seeing the following error in mail.err for precisely one user on precisely one domain:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Error: mkdir(/var/mail/vmail//jeff/mail) failed: Permission denied (euid=1000(jeff) egid=1001(jeff) missing +w perm: /var/mail/vmail/, dir owned by 4000:4000 mode=0755)
Error: Mailbox INBOX: Failed to autocreate mailbox: Internal error occurred.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">In mail.log I see a bit more:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Warning: Failed to parse address from `From_'-line: Missing domain
Error: mkdir(/var/mail/vmail//jeff/mail) failed: Permission denied (euid=1000(jeff) egid=1001(jeff) missing +w perm: /var/mail/vmail/, dir owned by 4000:4000 mode=0755)
Error: mkdir(/var/mail/vmail//jeff/mail) failed: Permission denied (euid=1000(jeff) egid=1001(jeff) missing +w perm: /var/mail/vmail/, dir owned by 4000:4000 mode=0755)
Error: Mailbox INBOX: Failed to autocreate mailbox: Internal error occurred. Refer to server log for more information.
save failed to open mailbox INBOX: Mailbox INBOX: Failed to autocreate mailbox: Internal error occurred.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">And yet there's no apparent problem sending and receiving mail for user jeff, for all domains handled by the server. Other users have no issues. The /var/mail/vmail/ hierarchy is all owned by vmail:vmail (4000:4000) and directories are all 0755.
I suspect a red herring except it's been continuing for a week now. I was reading this page (following some searching), but it doesn't seem pertinent in the end.
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap=""><a class="moz-txt-link-freetext" href="https://wiki2.dovecot.org/MailLocation/mbox#A.2BAC8-var.2BAC8-mail.2BAC8_dotlocks">https://wiki2.dovecot.org/MailLocation/mbox#A.2BAC8-var.2BAC8-mail.2BAC8_dotlocks</a>
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">Any suggestions what this might be?
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
This indicates your mail process is being ran as jeff:jeff instead of vmail:vmail.
Can you try `doveadm auth test yourusername` and `doveadm user yourusername` to ensure you are not ending up with uid=jeff gid=jeff somehow?</pre>
</blockquote>
<p>User jeff (which shouldn't happen but is indicated by the empty
From_ message) or <a class="moz-txt-link-abbreviated" href="mailto:jeff@p27.eu">jeff@p27.eu</a> (user which manifestly exists and
works):<br>
<font face="monospace"></font></p>
<blockquote>
<p><font face="monospace">[T] jeff@nantes-m1:~ $ doveadm auth test
jeff<br>
doveadm(jeff): Error:
net_connect_unix(/var/run/dovecot/stats-writer) failed:
Permission denied<br>
Password: <br>
Error: auth-client: conn unix:/var/run/dovecot/auth-client:
connect(/var/run/dovecot/auth-client) failed: Permission
denied (euid=1000(jeff) egid=1001(jeff) missing +r perm:
/var/run/dovecot/auth-client, dir owned by 0:0 mode=0755)<br>
77,[T] jeff@nantes-m1:~ $ doveadm auth test <a class="moz-txt-link-abbreviated" href="mailto:jeff@p27.eu">jeff@p27.eu</a><br>
doveadm(jeff): Error:
net_connect_unix(/var/run/dovecot/stats-writer) failed:
Permission denied<br>
Password: <br>
Error: auth-client: conn unix:/var/run/dovecot/auth-client:
connect(/var/run/dovecot/auth-client) failed: Permission
denied (euid=1000(jeff) egid=1001(jeff) missing +r perm:
/var/run/dovecot/auth-client, dir owned by 0:0 mode=0755)<br>
77,[T] jeff@nantes-m1:~ $ sudo doveadm auth test jeff<br>
Password: <br>
passdb: jeff auth failed<br>
extra fields:<br>
user=jeff<br>
77,[T] jeff@nantes-m1:~ $ sudo doveadm auth test <a class="moz-txt-link-abbreviated" href="mailto:jeff@p27.eu">jeff@p27.eu</a><br>
Password: <br>
passdb: <a class="moz-txt-link-abbreviated" href="mailto:jeff@p27.eu">jeff@p27.eu</a> auth failed<br>
extra fields:<br>
<a class="moz-txt-link-abbreviated" href="mailto:user=jeff@p27.eu">user=jeff@p27.eu</a><br>
77,[T] jeff@nantes-m1:~ $ <br>
77,[T] jeff@nantes-m1:~ $ doveadm user jeff<br>
doveadm(jeff): Error:
net_connect_unix(/var/run/dovecot/stats-writer) failed:
Permission denied<br>
field value<br>
userdb lookup: user jeff doesn't exist<br>
<br>
67,[T] jeff@nantes-m1:~ $ doveadm user <a class="moz-txt-link-abbreviated" href="mailto:jeff@p27.eu">jeff@p27.eu</a><br>
doveadm(jeff): Error:
net_connect_unix(/var/run/dovecot/stats-writer) failed:
Permission denied<br>
field valuedoveadm(<a class="moz-txt-link-abbreviated" href="mailto:jeff@p27.eu">jeff@p27.eu</a>)<1640907><>:
Error: auth-master: userdb lookup(<a class="moz-txt-link-abbreviated" href="mailto:jeff@p27.eu">jeff@p27.eu</a>): Auth USER
lookup failed<br>
<br>
75,[T] jeff@nantes-m1:~ $ sudo doveadm user <a class="moz-txt-link-abbreviated" href="mailto:jeff@p27.eu">jeff@p27.eu</a><br>
[sudo] password for jeff: <br>
field value<br>
uid 4000<br>
gid 4000<br>
home /var/mail/vmail/p27.eu/jeff<br>
mail maildir:/var/mail/vmail/p27.eu/jeff/mail:LAYOUT=fs<br>
[T] jeff@nantes-m1:~ $ sudo doveadm user jeff<br>
field value<br>
userdb lookup: user jeff doesn't exist<br>
<br>
67,[T] jeff@nantes-m1:postfix $ </font><br>
</p>
</blockquote>
<p>Dovecot processes:</p>
<blockquote>
<p><font face="monospace">[T] jeff@nantes-m1:~ $ ps axfu | grep
dove | grep -v grep<br>
root 1576672 0.0 0.2 4536 2788 ? Ss May23
0:02 /usr/sbin/dovecot -F<br>
dovecot 1576683 0.0 0.1 4380 2008 ? S May23
0:01 \_ dovecot/anvil<br>
root 1576684 0.0 0.1 4388 1896 ? S May23
0:00 \_ dovecot/log<br>
root 1576685 0.0 0.4 5856 4172 ? S May23
0:02 \_ dovecot/config<br>
dovecot 1576699 0.0 0.3 5036 3084 ? S May23
0:01 \_ dovecot/stats<br>
dovenull 1576804 0.0 0.4 8472 4288 ? S May23
0:02 \_ dovecot/imap-login<br>
vmail 1576805 0.0 0.4 7212 4572 ? S May23
0:03 \_ dovecot/imap<br>
dovecot 1637614 0.0 0.5 9508 5756 ? S 04:58
0:00 \_ dovecot/auth<br>
dovenull 1638957 0.0 0.6 8472 6664 ? S 06:19
0:00 \_ dovecot/imap-login<br>
vmail 1638958 0.0 0.5 9580 5612 ? S 06:19
0:00 \_ dovecot/imap<br>
dovenull 1640541 0.0 0.6 8472 6660 ? S 06:39
0:00 \_ dovecot/imap-login<br>
vmail 1640542 0.0 0.4 6136 4584 ? S 06:39
0:00 \_ dovecot/imap<br>
dovenull 1640591 0.0 0.6 8472 6656 ? S 06:44
0:00 \_ dovecot/imap-login<br>
dovenull 1640592 0.0 0.6 8472 6580 ? S 06:44
0:00 \_ dovecot/imap-login<br>
vmail 1640593 0.0 0.6 14732 7000 ? S 06:44
0:00 \_ dovecot/imap<br>
vmail 1640594 0.0 0.5 6952 5504 ? S 06:44
0:00 \_ dovecot/imap<br>
dovenull 1640599 0.0 0.6 8472 6676 ? S 06:45
0:00 \_ dovecot/imap-login<br>
vmail 1640600 0.0 0.5 7092 5764 ? S 06:45
0:00 \_ dovecot/imap<br>
dovenull 1640601 0.0 0.6 8472 6680 ? S 06:45
0:00 \_ dovecot/imap-login<br>
vmail 1640602 0.0 0.5 6460 5168 ? S 06:45
0:00 \_ dovecot/imap<br>
dovenull 1640607 0.0 0.6 8472 6544 ? S 06:45
0:00 \_ dovecot/imap-login<br>
vmail 1640608 0.0 0.4 6444 4980 ? S 06:45
0:00 \_ dovecot/imap<br>
dovenull 1640609 0.0 0.6 8472 6764 ? S 06:45
0:00 \_ dovecot/imap-login<br>
vmail 1640610 0.0 0.5 7072 5900 ? S 06:45
0:00 \_ dovecot/imap<br>
dovenull 1640613 0.0 0.6 8472 6620 ? S 06:45
0:00 \_ dovecot/imap-login<br>
vmail 1640614 0.0 0.5 6460 5312 ? S 06:45
0:00 \_ dovecot/imap<br>
dovenull 1640615 0.0 0.6 8472 6716 ? S 06:45
0:00 \_ dovecot/imap-login<br>
vmail 1640616 0.0 0.5 6444 5080 ? S 06:45
0:00 \_ dovecot/imap<br>
dovenull 1640617 0.0 0.6 8472 6752 ? S 06:45
0:00 \_ dovecot/imap-login<br>
vmail 1640618 0.0 0.5 7864 5512 ? S 06:45
0:00 \_ dovecot/imap<br>
[T] jeff@nantes-m1:~ $</font><br>
</p>
</blockquote>
<p>On a hunch based on your suggested test, I installed mailx and
did the following two tests. The first triggers the error
message, the second does not:</p>
<blockquote>
<p><font face="monospace">[T] jeff@nantes-m1:~ $ echo test | mailx
-s 'test 1' jeff<br>
[T] jeff@nantes-m1:~ $ echo test | mailx -s 'test 1'
<a class="moz-txt-link-abbreviated" href="mailto:jeff@p27.eu">jeff@p27.eu</a></font></p>
</blockquote>
<p>This suggests to me that some cron job was trying to mail me and
failing to get its mail delivered.<br>
</p>
<p>So one fix (but maybe not the correct fix) is to add this line to
/etc/postfix/virtual (despite the error coming from dovecot):<br>
</p>
<blockquote>
<p><font face="monospace">jeff <a class="moz-txt-link-abbreviated" href="mailto:jeff@p27.eu">jeff@p27.eu</a></font></p>
</blockquote>
--
<pre class="moz-signature" cols="72">Jeff Abrahamson
+33 6 24 40 01 57
+44 7920 594 255
<a class="moz-txt-link-freetext" href="http://p27.eu/jeff/">http://p27.eu/jeff/</a>
<a class="moz-txt-link-freetext" href="http://mobilitains.fr/">http://mobilitains.fr/</a></pre>
</body>
</html>