How to autoreply with "Undelivered Mail Returned to Sender" unknown user for user+doesnotexist@domain.org

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to autoreply with "Undelivered Mail Returned to Sender" unknown user for user+doesnotexist@domain.org

Thomas Nyberg
Hello,

Let's say that I do have a user "user" on my system, but I would like
for emails sent to "[hidden email]" to bounce back the
"Undelivered mail" message with something like:

<[hidden email]>: unknown user: "user+doesnotexist"

How would I do this? I naively tried adding

user+doesnotexist: doesnoteixst

to my /etc/aliases file, but it was still delivered to my user account.

Thanks for any help.

Cheers,
Thomas
Reply | Threaded
Open this post in threaded view
|

Re: How to autoreply with "Undelivered Mail Returned to Sender" unknown user for user+doesnotexist@domain.org

Bill Cole-3
On 11 Jul 2018, at 10:41 (-0400), Thomas Nyberg wrote:

> Hello,
>
> Let's say that I do have a user "user" on my system, but I would like
> for emails sent to "[hidden email]" to bounce back the
> "Undelivered mail" message with something like:
>
> <[hidden email]>: unknown user: "user+doesnotexist"
>
> How would I do this? I naively tried adding
>
> user+doesnotexist: doesnoteixst
>
> to my /etc/aliases file, but it was still delivered to my user
> account.
>
> Thanks for any help.

Start by consulting the instructions sent to every new subscriber to
this list, specifically to read and follow these suggestions:

http://www.postfix.org/DEBUG_README.html#mail

How to make *YOUR* system reject a particular address that it is now
delivering depends on what it is about *YOUR* configuration that is
causing that delivery to happen in the first place.

--
Bill Cole
[hidden email] or [hidden email]
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Currently Seeking Steadier Work: https://linkedin.com/in/billcole
Reply | Threaded
Open this post in threaded view
|

Re: How to autoreply with "Undelivered Mail Returned to Sender" unknown user for user+doesnotexist@domain.org

Wietse Venema
In reply to this post by Thomas Nyberg
Thomas Nyberg:

> Hello,
>
> Let's say that I do have a user "user" on my system, but I would like
> for emails sent to "[hidden email]" to bounce back the
> "Undelivered mail" message with something like:
>
> <[hidden email]>: unknown user: "user+doesnotexist"
>
> How would I do this? I naively tried adding
>
> user+doesnotexist: doesnoteixst
>
> to my /etc/aliases file, but it was still delivered to my user account.

/etc/aliases is used only for mail handled by the local(8)
delivery agent.

Alternative: use a transport map; that works for all domains.

/etc/postfix/main.cf
    transport_maps = hash:/etc/postfix/transport

/etc/postfix/transport:
    [hidden email]  error:5.1.1 User does not receive mail.

Requires "postmap hash:/etc/postfix/transport".

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: How to autoreply with "Undelivered Mail Returned to Sender" unknown user for user+doesnotexist@domain.org

Thomas Nyberg
On 07/11/2018 08:03 AM, Wietse Venema wrote:

> Alternative: use a transport map; that works for all domains.
>
> /etc/postfix/main.cf
>      transport_maps = hash:/etc/postfix/transport
>
> /etc/postfix/transport:
>      [hidden email]  error:5.1.1 User does not receive mail.
>
> Requires "postmap hash:/etc/postfix/transport".
>
> Wietse

Thank you very much this worked perfectly!

Cheers,
Thomas