<div dir="ltr"><div class="gmail_default" style="font-size:x-small">That appears to have done the trick.</div><div class="gmail_default" style="font-size:x-small"><br></div><div class="gmail_default" style="font-size:x-small">Thank you for your quick response. </div><div class="gmail_default" style="font-size:x-small"><br></div><div class="gmail_default" style="font-size:x-small">I probably should have found that setting. Sorry. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Sep 12, 2021 at 10:39 AM Aki Tuomi <<a href="mailto:aki.tuomi@open-xchange.com">aki.tuomi@open-xchange.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Try<br>
<br>
mail_location = maildir:/var/mail/vmail/%Ld/%Ln<br>
<br>
Aki<br>
<br>
> On 12/09/2021 19:38 C. Petro <<a href="mailto:petro@cpetro.us" target="_blank">petro@cpetro.us</a>> wrote:<br>
> <br>
> <br>
> To be more clear about my problem.<br>
> <br>
> This server will be hosting multiple email domains, and I would prefer to have the filesystem structured like /var/mail/vmail/<domain>/<user> rather than /var/mail/vmail/<user>@<domain>.<br>
> <br>
> <br>
> On Sat, Sep 11, 2021 at 3:06 PM C. Petro <<a href="mailto:petro@cpetro.us" target="_blank">petro@cpetro.us</a>> wrote:<br>
> > I'm trying to build a mail server for a friend using Postfix, Dovecot and Postfixadmin, using Mariadb as the backend for user information and authentication.<br>
> > <br>
> > I've got it *almost* working.<br>
> > (dovecot -n at the bottom because I don't think the problem is in the SQL)<br>
> > <br>
> > I have things up to the point where mail comes in, and where you can get Thunderbird to connect to Dovecot, but delivery is looking at a different directory than IMAP:<br>
> > root@mailserver:/var/mail/vmail# find ./<br>
> > ./<br>
> > ./<a href="mailto:petro@republicofmean.com" target="_blank">petro@republicofmean.com</a><br>
> > ./<a href="http://petro@republicofmean.com/dovecot.index.log" rel="noreferrer" target="_blank">petro@republicofmean.com/dovecot.index.log</a> (<a href="http://petro@republicofmean.com/dovecot.index.log" rel="noreferrer" target="_blank">http://petro@republicofmean.com/dovecot.index.log</a>)<br>
> > ./<a href="http://petro@republicofmean.com/dovecot-uidvalidity.6136d995" rel="noreferrer" target="_blank">petro@republicofmean.com/dovecot-uidvalidity.6136d995</a> (<a href="http://petro@republicofmean.com/dovecot-uidvalidity.6136d995" rel="noreferrer" target="_blank">http://petro@republicofmean.com/dovecot-uidvalidity.6136d995</a>)<br>
> > ./<a href="http://petro@republicofmean.com/tmp" rel="noreferrer" target="_blank">petro@republicofmean.com/tmp</a> (<a href="http://petro@republicofmean.com/tmp" rel="noreferrer" target="_blank">http://petro@republicofmean.com/tmp</a>)<br>
> > <...><br>
> > ./<a href="http://petro@republicofmean.com/new" rel="noreferrer" target="_blank">petro@republicofmean.com/new</a> (<a href="http://petro@republicofmean.com/new" rel="noreferrer" target="_blank">http://petro@republicofmean.com/new</a>)<br>
> > ./<a href="http://petro@republicofmean.com/subscriptions" rel="noreferrer" target="_blank">petro@republicofmean.com/subscriptions</a> (<a href="http://petro@republicofmean.com/subscriptions" rel="noreferrer" target="_blank">http://petro@republicofmean.com/subscriptions</a>)<br>
> > ./<a href="http://republicofmean.com" rel="noreferrer" target="_blank">republicofmean.com</a> (<a href="http://republicofmean.com" rel="noreferrer" target="_blank">http://republicofmean.com</a>)<br>
> > ./<a href="http://republicofmean.com/petro" rel="noreferrer" target="_blank">republicofmean.com/petro</a> (<a href="http://republicofmean.com/petro" rel="noreferrer" target="_blank">http://republicofmean.com/petro</a>)<br>
> > ./<a href="http://republicofmean.com/petro/tmp" rel="noreferrer" target="_blank">republicofmean.com/petro/tmp</a> (<a href="http://republicofmean.com/petro/tmp" rel="noreferrer" target="_blank">http://republicofmean.com/petro/tmp</a>)<br>
> > ./<a href="http://republicofmean.com/petro/cur" rel="noreferrer" target="_blank">republicofmean.com/petro/cur</a> (<a href="http://republicofmean.com/petro/cur" rel="noreferrer" target="_blank">http://republicofmean.com/petro/cur</a>)<br>
> > ./<a href="http://republicofmean.com/petro/new" rel="noreferrer" target="_blank">republicofmean.com/petro/new</a> (<a href="http://republicofmean.com/petro/new" rel="noreferrer" target="_blank">http://republicofmean.com/petro/new</a>)<br>
> > ./<a href="http://republicofmean.com/petro/new/1630897562.Vfd00Ib40009M307139.mailserver" rel="noreferrer" target="_blank">republicofmean.com/petro/new/1630897562.Vfd00Ib40009M307139.mailserver</a> (<a href="http://republicofmean.com/petro/new/1630897562.Vfd00Ib40009M307139.mailserver" rel="noreferrer" target="_blank">http://republicofmean.com/petro/new/1630897562.Vfd00Ib40009M307139.mailserver</a>)<br>
> > <....><br>
> > ./<a href="http://republicofmean.com/petro/new/1630899062.Vfd00Ib40011M264001.mailserver" rel="noreferrer" target="_blank">republicofmean.com/petro/new/1630899062.Vfd00Ib40011M264001.mailserver</a> (<a href="http://republicofmean.com/petro/new/1630899062.Vfd00Ib40011M264001.mailserver" rel="noreferrer" target="_blank">http://republicofmean.com/petro/new/1630899062.Vfd00Ib40011M264001.mailserver</a>)<br>
> > ./<a href="http://republicofmean.com/cer" rel="noreferrer" target="_blank">republicofmean.com/cer</a> (<a href="http://republicofmean.com/cer" rel="noreferrer" target="_blank">http://republicofmean.com/cer</a>)<br>
> > ./<a href="http://republicofmean.com/cer/tmp" rel="noreferrer" target="_blank">republicofmean.com/cer/tmp</a> (<a href="http://republicofmean.com/cer/tmp" rel="noreferrer" target="_blank">http://republicofmean.com/cer/tmp</a>)<br>
> > ./<a href="http://republicofmean.com/cer/cur" rel="noreferrer" target="_blank">republicofmean.com/cer/cur</a> (<a href="http://republicofmean.com/cer/cur" rel="noreferrer" target="_blank">http://republicofmean.com/cer/cur</a>)<br>
> > ./<a href="http://republicofmean.com/cer/new" rel="noreferrer" target="_blank">republicofmean.com/cer/new</a> (<a href="http://republicofmean.com/cer/new" rel="noreferrer" target="_blank">http://republicofmean.com/cer/new</a>)<br>
> > ./<a href="http://republicofmean.com/cer/new/1630900562.Vfd00Ib40013M218855.mailserver" rel="noreferrer" target="_blank">republicofmean.com/cer/new/1630900562.Vfd00Ib40013M218855.mailserver</a> (<a href="http://republicofmean.com/cer/new/1630900562.Vfd00Ib40013M218855.mailserver" rel="noreferrer" target="_blank">http://republicofmean.com/cer/new/1630900562.Vfd00Ib40013M218855.mailserver</a>)<br>
> > ./<a href="http://republicofmean.com/cer/new/1630899062.Vfd00Ib40010M259724.mailserver" rel="noreferrer" target="_blank">republicofmean.com/cer/new/1630899062.Vfd00Ib40010M259724.mailserver</a> (<a href="http://republicofmean.com/cer/new/1630899062.Vfd00Ib40010M259724.mailserver" rel="noreferrer" target="_blank">http://republicofmean.com/cer/new/1630899062.Vfd00Ib40010M259724.mailserver</a>)<br>
> > <br>
> > The SQL I think Dovecot is using:<br>
> > root@mailserver:/etc/dovecot# grep -i select dovecot-sql.conf.ext | grep -v "^#"<br>
> > password_query = SELECT username as user, domain, password FROM mailbox WHERE username = '%u'<br>
> > user_query = select CONCAT("/var/mail/vmail/",maildir) as home, 500 as uid, 500 as gid from mailbox where username="%u"<br>
> > <br>
> > <br>
> > Here's what Postfix is using:<br>
> > <a href="http://mysql_virtual_alias_domain_catchall_maps.cf" rel="noreferrer" target="_blank">mysql_virtual_alias_domain_catchall_maps.cf</a> (<a href="http://mysql_virtual_alias_domain_catchall_maps.cf" rel="noreferrer" target="_blank">http://mysql_virtual_alias_domain_catchall_maps.cf</a>):<br>
> > query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1'<br>
> > <a href="http://mysql_virtual_alias_domain_mailbox_maps.cf" rel="noreferrer" target="_blank">mysql_virtual_alias_domain_mailbox_maps.cf</a> (<a href="http://mysql_virtual_alias_domain_mailbox_maps.cf" rel="noreferrer" target="_blank">http://mysql_virtual_alias_domain_mailbox_maps.cf</a>):<br>
> > query = SELECT maildir FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 AND alias_domain.active='1'<br>
> > <a href="http://mysql_virtual_alias_domain_maps.cf" rel="noreferrer" target="_blank">mysql_virtual_alias_domain_maps.cf</a> (<a href="http://mysql_virtual_alias_domain_maps.cf" rel="noreferrer" target="_blank">http://mysql_virtual_alias_domain_maps.cf</a>):<br>
> > query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = '%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND alias.active = 1 AND alias_domain.active='1'<br>
> > <a href="http://mysql_virtual_alias_maps.cf" rel="noreferrer" target="_blank">mysql_virtual_alias_maps.cf</a> (<a href="http://mysql_virtual_alias_maps.cf" rel="noreferrer" target="_blank">http://mysql_virtual_alias_maps.cf</a>):<br>
> > query = SELECT goto FROM alias WHERE address='%s' AND active = '1'<br>
> > <a href="http://mysql_virtual_domains_maps.cf" rel="noreferrer" target="_blank">mysql_virtual_domains_maps.cf</a> (<a href="http://mysql_virtual_domains_maps.cf" rel="noreferrer" target="_blank">http://mysql_virtual_domains_maps.cf</a>):<br>
> > query = SELECT domain FROM domain WHERE domain='%s' AND active = '1'<br>
> > <a href="http://mysql_virtual_mailbox_limit_maps.cf" rel="noreferrer" target="_blank">mysql_virtual_mailbox_limit_maps.cf</a> (<a href="http://mysql_virtual_mailbox_limit_maps.cf" rel="noreferrer" target="_blank">http://mysql_virtual_mailbox_limit_maps.cf</a>):<br>
> > query = SELECT quota FROM mailbox WHERE username='%s' AND active = '1'<br>
> > <a href="http://mysql_virtual_mailbox_maps.cf" rel="noreferrer" target="_blank">mysql_virtual_mailbox_maps.cf</a> (<a href="http://mysql_virtual_mailbox_maps.cf" rel="noreferrer" target="_blank">http://mysql_virtual_mailbox_maps.cf</a>):<br>
> > query = SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'<br>
> > <br>
> > <br>
> > <br>
> > <br>
> > <br>
> > <br>
> > # dovecot -n<br>
> > # 2.3.7.2 (3c910f64b): /etc/dovecot/dovecot.conf<br>
> > # Pigeonhole version 0.5.7.2 ()<br>
> > # OS: Linux 5.4.0-81-generic x86_64 Ubuntu 20.04.3 LTS ext4<br>
> > # Hostname: <redacted><br>
> > auth_mechanisms = plain login<br>
> > log_path = /var/log/dovecot.log<br>
> > login_greeting = Not your mail server<br>
> > mail_location = maildir:/var/mail/vmail/%u/<br>
> > mail_max_userip_connections = 50<br>
> > mail_privileged_group = vmail<br>
> > namespace inbox {<br>
> >  inbox = yes<br>
> >  location =<br>
> >  mailbox Drafts {<br>
> >  special_use = \Drafts<br>
> >  }<br>
> >  mailbox Junk {<br>
> >  special_use = \Junk<br>
> >  }<br>
> >  mailbox Sent {<br>
> >  special_use = \Sent<br>
> >  }<br>
> >  mailbox "Sent Messages" {<br>
> >  special_use = \Sent<br>
> >  }<br>
> >  mailbox Trash {<br>
> >  special_use = \Trash<br>
> >  }<br>
> >  prefix =<br>
> > }<br>
> > passdb {<br>
> >  args = /etc/dovecot/dovecot-sql.conf.ext<br>
> >  driver = sql<br>
> > }<br>
> > protocols = " imap lmtp pop3 submission"<br>
> > service auth-worker {<br>
> >  user = vmail<br>
> > }<br>
> > service auth {<br>
> >  unix_listener /var/spool/postfix/private/auth {<br>
> >  group = postfix<br>
> >  mode = 0600<br>
> >  user = postfix<br>
> >  }<br>
> >  unix_listener auth-userdb {<br>
> >  mode = 0600<br>
> >  user = vmail<br>
> >  }<br>
> >  user = dovecot<br>
> > }<br>
> > service imap-login {<br>
> >  inet_listener imap {<br>
> >  port = 143<br>
> >  }<br>
> >  inet_listener imaps {<br>
> >  port = 993<br>
> >  ssl = yes<br>
> >  }<br>
> > }<br>
> > service lmtp {<br>
> >  unix_listener lmtp {<br>
> >  group = postfix<br>
> >  mode = 0600<br>
> >  user = postfix<br>
> >  }<br>
> > }<br>
> > service pop3-login {<br>
> >  inet_listener pop3 {<br>
> >  port = 110<br>
> >  }<br>
> >  inet_listener pop3s {<br>
> >  port = 995<br>
> >  ssl = yes<br>
> >  }<br>
> > }<br>
> > ssl_cert = </etc/letsencrypt/live/<redacted>/fullchain.pem<br>
> > ssl_client_ca_dir = /etc/ssl/certs<br>
> > ssl_dh = # hidden, use -P to show it<br>
> > ssl_key = # hidden, use -P to show it<br>
> > userdb {<br>
> >  args = /etc/dovecot/dovecot-sql.conf.ext<br>
> >  driver = <br>
> ><br>
</blockquote></div>