Improve how Lucee sends mail when one or more addresses are invalid

Description

If mail is sent to a server (tested with Exchange server) with multiple "to" addresses that are all syntactically valid, but the mail server rejects one or more of the addresses as not being real accounts, no one on the "to" list receives the message.

This is documented here:
http://docs.oracle.com/javaee/6/api/javax/mail/SendFailedException.html#getValidUnsentAddresses%28%29

And an example of the exception from the mail logs is:

"ERROR","Thread-1413","02/02/2017","19:03:03","","mail;Invalid Addresses;
nested exception is:
class com.sun.mail.smtp.SMTPAddressFailedException: 550 5.1.1 <bademail@company.com>... User unknown
;Invalid Addresses;
nested exception is:
class com.sun.mail.smtp.SMTPAddressFailedException: 550 5.1.1 <bademail@company.com>... User unknown
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1141):1141
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:536):536
at lucee.runtime.net.smtp.SMTPSender.run(SMTPSender.java:61):61
"

According to the doc link above though, there is a method to retrieve the addresses in the message that WERE valid. Improve Lucee to retry sending the message to only the good addresses in the list. The original failure should still be logged.

relates to

Activity

Michael Offner 
10 March 2017 at 14:58

frontend see:

Michael Offner 
10 March 2017 at 14:53

this feature is disabled by default, but can be enabled as follows.

For the complete Server:

  • open the following file in Lucee 4.5 "lib/ext/lucee-server/context/lucee-server.xml" and the following in Lucee 5
    "lucee-server/context/lucee-server.xml"

  • add the the following attribute to the tag "mail" [send-partial="true"]

For a single web context:

  • make the same as above in the file "WEB-INF/lucee/lucee-web.xml.cfm"

After that restart Lucee.

If this is set and Lucee was able to send the mail to at least one recipient, no exeption is thrown and Lucee logs the information in the mail.log.

Michael Offner 
10 March 2017 at 13:52
(edited)

Michael Offner 
10 March 2017 at 09:54
(edited)

finally i was able to reproduce (not exact the same), took me 3 different mail servers to do so:

Fixed

Details

Assignee

Reporter

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Fix versions

Priority

Created 6 February 2017 at 19:37
Updated 14 May 2020 at 08:35
Resolved 10 March 2017 at 14:38