On Sun, Mar 17, 2024 at 3:40 PM Viktor Dukhovni via Postfix-users <postfix-users@postfix.org> wrote: > My general advice is to use aliases(5) very sparingly, just for lists > that require an "owner-" or ":include:" lists. All other rewrites > should be via virtual(5), and perhaps even keep $mydestination empty! > > Add "local.invalid local" to the transport(5) table, and rewrite > anything that needs local(8) delivery to mailbox@local.invalid. ... > > # just wanting to block email to a local user > > user1@mylocal.domain error:nouser 550 No such user here now or > > ever > > This is not a rewrite, and so goes into the transport(5) table (also > see error(8)). > > user1@mylocal.domain error:5.1.1 No such user here now or ever > > and/or an acess(5) table referenced in your recipient restrictions: ... > > # block all email to a specific user at a hosted domain > > user2@hosted1.domain error:nouser 550 Getting too much spam > > See above. ... > > # send all email for a hosted domain to some other email somewhere > > @somehosted3.domain someuser@someother.domain ... > Once you what virtual(5) does (rewrite an input envelope recipient > address to one or more recipient addresses), your questions are > answered. Similar advice for transport(5), (various) access(5), ... > tables.
I've read through the man pages for transport, access, and error and I do not see anything in any of them that would do anything that would take a receipient and reject it -- which is basically what all of the above comes down to. TRANSPORT seems to allow only a domain name without a user@ portion on the LHS. This doesn't seem to apply to my query. ACCESS seems to allow only a domain name or IP (again, without a user@) on the LHS. This doesn't seem to apply to my query. As for ERROR, ok... it's a delivery agent that will return an error code (e.g. to bounce the incoming message), but.. how do I get "user@some.domain" to be delivered to the "error" agent? My question in one, hopefully simple sentence, is: In Postfix, how do I configure Postfix such that all email to "user@some.domain" will return an error code (e.g. 550 user unknown) to bounce that email???? Glenn _______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org