Hi John, I've already got that dovecot LDA config line in master.cf (it's how delivery for the one login user is set up), though without the "-f" flag. I guess the LDA is pulling the "from" address from the email headers.
I think the right thing for me to do is remove unix:passwd.byname from local_recipient_maps, and add instead a distinct hand-crafted map for all local users (login and non-login), so I don't pollute the map with extraneous system-related users. Populating the map from MySQL directly would be more robust, but I have just a handful of users, and they change very infrequently, so it seems simpler to manage the map manually. Also, I should empty the home_mailbox and mailbox_command settings (as you've done), and let the Dovecot LDA handle authentication and locating the user's Maildir. (I was confused about how home_mailbox was used; I thought it might have been passed by PostFix into the Dovecot LDA, but gee, I set that up years ago, and there's actually no flag on the Dovecot LDA to set the Maildir location anyway.) Thanks for the help! The mechanics seem much clearer to me now. All I have to do now is get the new arrangement working. ;-P - Bob > On Jul 7, 2024, at 6:29 PM, John Fawcett via Postfix-users > <postfix-users@postfix.org> wrote: > > 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> <mailto: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 >>>> <mailto: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 <mailto:myu...@mydomain.net> OK >>>> >>>> # virtual >>>> myu...@mydomain.net <mailto: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 <mailto: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 >>> <mailto:postfix-users@postfix.org> >>> To unsubscribe send an email to postfix-users-le...@postfix.org >>> <mailto:postfix-users-le...@postfix.org> >> >> >> >> _______________________________________________ >> Postfix-users mailing list -- postfix-users@postfix.org >> <mailto:postfix-users@postfix.org> >> To unsubscribe send an email to postfix-users-le...@postfix.org >> <mailto:postfix-users-le...@postfix.org> > _______________________________________________ > 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 to postfix-users-le...@postfix.org