Hi Noel,

>> On Oct 30, 2017, at 6:42 PM, Noel Jones <njo...@megan.vbhcs.org> wrote:
>> 
>> On 10/30/2017 5:07 PM, J Doe wrote:
>> 
>> How do I stop backscatter generated from my server in response to the 
>> bounces from Gmail ?
> 
> This is a very difficult problem to solve.  Your choices are a)
> don't accept spam, or b) don't forward to gmail.
> 
> There may be information on the web about disabling bounces in
> postfix.  Those "solutions" that discard undeliverable mail are not
> supported and not recommended, and won't be addressed here.

Thank you for your reply.

Two things:

1. For anyone following this thread in the future, I thought I’d note that I’ve 
been doing some more reading and it turns out that my supposition in my 
previous message that I get blocking of messages to non-existent recipients 
with Postfix 2.0 and above is correct, but for a different reason than I 
thought.

I was reading more about “Rejecting Unknown Local Recipients with Postfix” [1] 
and I realized that this document is referring to e-mail to unknown recipients 
in the *local domains*.  It goes on to specify that those are domains that 
match $mydestination, IP addresses in $inet_interfaces or interfaces listed in 
$proxy_interfaces.

Because my server is configured to perform virtual domain hosting, I have the 
following:

   /etc/postfix/main.cf
       mydestination = localhost 

...but if a message is sent to a non-existent domain that I *virtually host* 
for:

    /etc/postfix/main.cf
        virtual_alias_domains = example.com
        virtual_alias_maps = hash:/etc/postfix/virtual

...it generates a NOQUEUE and terminates the SMTP conversation by default.  To 
catch mail that is addressed to non-existent recipients, I add the following to 
my virtual_alias_maps hash file:

    /etc/postfix/virtual

    @example.com ADDRESS_TO_SEND_TO

...where ADDRESS_TO_SEND_TO is the e-mail address to catch e-mails addressed to 
a non-existent domain.

2. Ok, I understand not wanting to talk about disabling bounce messages 
entirely, but I wondered if there was a more “nuanced” approach to that.

Is it possible to have conditional logic on SMTP error codes ?  Going through 
my logs I noticed that when Gmail detects that a message I forward to a Gmail 
recipient is missing DKIM information, it generates an SMTP error code of: 
500-5.7.1.  Can I then configure bounce messages based on the following:

    IF SMTP error code = 5.7.1
        AND remote server = GMail
            DON’T generate a bounce message (my server) 
    ELSE
        Generate bounce messages (my server)

Thanks,

- J

Sources:

[1] www.postfix.org/LOCAL_RECIPIENT_README.html

Reply via email to