Support Privianet via Postfix-users:
> Hi,
> 
> Some old domains still have their MX records pointing towards my server 
> but no more address. Their domain is not listed in relay_domains anymore.
> 
> When a server tries to send a message to a previously existing address, 
> it gets a 554 'Relay access denied' answer. I would like them get a more 
> friendly 550 let's say 'Sorry, this domain has no email service here'

This response comes from "reject_unauth_destination". You can add
a custom rule before that:

main.cf:
    smtpd_recipient_restrictions =
        ...exclusions for authorized clients etc...
        check_recipient_access inline:{
            { example.com = 550 Sorry, this domain has no email service here } }
        reject_unauth_destination
        ...DNSBL checks etc...

Don't forget to also update smtpd_relay_restrictions. The default
for recent Postfix versions is "permit_mynetworks,
permit_sasl_authenticated, defer_unauth_destination".  

You need to add that same check_recipient_access there:

main.cf:
    smtpd_relay_restrictions = 
        permit_mynetworks, 
        permit_sasl_authenticated, 
        check_recipient_access inline:{ 
            { example.com = 550 Sorry, this domain has no email service here } }
        defer_unauth_destination

If you have many such domains, you'd store them outside main.cf 
in a local file (hash, lmdb, texthash, etc.).

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

Reply via email to