Highlighted

cfmail (mail.jar) not logging all errors

Community Beginner ,
Apr 10, 2019

Copy link to clipboard

Copied

We've had this issue for a while apparently (now running v11u18) where emails won't get sent but they are also not always logged by CF. We have been using Java 1.8.0_144 since it came out and use a third-party SMTP server (our domain host). Pretty much all errors that do get logged simply say this in the log:

"Error","scheduler-2","04/09/19","14:08:40",,"com.sun.mail.smtp.SMTPSendFailedException: 250 Requested mail action okay, completed: id=0MFJUg-1h8QzQ2Nj2-00ERMH ;   nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 550-Requested action not taken: mailbox unavailable 550 invalid DNS MX or A/AAAA resource record "

Even though the actual error for that message according to what is returned via Outlook is:

503 Bad sequence of commands

One of our client's is BCC'd on every email from their site, but they are not getting messages sent to one of their customer's that does have an invalid email. However, there has been no indication of an issue in CF, but Outlook indeed returns:

Remote Server returned '550 5.1.10 RESOLVER.ADR.RecipientNotFound; Recipient not found by SMTP address lookup'

On CFAdmin under Mail Logging Settings,

I think that this issue has been reported since ColdFusion 6MX.  In the scenario we encountered, occassionaly ColdFusion would have an issue maintaining a connection with the remote SMTP server and simply drop without logging anything.  We realized this after a client complained that orders were being generated, but they weren't receiving emails.  We started logging before and after the CFMail calls and there was nothing we could do to proactively detect it and immediately attempt a resend.  (It'd be nice if CFMail returned an ID... like the name of the temporary spool file. If you connect directly, that takes more time and could return a success/fail status.)

Our workaround required us to install Microsoft SMTP server on the local IIS/ColdFusion webserver.  We now use LOCALHOST when sending and then the local, always-on mail server forwards the message to our remote mail server.  Since doing this, we haven't encountered any delivery issues.

In addition, when an email address is submitted via a web form, we test it using an isEmail JAR library that tests for the existence of a DNS & MX records.  I've had clients insist that their email was valid, but then marvel when they find out that their domain name lapsed or that no MX record was configured.  I shared this approach to validation on the ColdFusion Developer's Facebook page:

https://www.facebook.com/groups/CFprogrammers/permalink/10156205138290036/

https://stackoverflow.com/a/28746087/693068

https://code.google.com/archive/p/isemail/downloads

https://code.google.com/archive/p/isemail/downloads

Views

811

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

cfmail (mail.jar) not logging all errors

Community Beginner ,
Apr 10, 2019

Copy link to clipboard

Copied

We've had this issue for a while apparently (now running v11u18) where emails won't get sent but they are also not always logged by CF. We have been using Java 1.8.0_144 since it came out and use a third-party SMTP server (our domain host). Pretty much all errors that do get logged simply say this in the log:

"Error","scheduler-2","04/09/19","14:08:40",,"com.sun.mail.smtp.SMTPSendFailedException: 250 Requested mail action okay, completed: id=0MFJUg-1h8QzQ2Nj2-00ERMH ;   nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 550-Requested action not taken: mailbox unavailable 550 invalid DNS MX or A/AAAA resource record "

Even though the actual error for that message according to what is returned via Outlook is:

503 Bad sequence of commands

One of our client's is BCC'd on every email from their site, but they are not getting messages sent to one of their customer's that does have an invalid email. However, there has been no indication of an issue in CF, but Outlook indeed returns:

Remote Server returned '550 5.1.10 RESOLVER.ADR.RecipientNotFound; Recipient not found by SMTP address lookup'

On CFAdmin under Mail Logging Settings,

I think that this issue has been reported since ColdFusion 6MX.  In the scenario we encountered, occassionaly ColdFusion would have an issue maintaining a connection with the remote SMTP server and simply drop without logging anything.  We realized this after a client complained that orders were being generated, but they weren't receiving emails.  We started logging before and after the CFMail calls and there was nothing we could do to proactively detect it and immediately attempt a resend.  (It'd be nice if CFMail returned an ID... like the name of the temporary spool file. If you connect directly, that takes more time and could return a success/fail status.)

Our workaround required us to install Microsoft SMTP server on the local IIS/ColdFusion webserver.  We now use LOCALHOST when sending and then the local, always-on mail server forwards the message to our remote mail server.  Since doing this, we haven't encountered any delivery issues.

In addition, when an email address is submitted via a web form, we test it using an isEmail JAR library that tests for the existence of a DNS & MX records.  I've had clients insist that their email was valid, but then marvel when they find out that their domain name lapsed or that no MX record was configured.  I shared this approach to validation on the ColdFusion Developer's Facebook page:

https://www.facebook.com/groups/CFprogrammers/permalink/10156205138290036/

https://stackoverflow.com/a/28746087/693068

https://code.google.com/archive/p/isemail/downloads

https://code.google.com/archive/p/isemail/downloads

Views

812

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 10, 2019 0
Engaged ,
Apr 16, 2019

Copy link to clipboard

Copied

I think that this issue has been reported since ColdFusion 6MX.  In the scenario we encountered, occassionaly ColdFusion would have an issue maintaining a connection with the remote SMTP server and simply drop without logging anything.  We realized this after a client complained that orders were being generated, but they weren't receiving emails.  We started logging before and after the CFMail calls and there was nothing we could do to proactively detect it and immediately attempt a resend.  (It'd be nice if CFMail returned an ID... like the name of the temporary spool file. If you connect directly, that takes more time and could return a success/fail status.)

Our workaround required us to install Microsoft SMTP server on the local IIS/ColdFusion webserver.  We now use LOCALHOST when sending and then the local, always-on mail server forwards the message to our remote mail server.  Since doing this, we haven't encountered any delivery issues.

In addition, when an email address is submitted via a web form, we test it using an isEmail JAR library that tests for the existence of a DNS & MX records.  I've had clients insist that their email was valid, but then marvel when they find out that their domain name lapsed or that no MX record was configured.  I shared this approach to validation on the ColdFusion Developer's Facebook page:

https://www.facebook.com/groups/CFprogrammers/permalink/10156205138290036/

https://stackoverflow.com/a/28746087/693068

https://code.google.com/archive/p/isemail/downloads

https://code.google.com/archive/p/isemail/downloads

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 16, 2019 0
Engaged ,
Apr 16, 2019

Copy link to clipboard

Copied

In addition, whenever we send email to clients, we use our email address as the FAILTO email address.  This is done because we don't know if our remote email address is going to block third-party email addresses... especially since we aren't authorized to send email as them and the person may have mistyped their email address altogether.  In some cases, an email sent to my client has bounced due to staff changes and this approach allows us to intervene and report it instead of having this notification come from a new customer.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 16, 2019 0
Community Beginner ,
Apr 16, 2019

Copy link to clipboard

Copied

"Our workaround required us to install Microsoft SMTP server on the local IIS/ColdFusion webserver.  We now use LOCALHOST when sending and then the local, always-on mail server forwards the message to our remote mail server.  Since doing this, we haven't encountered any delivery issues."

Well, that is discouraging.

Every now and then (5 since 2018-01-01) we do get these errors so I would expect it to fail:

"Error","scheduler-1","03/28/19","11:26:25",,"com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.our_domain_host.com, 25; timeout 120000;  nested exception is: java.net.UnknownHostException: smtp.our_domain_host.com"

There is also a tiny number of 451 errors.

Anyway, thank you, Jamo, for the confirmation that this is a known issue.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 16, 2019 0
New Here ,
May 29, 2020

Copy link to clipboard

Copied

I would just like to take this opportunity to say thank you thank you thank you. Having investigated this for the last two weeks, I finally came across your post and this, indeed, solved  our problem in getting rid of the 

"com.sun.mail.smtp.SMTPSendFailedException: [EOF]" message that we sporadically received.

Hereby bestowing the title of "CF Magus" upon you and letting you know that I have abandoned the mapping of the nearest tallest buildings in my neighborhood.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2020 0