FYI, one thing a future mail-rearchitecture might consider supporting:
A better way of querying whether SMTP is working and the registration email
address is valid prior to creating the user being registered. It would
probably be a good idea to add the user and the user-document only after
successful SMTP delivery of the registration message. Or cleanup the created
user/document in a catch() on SMTP failure in
com.xpn.xwiki.XWiki.sendMessage().
Note bugs in current feedback and UI-flow on registration email errors:
http://jira.xwiki.org/jira/browse/XWIKI-3492
Two problems that arise when following options enabed:
    - Administration->Registration->Use email verification == yes
    - Administration->Registration->Check Active fields for user
    authentication==yes
 (1) /xwiki/bin/register/XWiki/Register allows registration of a user with
 an empty email field.
 After submission, a "dead" user is created with the name given by the user.
 That account will of course never be automatically validated given that no
 email went out. The user gets to figure out what's wrong by reading the
 stacktrace resulting from hitting "submit" with an empty email field:
 A problem occured while trying to process your request. Please contact the
 webmaster if this happens again.
 Detailed information:
 Error number 10006 in 10: Could not send mail to server smtp port 25 error
 code 553 (553 5.0.0 <>... User address required
 )
 com.xpn.xwiki.XWikiException: Error number 10006 in 10: Could not send mail
 to server smtp port 25 error code 553 (553 5.0.0 <>... User address required
 )
 at com.xpn.xwiki.XWiki.sendMessage(XWiki.java:3362)
 at com.xpn.xwiki.XWiki.sendMessage(XWiki.java:3392)
 at com.xpn.xwiki.XWiki.sendValidationEmail(XWiki.java:3306)
 at com.xpn.xwiki.XWiki.sendValidationEmail(XWiki.java:3271)
 at com.xpn.xwiki.XWiki.createUser(XWiki.java:3225)
 at com.xpn.xwiki.web.RegisterAction.action(RegisterAction.java:41)
 at ...
 (2) /xwiki/bin/register/XWiki/Register allows registration of a user with a
 bad or bogus email name, resulting in another backtrace:
 A problem occured while trying to process your request. Please contact the
 webmaster if this happens again.
 Detailed information:
 Error number 10006 in 10: Could not send mail to server smtp port 25 error
 code 550 (550 5.1.1 ... User unknown
 )
 com.xpn.xwiki.XWikiException: Error number 10006 in 10: Could not send mail
 to server smtp port 25 error code 550 (550 5.1.1 ... User unknown
 )
 at com.xpn.xwiki.XWiki.sendMessage(XWiki.java:3362)
 at com.xpn.xwiki.XWiki.sendMessage(XWiki.java:3392)
 at com.xpn.xwiki.XWiki.sendValidationEmail(XWiki.java:3306)
 at com.xpn.xwiki.XWiki.sendValidationEmail(XWiki.java:3271)
 at com.xpn.xwiki.XWiki.createUser(XWiki.java:3225)
 at com.xpn.xwiki.web.RegisterAction.action(RegisterAction.java:41)
 at ...
 In both cases, the creation of a XWiki.username document and associated
 XWiki.XWikiAllGroup entry shoudn't occur until after successful send of the
 registration email. Also, some common validation rules for email fields
 should be applied to the registration page's email field when "Use email
 verification==yes" && "Check Active fields for user
authentication==yes".
 
-- Niels
http://nielsmayer.com