Re: [exim] Running a hook on successful delivery

Etusivu
Poista viesti
Vastaa
Lähettäjä: Bernd Jendrissek
Päiväys:  
Vastaanottaja: exim users
Kopio: W B Hacker
Aihe: Re: [exim] Running a hook on successful delivery

[Back to exim-users as I am subscribed]

W B Hacker wrote:
> Bernd Jendrissek wrote:
>> We use exim to accept our customers' outgoing mail, deliver it to a
>> driver=pipe transport that transmogrifies the message, and then
>> resubmit it for delivery. All of that works.
> If you object to using the ~/exim/mainlog output?
>
> As in:
>
> grep 'C="250' /var/log/exim/mainlog
>
> Providing, of course, you asked Exim to log that in the first place.
>
> See log_selector =

Yes, we have that in mainlog: log_selector = +sender_on_delivery
+smtp_confirmation

And yes, if I can't find an exim.conf way, I'll just run a regex in a
daemon.
> Otherwise, you could hang a file-write or SQL insert onto the transport.

That's exactly what I want to do. But I can't find a suitable point of
control. shadow_condition would have been my vector for exim.conf abuse
if it were useable for remote shadows...

Here's the relevant bit of our exim.conf:

smart_routing:
driver = manualroute
transport = remote_smtp
route_data = ${lookup pgsql{select * from
"priGetSmartHosts"('${quote_pgsql:$sender_address_domain}')}{${sg{$value}{\n}{:}}}}

dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more

begin transports

remote_smtp:
driver = smtp

And somehow I want to run 'select * from "priLogDelivery"($h_x-mailid:)'
when remote_smtp gets a 2xx response. Or even any response, as long as
my stored procedure gets to see the response code.

How do I do this? Your "Otherwise, you could" makes me think there IS a
way, just that I haven't RTFM enough. Any pointers please?
> Even send yourself an SMS for every successful delivery if it is that
> critical...
>
> Do let me know which phone company you use so I can buy shares...

No, we'll send ourselves an email. And then a meta-email. Seriously,
what I need to do is to populate a column in a database, which our web
app can use to tell whether a particular mail is in or out of the building.