mail spooler retries emails with missing from address

Description

if an email ends up in the mail spool with a missing from address, lucee tries 5 times to send the email
despite the fact that it's never going to be sent, which apart from being pointless, it generates log spam

also acf throws an error when from is empty from the cfmail tag

the error message could be improved too

you have do define the from for the mail
lucee.runtime.exp.NativeException: you have do define the from for the mail
at lucee.runtime.net.smtp.SMTPClient.createMimeMessage(SMTPClient.java:445)
at lucee.runtime.net.smtp.SMTPClient._send(SMTPClient.java:808)
at lucee.runtime.spooler.mail.MailSpoolerTask.execute(MailSpoolerTask.java:120)
at lucee.runtime.spooler.SpoolerTaskSupport._execute(SpoolerTaskSupport.java:103)
at lucee.runtime.spooler.SpoolerEngineImpl.execute(SpoolerEngineImpl.java:601)

Lucee does throw an error if to is omitted, but there's a typo too
One of the following attribtues must be defined [to, cc, bcc]

acf also includes CFMAIL in the error message which helps debugging

https://trycf.com/gist/7c555f05571e21cc76bc88ca37b7f51c/lucee5?theme=monokai

Environment

None

Activity

Zac Spitzer 11 April 2019 at 13:41

pull request to improve error message
https://github.com/lucee/Lucee/pull/662

Zac Spitzer 12 February 2018 at 02:34

the attributes typo is here https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/lucee/runtime/tag/Mail.java#L524

"you have do define the from for the mail" could be written better, something like "mail requires a from address"
https://github.com/lucee/Lucee/blob/5.3/core/src/main/java/lucee/runtime/net/smtp/SMTPClient.java#L447

Ivan McAvinchey 3 January 2018 at 10:26

I noticed there is a spelling error in the error, attribtues should be attributes. Noticed this in my own error logs with the same error.

Pothys - MitrahSoft 10 October 2017 at 07:52

Hi ,

I've modified test case for this ticket & The following issues on cfmail tag.

  • If cfmail tag with empty 'from' address, Lucee doesn't throw any exception. But ACF throw debug output properly.

  • If 'from' address with colon means it will be fully dropped, In mail spool retries no from address.

  • If 'to' address with colon means it occurs issue like "One of the following attribtues must be defined (to, cc, bcc)".

  • If 'bcc' & 'cc' attributes with colon means it throw exception.

Pull Request : https://github.com/lucee/Lucee/pull/321

Fixed

Details

Assignee

Reporter

Priority

Fix versions

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

Created 6 October 2017 at 00:47
Updated 5 October 2020 at 02:07
Resolved 4 April 2018 at 15:53