[dev] Handling "550 User unknown" from imp/compose.php ???

Etienne Goyer etienne.goyer at linuxquebec.com
Mon Sep 29 13:18:48 PDT 2003


Hi fellows,

I noticed that compose.php barf a quite ugly error message when faced 
with a "550 User unknown" SMTP error code when sending mail :

There was an error sending your message: unable to add recipient
[sdfgsdfg at example.com]: Invalid response code received from server

I traced the root of this problem to the Net_SMTP PEAR module, from
where a PEAR_Error object is sent upstream all the way back to
compose.php.  I can see three way of fixing this :

1. Modify the Net_SMTP::rcptTo() function to return a meaningful error
message, maybe just the raw SMTP error message.  That way, smart user 
could deduce by the "user unknown" that may have made an error in the
recipient address.

2. Modify compose.php to print a more informative error message, maybe
something along the line of "An error occured sending this message; you
may want to check the recipient address."

3. A combination of both, where Net_SMTP sent the raw SMTP error
message, and we parse it compose looking for known error condition and
print error message accordingly; ie, print "Some recipient where
invalid" if the error message begin with "550".

Thought ?  Comments ?  I *know* my user *will* complain about it !

-- 
Etienne Goyer                    Linux Québec Technologies Inc.
http://www.LinuxQuebec.com       etienne.goyer at linuxquebec.com


More information about the dev mailing list