Quantcast

connection results

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

connection results

Richard Pickett-2
My boss wants me to write a plugin that will capture the send results from the remote server when email is delivered or instantly bounced.

Messages like:

550-5.1.1 The email account that you tried to reach does not exist. Please try\n550-5.1.1 double-checking the recipient's email address for typos or\n550-5.1.1 unnecessary spaces. Learn more at\n550 5.1.1  https://support.google.com/mail/?p=NoSuchUser c5si1104380pfh.293 - gsmtp

I need to capture them along with the message ID and put them in a mysql database.

I've looked around, but don't see a "how to write a postfix plugin"

Can someone point me in the right direction?

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: connection results

Noel Jones-2
On 5/9/2017 9:15 PM, Richard Pickett wrote:

> My boss wants me to write a plugin that will capture the send
> results from the remote server when email is delivered or instantly
> bounced.
>
> Messages like:
>
>     550-5.1.1 The email account that you tried to reach does not
>     exist. Please try\n550-5.1.1 double-checking the recipient's
>     email address for typos or\n550-5.1.1 unnecessary spaces. Learn
>     more at\n550 5.1.1
>      https://support.google.com/mail/?p=NoSuchUser
>     c5si1104380pfh.293 - gsmtp
>
>
> I need to capture them along with the message ID and put them in a
> mysql database.
>
> I've looked around, but don't see a "how to write a postfix plugin"
>
> Can someone point me in the right direction?
>
> Thanks!


Postfix doesn't have a plugin framework for capturing delivery status.

Use a log scraper instead of trying to write something into postfix.
 Even better, syslog can pipe output directly to a program that can
capture the interesting bits.  This will take you 1/10 the
development time, and won't break every time postfix is updated.


  -- Noel Jones
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: connection results

Viktor Dukhovni
In reply to this post by Richard Pickett-2

> On May 9, 2017, at 10:15 PM, Richard Pickett <[hidden email]> wrote:
>
> My boss wants me to write a plugin that will capture the send results from the remote server when email is delivered or instantly bounced.
>
> Can someone point me in the right direction?


If log parsing is not sufficient, you can enable delegation of DSN notices
to remote downstream systems in the outbound Postfix server.  That way, all
delivery success/failure notices will be generated at the point where mail
leaves your domain and is accepted or reject by a remote domain.

        smtp_discard_ehlo_keywords = silent-discard, dsn

See DSN_README.

--
        Viktor.

Loading...