I'm trying to set up some shared mailboxes like contact or support.
I have made it possible for me to share an IMAP folder between users in Dovecot by doing this in 15-mailboxes.conf
namespace {
type = shared
separator = /
prefix = Shared/
location = mbox:/mail/shared
subscriptions = no
list = children
mailbox support {
auto = subscribe
}
mailbox contact {
auto = subscribe
}
}
and then I'm using ACL to control who has access to each folder.
I want to make the support and contact mail addresses public, so you can email them.
But postfix keeps saying the users don't exist. I have made a file called /etc/postfix/virtualmaps and postmap it.
[email protected] support
[email protected] contact
And in my postfix main.cf, I have added this:
virtual_mailbox_base = /mail/shared
virtual_mailbox_maps = lmdb:/etc/postfix/virtualmaps
if I add virtual_mailbox_domains = $mydomain, postfix throws errors and says that mydestination and virtual_mailbox_domains cant be the same.
All users are ldap users
Edit 1
@NikitaKipriyanov has pointed me in the direction of local_recipient_maps
and then I have found local_delivery that passes everything to dovecot.
It does still not work and but now its that dovecot can't find the ldap user
Edit 2
Docecot has building feature to share an IMAP inbox: https://doc.dovecot.org/configuration_manual/shared_mailboxes/#shared-mailboxes
here are som logs with local_recipient_maps active:
2023-07-17T14:18:21.117842+02:00 tst postfix/pickup[5200]: 1CA20213BC0: uid=0 from=<[email protected]>
2023-07-17T14:18:21.127591+02:00 tst postfix/cleanup[5212]: 1CA20213BC0: message-id=<64b5318d.5XutEBb44MdWM3yJ%[email protected]>
2023-07-17T14:18:21.167058+02:00 tst postfix/qmgr[5199]: 1CA20213BC0: from=<[email protected]>, size=449, nrcpt=1 (queue active)
2023-07-17T14:18:21.230250+02:00 tst postfix/local[5214]: 1CA20213BC0: to=<[email protected]>, relay=local, delay=0.13, delays=0.06/0.03/0/0.03, dsn=5.1.1, status=bounced (unknown user: "support")
2023-07-17T14:18:21.231069+02:00 tst postfix/cleanup[5212]: 38487213BC2: message-id=<[email protected]>
2023-07-17T14:18:21.233902+02:00 tst postfix/bounce[5215]: 1CA20213BC0: sender non-delivery notification: 38487213BC2
2023-07-17T14:18:21.233966+02:00 tst postfix/qmgr[5199]: 38487213BC2: from=<>, size=2226, nrcpt=1 (queue active)
2023-07-17T14:18:21.234323+02:00 tst postfix/qmgr[5199]: 1CA20213BC0: removed
2023-07-17T14:18:21.235893+02:00 tst postfix/local[5214]: 38487213BC2: to=<[email protected]>, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
And here are some logs with local_recipient_maps and local_delivery active:
2023-07-20T13:09:48.958737+02:00 tst postfix/qmgr[31655]: 274CA215D35: from=<[email protected]>, size=449, nrcpt=1 (queue active)
2023-07-20T13:09:48.993036+02:00 tst dovecot: lda([email protected])<31682><>: Debug: Loading modules from directory: /usr/lib64/dovecot/modules
2023-07-20T13:09:48.993428+02:00 tst dovecot: lda([email protected])<31682><>: Debug: Module loaded: /usr/lib64/dovecot/modules/lib01_acl_plugin.so
2023-07-20T13:09:48.993549+02:00 tst dovecot: lda([email protected])<31682><>: Debug: auth-master: userdb lookup([email protected]): Started userdb lookup
2023-07-20T13:09:48.993643+02:00 tst dovecot: lda([email protected])<31682><>: Debug: auth-master: conn unix:/var/run/dovecot//auth-userdb: Connecting
2023-07-20T13:09:48.993756+02:00 tst dovecot: lda([email protected])<31682><>: Debug: auth-master: conn unix:/var/run/dovecot//auth-userdb (pid=26599,uid=0): Client connected (fd=8)
2023-07-20T13:09:48.996561+02:00 tst dovecot: lda([email protected])<31682><>: Debug: auth-master: userdb lookup([email protected]): auth USER input:
2023-07-20T13:09:48.996672+02:00 tst dovecot: lda([email protected])<31682><>: Debug: auth-master: userdb lookup([email protected]): Userdb lookup failed
2023-07-20T13:09:48.996765+02:00 tst dovecot: lda(31682): Debug: auth-master: conn unix:/var/run/dovecot//auth-userdb (pid=26599,uid=0): Disconnected: Connection closed (fd=8)
2023-07-20T13:09:49.003457+02:00 tst postfix/pipe[31681]: 274CA215D35: to=<[email protected]>, relay=dovecot, delay=903, delays=903/0.01/0/0.03, dsn=5.1.1, status=bounced (user unknown. Command output: lda([email protected]): Error: net_connect_unix(/var/run/dovecot//stats-writer) failed: Permission denied )
2023-07-20T13:09:49.009715+02:00 tst postfix/cleanup[31684]: 0233E215EBD: message-id=<[email protected]>
2023-07-20T13:09:49.012518+02:00 tst postfix/bounce[31683]: 274CA215D35: sender non-delivery notification: 0233E215EBD
2023-07-20T13:09:49.012577+02:00 tst postfix/qmgr[31655]: 0233E215EBD: from=<>, size=2430, nrcpt=1 (queue active)
2023-07-20T13:09:49.012611+02:00 tst postfix/qmgr[31655]: 274CA215D35: removed
2023-07-20T13:09:49.022166+02:00 tst dovecot: lda([email protected])<31685><>: Debug: Loading modules from directory: /usr/lib64/dovecot/modules
2023-07-20T13:09:49.022500+02:00 tst dovecot: lda([email protected])<31685><>: Debug: Module loaded: /usr/lib64/dovecot/modules/lib01_acl_plugin.so
2023-07-20T13:09:49.022610+02:00 tst dovecot: lda([email protected])<31685><>: Debug: auth-master: userdb lookup([email protected]): Started userdb lookup
2023-07-20T13:09:49.022700+02:00 tst dovecot: lda([email protected])<31685><>: Debug: auth-master: conn unix:/var/run/dovecot//auth-userdb: Connecting
2023-07-20T13:09:49.022821+02:00 tst dovecot: lda([email protected])<31685><>: Debug: auth-master: conn unix:/var/run/dovecot//auth-userdb (pid=26599,uid=0): Client connected (fd=8)
2023-07-20T13:09:49.025074+02:00 tst dovecot: lda([email protected])<31685><>: Debug: auth-master: userdb lookup([email protected]): auth USER input:
2023-07-20T13:09:49.025181+02:00 tst dovecot: lda([email protected])<31685><>: Debug: auth-master: userdb lookup([email protected]): Userdb lookup failed
2023-07-20T13:09:49.025271+02:00 tst dovecot: lda(31685): Debug: auth-master: conn unix:/var/run/dovecot//auth-userdb (pid=26599,uid=0): Disconnected: Connection closed (fd=8)
2023-07-20T13:09:49.027037+02:00 tst postfix/pipe[31681]: 0233E215EBD: to=<[email protected]>, relay=dovecot, delay=0.02, delays=0.01/0/0/0.01, dsn=5.1.1, status=bounced (user unknown. Command output: lda([email protected]): Error: net_connect_unix(/var/run/dovecot//stats-writer) failed: Permission denied )
2023-07-20T13:09:49.027394+02:00 tst postfix/qmgr[31655]: 0233E215EBD: removed