. */ // Returns for most of the functions: // - ok: message delivered // - delayed: this is a warning message only, no action required // - temporaly: message was not delivered, but might be delivered next time // - permanent: message was not delivered, changes have to be made // - unknown: from this data no status can be derived function getSMTPerror($a, $b, $c) { // Returns the error in text global $smtp_error; for($a=0; $a<=5; $a++) { if( isset($smtp_error[$a][$b][$c]) && strlen($smtp_error[$a][$b][$c])>0 ) return $smtp_error[$a][$b][$c]; } return "[unknown error]"; } function getSMTPerrorType($a, $b, $c) { // Check the type of the error code // return: [ok|temporaly|permanent|unknown] global $smtp_error; for($a=0; $a<=5; $a++) { if( isset($smtp_error[$a][$b][$c]) && strlen($smtp_error[$a][$b][$c])>0 ) { switch($a) { case 2: return "ok"; break; case 4: return "temporaly"; break; case 5: return "permanent"; break; } } } return "unknown"; } function getSMTPdiagcode($t) { // Check the severty of the diagnostic code // return: [ok|temporaly|permanent|unknown] if( preg_match("/Address rejected/i", $t) ) return "permanent"; if( preg_match("/Address '<.*?>' not known here/i", $t) ) return "permanent"; if( preg_match("/550-Callout verification failed/i", $t) ) return "permanent"; if( preg_match("/Host unknown/i", $t) ) return "permanent"; if( preg_match("/Invalid recipient/i", $t) ) return "permanent"; if( preg_match("/Is not a known user on this system/i", $t) ) return "permanent"; if( preg_match("/No such user/i", $t) ) return "permanent"; if( preg_match("/Not found/i", $t) ) return "permanent"; if( preg_match("/Over quota/i", $t) ) return "temporaly"; if( preg_match("/Recipient address rejected/i", $t) ) return "permanent"; if( preg_match("/Requested action not taken: mailbox unavailable/i", $t) ) return "permanent"; if( preg_match("/Sorry, no mailbox here by that name/i", $t) ) return "permanent"; if( preg_match("/The email account that you tried to reach does not exist./i", $t) ) return "permanent"; if( preg_match("/This account has been disabled or discontinued/i", $t) ) return "permanent"; if( preg_match("/This account is disabled/i", $t) ) return "permanent"; if( preg_match("/This user doesn't have a yahoo.com account/i", $t) ) return "permanent"; if( preg_match("/Unknown or illegal alias/i", $t) ) return "permanent"; if( preg_match("/Unknown user/i", $t) ) return "permanent"; if( preg_match("/User unknown/i", $t) ) return "permanent"; if( preg_match("/User has exhausted allowed storage space/i", $t) ) return "temporaly"; if( preg_match("/User has too many messages on the server/i", $t) ) return "temporaly"; return "unknown"; } function getSMTPaction($t) { // Check the severty of the action code // return: [ok|delayed|temporaly|permanent|unknown] if( preg_match("/delayed/i", $t) ) return "delayed"; return "unknown"; } /* 2.X.X Success Success specifies that the DSN is reporting a positive delivery action. Detail sub-codes may provide notification of transformations required for delivery. 4.X.X Persistent Transient Failure A persistent transient failure is one in which the message as sent is valid, but some temporary event prevents the successful sending of the message. Sending in the future may be successful. 5.X.X Permanent Failure A permanent failure is one which is not likely to be resolved by resending the message in the current form. Some change to the message or the destination must be made for successful delivery. */ $smtp_error=array(); $smtp_error[5][1][0]="Other address status"; $smtp_error[3][1][1]="General error"; $smtp_error[5][1][2]="Bad destination system address"; $smtp_error[5][1][3]="Bad destination mailbox address syntax"; $smtp_error[5][1][4]="Destination mailbox address ambiguous"; $smtp_error[2][1][5]="Destination mailbox address valid"; $smtp_error[5][1][6]="Mailbox has moved"; $smtp_error[5][1][7]="Bad sender's mailbox address syntax"; $smtp_error[5][1][8]="Bad sender's system address"; $smtp_error[4][2][0]="Other or undefined mailbox status"; $smtp_error[4][2][1]="Mailbox disabled, not accepting messages"; $smtp_error[4][2][2]="Mailbox full"; $smtp_error[4][2][3]="Message length exceeds administrative limit"; $smtp_error[4][2][4]="Mailing list expansion problem"; $smtp_error[4][3][0]="Other or undefined mail system status"; $smtp_error[4][3][1]="Mail system full"; $smtp_error[5][3][2]="System not accepting network messages"; $smtp_error[4][3][3]="System not capable of selected features"; $smtp_error[4][3][4]="Message too big for system"; $smtp_error[4][4][0]="Other or undefined network or routing status"; $smtp_error[4][4][1]="No answer from host"; $smtp_error[4][4][2]="Bad connection"; $smtp_error[4][4][3]="Routing server failure"; $smtp_error[4][4][4]="Unable to route"; $smtp_error[4][4][5]="Network congestion"; $smtp_error[4][4][6]="Routing loop detected"; $smtp_error[4][4][7]="Delivery time expired"; $smtp_error[5][5][0]="Other or undefined protocol status"; $smtp_error[5][5][1]="Invalid command"; $smtp_error[5][5][2]="Syntax error"; $smtp_error[5][5][3]="Too many recipients"; $smtp_error[5][5][4]="Invalid command arguments"; $smtp_error[5][5][5]="Wrong protocol version"; $smtp_error[4][6][0]="Other or undefined media error"; $smtp_error[4][6][1]="Media not supported"; $smtp_error[4][6][2]="Conversion required and prohibited"; $smtp_error[4][6][3]="Conversion required but not supported"; $smtp_error[2][6][4]="Conversion with loss performed"; $smtp_error[4][6][5]="Conversion failed"; $smtp_error[4][7][0]="Other or undefined security status"; $smtp_error[5][7][1]="Delivery not authorized, message refused"; $smtp_error[5][7][2]="Mailing list expansion prohibited"; $smtp_error[4][7][3]="Security conversion required but not possible"; $smtp_error[4][7][4]="Security features not supported"; $smtp_error[4][7][5]="Cryptographic failure"; $smtp_error[4][7][6]="Cryptographic algorithm not supported"; $smtp_error[4][7][7]="Message integrity failure"; ?>