Aki Tuomi
2023-Feb-13 09:48 UTC
Could not override "mail_location" with "userdb_mail" statment in "/etc/passwd"
> On 13/02/2023 11:36 EET Xavier <xavier-mlist at proton.me> wrote: > > > Hi, > > ** Using Dovecot 2.2.22 and Postfix 3.1.0 ** > > I plan to migrate all accounts on my server from mbox to maildir storage but before i want to make some tests on dedicated accounts. To do so i want to overide the general "mail_location" ( mail_location = mbox:~/mail:INBOX=/var/mail/%u ) with "maildir:~/Maildir" only for some test accounts. > > To do so i modified my "/etc/passwd" file using something like that : > > testm2m_mydomain.tld:x:2122:2122::/home/mail/testm2m_mydomain.tld:/bin/false:userdb_mail=maildir:~/Maildir > Also tried > testm2m_mydomain.tld:x:2122:2122::/home/mail/testm2m_mydomain.tld:/bin/false::userdb_mail=maildir:~/Maildir > > And as mentioned in the doc (https://wiki.dovecot.org/LDA/Postfix) i added -d "$USER" in my Postfix "mailbox_command" but it don't seem to work (my new mail_location for this test user is is not taken into account). > > When i try to make an "doveadm user testm2m_mydomain.tld" i get this : > > 8<-------------------------------- > field value > uid 2122 > gid 2122 > home /home/mail/testm2m_mydomain.tld > mail mbox:~/mail:INBOX=/var/mail/testm2m_mydomain.tld > system_groups_user testm2m_mydomain.tld > 8<-------------------------------- > > My modification is not taken into account ... > > Any help is welcome ! > > /XavierHi! You need to use passwd-file driver. I would recommend adding secondary userdb for overrides in a separate file instead of modifying /etc/passwd. userdb { driver = passwd result_success = continue-ok } userdb { driver = passwd-file args = /etc/dovecot/overrides } and put in overrides testm2m_mydomain.tld:::::::userdb_mail=maildir:~/Maildir Aki
Xavier
2023-Feb-14 07:47 UTC
Could not override "mail_location" with "userdb_mail" statment in "/etc/passwd"
> You need to use passwd-file driver. I would recommend adding secondary userdb for overrides in a separate file instead of modifying /etc/passwd. > > userdb { > driver = passwd > result_success = continue-ok > } > > userdb { > driver = passwd-file > args = /etc/dovecot/overrides > } > > and put in overrides > > testm2m_mydomain.tld:::::::userdb_mail=maildir:~/MaildirHi Aki, Thanks for your answer ! I've just gived a try and it works partially : - the "userdb_mail=maildir:~/Maildir" is well taken into account for my user in "/etc/dovecot/overrides" (testm2m_mydomain.tld) BUT - all other accounts (located in "/etc/passwd" and not in "/etc/dovecot/overrides") could not connect anymore to the Dovecot server (POP/IMAP...). I got this kind of message in mail mail.log : 8<------------------------------ Feb 13 21:58:14 mail dovecot: imap: Error: Authenticated user not found from userdb, auth lookup id=2769158145 (client-pid=27095 client-id=1) Feb 13 21:58:14 mail dovecot: imap-login: Internal login failure (pid=27095 id=1) (internal failure, 1 successful auths): user=<xavier_mydomain.tld>, method=PLAIN, rip=x.x.x.x, lip=y.y.y.y, mpid=27096, secured, session=<N2VZZ4v0oNABJ3LB> 8<------------------------------ Any idea ? Thanks for your help ! /Xavier -------------- next part -------------- A non-text attachment was scrubbed... Name: publickey - xavier-mlist at proton.me - 0xC617DF73.asc Type: application/pgp-keys Size: 3150 bytes Desc: not available URL: <https://dovecot.org/pipermail/dovecot/attachments/20230214/d36244c0/attachment.key> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 855 bytes Desc: OpenPGP digital signature URL: <https://dovecot.org/pipermail/dovecot/attachments/20230214/d36244c0/attachment.sig>