Prev: slow mail delivering
Next: error message
From: Paul Cockings on 11 Sep 2009 16:29 Hi List - I send a mail to dsgf(a)gdshgf.ggg via my postfix server I get a an NDR back with the a 550 Host or domain name not found (in the body) - That works like normal Now I'd like to alter things; When I get an NDR I'd like to parse the header only to find who the message was oringally sent to and why it failed. I currently have X-Original-To: which works for the who, but not why I'd like to be add a custom header in the NDR to say x-mycustomheader: dsgf(a)gdshgf.ggg = 550 Host or domain name not found then I can parse the header for this key/pair, store (probably in a MySQL table) the who and why. I can dump the body (i don't need to waste resources reading the body) Hope this makes sense, kind regards
From: Ralf Hildebrandt on 11 Sep 2009 16:33 * Paul Cockings <paul(a)cytringan.co.uk>: > Hi List - > > I send a mail to dsgf(a)gdshgf.ggg via my postfix server > I get a an NDR back with the a 550 Host or domain name not found (in > the body) > - That works like normal > > Now I'd like to alter things; > > When I get an NDR I'd like to parse the header only to find who the > message was oringally sent to and why it failed. > > I currently have X-Original-To: which works for the who, but not why > I'd like to be add a custom header in the NDR to say > > x-mycustomheader: dsgf(a)gdshgf.ggg = 550 Host or domain name not found > > then I can parse the header for this key/pair, store (probably in a > MySQL table) the who and why. I can dump the body (i don't need to > waste resources reading the body) > > Hope this makes sense, kind regards Nope. Simply use VERP. -- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebrandt(a)charite.de | http://www.charite.de
From: Paul Cockings on 11 Sep 2009 16:36 Ralf Hildebrandt wrote: > * Paul Cockings <paul(a)cytringan.co.uk>: > >> Hi List - >> >> I send a mail to dsgf(a)gdshgf.ggg via my postfix server >> I get a an NDR back with the a 550 Host or domain name not found (in >> the body) >> - That works like normal >> >> Now I'd like to alter things; >> >> When I get an NDR I'd like to parse the header only to find who the >> message was oringally sent to and why it failed. >> >> I currently have X-Original-To: which works for the who, but not why >> I'd like to be add a custom header in the NDR to say >> >> x-mycustomheader: dsgf(a)gdshgf.ggg = 550 Host or domain name not found >> >> then I can parse the header for this key/pair, store (probably in a >> MySQL table) the who and why. I can dump the body (i don't need to >> waste resources reading the body) >> >> Hope this makes sense, kind regards >> > > Nope. Simply use VERP. > > That seems like a much better idea - Thanks!
From: Ralf Hildebrandt on 11 Sep 2009 16:41 * Paul Cockings <paul(a)cytringan.co.uk>: > That seems like a much better idea - Thanks! A bit of code sends mail to $1@$2: /usr/sbin/sendmail -N failure,success -f sender+$1+$2(a)charite.de $1@$2 <<EOF From: sender <sender+$1+$2(a)charite.de> To: $1@$2 Errors-To: sender+$1+$2(a)charite.de Return-Receipt-To: sender+$1+$2(a)charite.de Disposition-Notification-To: sender+$1+$2(a)charite.de Read-Receipt-To: sender+$1+$2(a)charite.de Registered-Mail-Reply-Requested-By: sender+$1+$2(a)charite.de Return-Receipt-Requested: sender+$1+$2(a)charite.de X-Confirm-Reading-To: sender+$1+$2(a)charite.de Subject: Test $1@$2 some text EOF -- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebrandt(a)charite.de | http://www.charite.de
From: Ralf Hildebrandt on 11 Sep 2009 16:44
* Ralf Hildebrandt <Ralf.Hildebrandt(a)charite.de>: > * Paul Cockings <paul(a)cytringan.co.uk>: > > > That seems like a much better idea - Thanks! > > A bit of code sends mail to $1@$2: > > /usr/sbin/sendmail -N failure,success -f sender+$1+$2(a)charite.de $1@$2 <<EOF > From: sender <sender+$1+$2(a)charite.de> > To: $1@$2 > Errors-To: sender+$1+$2(a)charite.de > Return-Receipt-To: sender+$1+$2(a)charite.de > Disposition-Notification-To: sender+$1+$2(a)charite.de > Read-Receipt-To: sender+$1+$2(a)charite.de > Registered-Mail-Reply-Requested-By: sender+$1+$2(a)charite.de > Return-Receipt-Requested: sender+$1+$2(a)charite.de > X-Confirm-Reading-To: sender+$1+$2(a)charite.de > Subject: Test $1@$2 You might want to remove Read-Receipt-To:, X-Confirm-Reading-To:, X-Confirm-Reading-To: :) -- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebrandt(a)charite.de | http://www.charite.de |