G
gooogoo
I have a little script going to tell me why a email bounced.
i feel like Im taking the long road.
Heres what I do.
First I open the file and then do.
while (<FILE>){
if($_ =~ m/From\sMAILER\-DAEMON/){
$error1 = 'unknown';
}elsif($_ =~ m/said\:\s(.*?)\s/){
$status_code = $1;
}elsif($_ =~ m/Invalid\srecipient/){
$error1 = 'Invalid Receipient';
}elsif($_ =~ m/Mailbox\sunavailable/i){
$error1 = 'Mailbox Unavailable';
and so on and sooooo on. Ending up with a huge list of defined errors.
I first match MAILER DAEMON coz every bounce back starts with that, so its a
border to work with.
I guess to cut down on the elsif statements I would whack the regex searches
into an array.
Any helpful tips.
i feel like Im taking the long road.
Heres what I do.
First I open the file and then do.
while (<FILE>){
if($_ =~ m/From\sMAILER\-DAEMON/){
$error1 = 'unknown';
}elsif($_ =~ m/said\:\s(.*?)\s/){
$status_code = $1;
}elsif($_ =~ m/Invalid\srecipient/){
$error1 = 'Invalid Receipient';
}elsif($_ =~ m/Mailbox\sunavailable/i){
$error1 = 'Mailbox Unavailable';
and so on and sooooo on. Ending up with a huge list of defined errors.
I first match MAILER DAEMON coz every bounce back starts with that, so its a
border to work with.
I guess to cut down on the elsif statements I would whack the regex searches
into an array.
Any helpful tips.