Skip to main content
Participant
January 28, 2009
Question

cfmail "failto" not working with non-existent internal email addresses

  • January 28, 2009
  • 1 reply
  • 2276 views
We've hard-coded cfmail TO value in many places across many applications, i.e.
<cfmail to="user1@abc.com;user2@abc.com;user3@abc.com" ...>

Suppose when one of the users (user1,user2, user3) left company and his email address was removed from the MS Exchange server, cfmail would fail saying


A problem occurred when attempting to deliver mail.This exception was caused by: javax.mail.SendFailedException: Invalid Addresses; nested exception is: class javax.mail.SendFailedException: 550 5.1.1 User unknown


in the server exception log and cfmail wouldn't report the error to the email address of "failto".

So I'm wondering if it's possible to have cfmail ignore the bad one(s) and continue to send the email? Or is there anything I should do with the Exchange server?

Advice is much appreciated.
This topic has been closed for replies.

1 reply

Inspiring
January 28, 2009
That's not how it works. All cold fusion does is produce a mail file and put it into a spool directory. Then the mail server takes over.

To find out about non-existent email addresses, put a failto attribute in your cfmail tag. That address will receive the delivery failure report. Then, you may be able to use cfpop to detect it and do something about it.

To see for yourself, send yourself some mail but spell your name wrong.
gripholdAuthor
Participant
January 28, 2009
Thank you, Dan.

Sorry, what I meant by "non-existent" is not quite straightforward. Let me explain this way:

I observed the problem only occurred to emails of our company. For instance: our company's email address ends with @abc.com.
-----------------------------------------------------------
my email address: kpolo@abc.com
my previous colleague's address: john@abc.com (he's gone and the email is invalid / deactivated now)
my client's email: lemon@xyz.com (used to be valid)
-----------------------------------------------------------
If I code this way:
<cfmail to="lemon@xyz.com" failto="kpolo@abc.com"...>

"failto" does work and I got the email.

but if these:
<cfmail to="john@abc.com" failto="kpolo@abc.com"...>
<cfmail to="lemon@xyz.com;john@abc.com" failto="kpolo@abc.com"...>

I never got emails reporting the failure but error lines in the mail log and the exceptions log which read:
-----------------------------------
"Error","scheduler-3","01/28/09","11:55:32",,"Invalid Addresses"
-----------------------------------
"Error","scheduler-3","01/28/09","11:55:32",,"Invalid Addresses"
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 550 5.1.1 User unknown

at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
at coldfusion.mail.MailSpooler.deliver(MailSpooler.java:832)
at coldfusion.mail.MailSpooler.sendMail(MailSpooler.java:731)
at coldfusion.mail.MailSpooler.deliverStandard(MailSpooler.java:1021)
at coldfusion.mail.MailSpooler.run(MailSpooler.java:986)
at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:201)
at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.1.1 User unknown

at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
... 7 more
-----------------------------------------
Participant
June 19, 2009

Were you able to get this resolved? I'm having a similar issue with the failto attribute.