OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: failed-delivery message notifications setup

From: mouss (mlist.onlyfree.fr)
Date: Wed Jan 16 2008 - 20:37:10 CST


Emanuil Tolev wrote:
> Hi,
>
> I've got the following setup on my postfix server - it hosts 2 domains,
> propertyxpress.com and sgrada.com .
> newspropertyxpress.com and other nonexistent mailboxes are sometimes
> used as sender and reply-to addresses when sending out newsletters to
> subscribed users. (I have catch-all accounts set up, so no replies by
> recipients of the newsletters are lost).

don't use nonexistent addresses. instead, use a valid sender. if mail
bounces, the bounce will be delivered to this user.

note that you can use a different address in the From header. for example:

# sendmail -f iwantbounceexample.com recipientdomain.example
...
From: ournewsletter <noreplyexample.com>
Reply-To: ournewsletter <helpexample.com>
...

so:
- bounces go to iwantbouncesexample.com
- people see ournewsletter ... as sender.
- people reply to helpexample.com
- the From address is for broken auto-responders and for MUAs that
"collect" addresses.

with 3 fields, you can do a lot of things, don't you?

>
> I'd like to know though when an email message bounces. I can see this in
> /var/log/maillog (bounce, softbounce, reject etc. status and the email
> address in question), but my boss hardly likes the idea of having to ssh
> in our dedicated server and grep the maillog just to see which addresses
> in our newsletter database are no longer valid. I see that when I send
> mail in google or my local mail service my ISP, if I try to send to a
> bogus address or make a mistake when spelling the recipient address, I
> get a "Mail Delivery Failed - Returning to Sender" message (or a similar
> one) in my inbox.
>
> How can I set postfix to send notifications about messages it failed to
> deliver, for one or another reason? I'd prefer to send them to a virtual
> mailbox account. I also did some research, but the sparse information I
> found could mean that I'm entirely wrong in my assumptions. That's why I
> ask my question at this point. You can read the next part to see what
> I've tried.
>
> -------------------------------------------------------------------
> As said, I did some research but all I could get was that postfix was
> using /etc/aliases to determine the postmaster: alias (postmaster: root
> in my case) and deliver the failed notices to that local UNIX-type
> account. My main.cf contains
> alias_maps = hash:/etc/aliases and
> virtual_alias_maps =
> proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf,
> mysql:/etc/postfix/mysql-virtual_email2email.cf
> (the mysql* files contain the correct settings for connection to the
> mysql database).
>
> Tried setting 'root: systemsgrada.com' in /etc/aliases, which is a
> valid virtual mailbox, but now it looks like it's just discarding all
> failure notifications (probably tries to interpret systemsgrada.com as
> a local UNIX account and of course fails to deliver the notice).
>
> I don't really like the idea of redirecting root's mail to a virtual
> mailbox, since he's only getting messages that MY server rejected (e.g.
> virus found), and is not getting any notifications whatsoever as far as
> I can tell. A more generic solution would be better suited, but I seem
> to be unable to find anything that documents how to accomplish such a
> complex feat as getting your failed mail notification where you want them.
> -------------------------------------------------------------------
>
> Any suggestion about how I could make postfix send the notifications
> about all
> returned/rejected/bounced/softbounced/deferred/killed/eaten/lost/drunk/drowned/looping/lazy
> mail to a virtual mailbox would be greatly appreciated!
>
> Greetings and thanks for the attention,
> Emanuil Tolev
>
>