Strange error on multiple recipent email - permission denied

Salatiel Filho salatiel.filho at gmail.com
Sat Mar 27 04:08:37 EET 2021


Hi, I am doing some tests with dovecot to replace cyrusimapd, but
after the most simple configuration  I am getting some strange errors
on log.



This is the output of dovecot -n:
#davecot -n
disable_plaintext_auth = no ( just for testing )
first_valid_uid = 1000
mail_location = mbox:/var/spool/mail/%n
mail_privileged_group = mail
mbox_write_locks = fcntl
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}
passdb {
  driver = pam
}
protocols = imap lmtp
ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_cipher_list = PROFILE=SYSTEM
ssl_key = # hidden, use -P to show it
userdb {
  driver = passwd
}



I have  also chmod a+rwxt on /var/spool/mail and set.

Now here is the strange behavior.

I have 2 users created, user1 and user2.
At first , there are no files on /var/spool/mail as expected.


Now  I send one email to user1 at mydomain and I can receive just fine
and there are no errors on logs.

Mar 27 00:32:20 mx2 dovecot[1473]: lmtp(1504): Connect from local
Mar 27 00:32:20 mx2 sendmail[1503]: STARTTLS=client, relay=localhost,
version=TLSv1.3, verify=FAIL, cipher=TLS_AES_256_GCM_SHA384,
bits=256/256
Mar 27 00:32:20 mx2 dovecot[1473]:
lmtp(user1)<1504><hzMPOBR9XmDgBQAAUY4zkw>: lmtp-server: conn
unix:pid=1503,uid=0 [1]: rcpt user1:
msgid=<CAGmni9qUfh_EntW-mMvdTK=bCc3QVQ+74f8X3BzBa5Z0dYi+-g at mail.gmail.com>:
saved mail to INBOX
Mar 27 00:32:20 mx2 sendmail[1503]: 12R0WKV0001502:
to=<user1 at mydomain.here>, delay=00:00:00, xdelay=00:00:00,
mailer=local, pri=32320, relay=localhost, dsn=2.0.0, stat=Sent
Mar 27 00:32:20 mx2 sendmail[1503]: 12R0WKV0001502: done;
delay=00:00:00, ntries=1
Mar 27 00:32:20 mx2 dovecot[1473]: lmtp(1504): Disconnect from local:
Client has quit the connection (state=READY)

Now I send one email to user2 at mydomain and I can receive just fine and
there are no errors on logs.

Mar 27 00:33:45 mx2 dovecot[1473]: lmtp(1510): Connect from local
Mar 27 00:33:46 mx2 sendmail[1509]: STARTTLS=client, relay=localhost,
version=TLSv1.3, verify=FAIL, cipher=TLS_AES_256_GCM_SHA384,
bits=256/256
Mar 27 00:33:46 mx2 dovecot[1473]:
lmtp(user2)<1510><IUlGAWp9XmDmBQAAUY4zkw>: lmtp-server: conn
unix:pid=1509,uid=0 [1]: rcpt user2:
msgid=<CAGmni9qDHgDw=M6XPMk_eWb+02OJmCMarVe8sc_B4rNYUGMfGw at mail.gmail.com>:
saved mail to INBOX
Mar 27 00:33:46 mx2 sendmail[1509]: 12R0XjKj001508:
to=<user2 at mydomain.here>, delay=00:00:01, xdelay=00:00:01,
mailer=local, pri=32318, relay=localhost, dsn=2.0.0, stat=Sent
Mar 27 00:33:46 mx2 sendmail[1509]: 12R0XjKj001508: done;
delay=00:00:01, ntries=1
Mar 27 00:33:46 mx2 dovecot[1473]: lmtp(1510): Disconnect from local:
Client has quit the connection (state=READY)


The problem starts if I send one email to user1 AND user2 ( user2 can
be in TO or CC )


Mar 27 00:35:04 mx2 dovecot[1473]:
lmtp(user2)<1518><AxH4Nbh9XmDuBQAAUY4zkw>: lmtp-server: conn
unix:pid=1517,uid=0 [1]: rcpt user2:
msgid=<CAGmni9oqid6pAEWPynAq9to-u0YdxE2o65wS34aeevnEWLj=AA at mail.gmail.com>:
saved mail to INBOX
Mar 27 00:35:04 mx2 dovecot[1473]:
lmtp(user1)<1518><AxH4Nbh9XmDuBQAAUY4zkw:2>: Error: lmtp-server: conn
unix:pid=1517,uid=0 [1]: rcpt user2:
stat(/var/spool/mail/user2/.imap/INBOX/dovecot.index.log) failed:
Permission denied (euid=1003(user1) egid=1003(user1) missing +x perm:
/var/spool/mail/user2, dir owned by 1004:1004 mode=0700)
Mar 27 00:35:04 mx2 dovecot[1473]:
lmtp(user1)<1518><AxH4Nbh9XmDuBQAAUY4zkw:2>: Error: lmtp-server: conn
unix:pid=1517,uid=0 [1]: rcpt user2:
open(/var/spool/mail/user2/.imap/INBOX/dovecot.index) failed:
Permission denied (euid=1003(user1) egid=1003(user1) missing +x perm:
/var/spool/mail/user2, dir owned by 1004:1004 mode=0700)
Mar 27 00:35:04 mx2 dovecot[1473]:
lmtp(user1)<1518><AxH4Nbh9XmDuBQAAUY4zkw:2>: lmtp-server: conn
unix:pid=1517,uid=0 [1]: rcpt user1:
msgid=<CAGmni9oqid6pAEWPynAq9to-u0YdxE2o65wS34aeevnEWLj=AA at mail.gmail.com>:
saved mail to INBOX
Mar 27 00:35:04 mx2 sendmail[1517]: 12R0Z4h0001516:
to=<user2 at mydomain.here>,<user1 at mydomain.here>, delay=00:00:00,
xdelay=00:00:00, mailer=local, pri=62302, relay=localhost, dsn=2.0.0,
stat=Sent
Mar 27 00:35:04 mx2 sendmail[1517]: 12R0Z4h0001516: done;
delay=00:00:00, ntries=1
Mar 27 00:35:04 mx2 dovecot[1473]: lmtp(1518): Disconnect from local:
Client has quit the connection (state=READY)



Although I can receive the email, there's an ERROR log in maillog. It
appears user1 wants to open the user2 index file.
Any ideas why ?

Thank you very much!


More information about the dovecot mailing list