Hi Bob

yes, I was going to suggest then using mysql lookup maps in postfix to share the user database from dovecot. I imagine there is a way to build postfix with mysql support on MacOS but I don't know what it is.

If not you could still generate the info for one of the supported postfix map types from a mysql query that refreshs the map file periodically (being careful though to not do that on the live file directly, but a temporary file which is then renamed to the live file to avoid postfix reading incomplete files while they are being generated).

I switched from dovecot lda many years ago, so I can't remember exactly the configuration, but for sure it can deliver for any user if correctly configured as the delivery mechanism in postfix.

I use lmtp and have it like this:

mailbox_command =
home_mailbox =

mailbox_transport = lmtp:unix:private/dovecot-lmtp
(with lmtp service also configured on dovecot)

To keep with lda I think you can do it with this in master.cf, though I may not have remembered that 100% right.

dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/dovecot-lda -f ${sender} -d ${recipient}

and in main.cf

mailbox_transport=dovecot

dovecot_destination_recipient_limit = 1

mailbox_command =
home_mailbox =

Other setups are possible too, but hopefully this one is nearer to your current configuration.

John

On 08/07/2024 00:02, Robert Fuhrer via Postfix-users wrote:
Oh, thanks; I should’ve realized I could just add another map to local_recipient_maps. D’oh!

My Dovecot setup uses MySQL to identify users+passwords.

I assume you’re asking that because (as I just discovered) PostFix nominally supports MySQL, but OTOH “postconf -m” doesn’t list the “mysql” lookup table type, so it’s not supported on the distribution that comes with MacOS.

That said, for the one login user, I had been specifying:

  # main.cf
  home_mailbox = Maildir/

but my Dovecot setup stores the base directory path in the MySQL DB. For non-login users, that base directory is of course not relative to the user's “home directory”, since non-login users have no “home directory”. (For login users, the base directory just happens to point to their home directory.)

I guess Dovecot’s LDA would consult the MySQL DB to find the user's Maildir, but perhaps PostFix’s invocation of the Dovecot LDA overrides the path using the “home_mailbox”. (?)

In that case, without virtual_mailbox_base, I don’t see how to point PostFix to the right Maildir for non-login users.

Thanks so much for the help!!

Cheers,
 - Bob

On Jul 7, 2024, at 4:12 PM, John Fawcett via Postfix-users <postfix-users@postfix.org> wrote:
On 07/07/2024 18:59, Robert Fuhrer via Postfix-users wrote:
Hi,

I've got a Mac running PostFix 3.2.2, configured for local delivery for a single domain, call it "mydomain.net <http://mydomain.net/>", using dovecot's local delivery agent.

At the moment, there's just one relevant login user on the server, for which I've got PostFix delivering emails addressed to "myu...@mydomain.net" to that user's Maildir store. This has worked fine, for years.

As such, here are the relevant bits of config:

 # main.cf
 myhostname = mail.mydomain.net <http://mail.mydomain.net/>
 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
 local_recipient_maps = proxy:unix:passwd.byname $alias_maps
 alias_database = hash:/etc/aliases

 # access
myu...@mydomain.net  OK

 # virtual
myu...@mydomain.net myuser@localhost

(I'm actually not sure the virtual user entry is actually necessary. I suspect not. Is it?)

I'd like to augment this PostFix setup to accept local delivery for a very limited number (say, 3-5) of specific NON-login users in the same domain, e.g. "otheru...@mydomain.net", also via Maildir. (I already have those users' mailboxes set up in Dovecot, so I can see their mailboxes and emails via the Dovecot IMAP service in my mail client.)

I understand that one shouldn't also list "@mydomain.net" as a virtual_mailbox_domain (since it's already $mydestination), so what should I do?

I'm tempted to try this:
1) Set up a fake virtual domain, say, "mydomain.virtual", just to map those non-login users' addresses from the external addresses (@mydomain.net).
2) Add a virtual mailbox domain for that domain.
3) Set up local delivery for the users in that domain (by mapping them to otheruser@localhost?).

or something like that.

Any advice on how to set this up properly?

Thanks in advance,
- Bob Fuhrer

Hi Bob

if email is being delivered to dovecot for the current single user and the same should be done for the other users, I would just list them as local recipients. You could just add an additional map file to local_recipient_maps listing these users. You could even drop the unix:passwd.byname lookup if you also list your existing user in that map. What type of user database you are using in Dovecot?

John

_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


_______________________________________________
Postfix-users mailing list --postfix-users@postfix.org
To unsubscribe send an email topostfix-users-le...@postfix.org
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to