Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to track message delivery status using com.day.cq.mailer.MessageGatewayService

Avatar

Community Advisor

Hi All

      So we have a scenario where few autogenerated mails are getting blocked by the end users server. So basically my question is , is there a way we can receive a delivery failure message from the server ? I am using MessageGatewayService to send mails from AEM .

TIA

Veena

1 Accepted Solution

Avatar

Correct answer by
Level 2

You can enable the debugging for emails by selecting the debug Email checkbox available in Day CQ Mail Service in config manager.

View solution in original post

3 Replies

Avatar

Level 4

Below you can see few common errors(Email and SMTP), but for troubleshooting your issue, you can set up a client to receive undelivered message using the account configured for sending those email. You can also activate debug email configure to better debugging.

Another thing that you can do, it could change the user/email user configured.

Finally, you can check if the email is not sent by CQMailing Service make sure AEM can reach smtp server(stmp info, port, etc), check also if the service works fine under VPN or not

--------------------------- ------

The simplest case is when you get a bounce: for instance, when the recipient's address is full (a soft bounce: just wait and re-send) or worst, when it's non-existent (a hard bounce: you need to remove the account from your list). In this case you simply receive an email from the incoming server – like the usual "Mailer-Daemon" or "Postmaster" alerts – informing you that the message has been discarded.

Email bounce

2. Malware attack.

What if you receive a "Mail Delivery Failure" notification for messages you did not send at all? It may well be that you've been under a malware attack: a virus is using your account to send spam emails – and that explains the origin of all the bounces you got.

The actual cause can be either a worm virus (run immediately your anti-virus) or the so-called spoofing: a spammer pretending to be you employing your address name. As it's quite difficult to avoid this kind of problem, you should consider to get an email authentication.

3. SMTP issues.

But that's more. A message can always be blocked by an antispam filter thus being unable to reach the recipient's inbox – even if it exists, it has plenty of space, and you have obeyed to all best practices of a newsletter campaign (an opt-in list, a perfectly crafted layout, no spammy words in the subject...). That may depend on your SMTP server: if the reputation of its sending IP is particularly low, or even put in a blacklist, the recipient can refuse to accept the message, which get rejected. And the worst detail is that you will know nothing of that.

Avatar

Community Advisor

Thanks for the details Diego. The issue which I am trying to solve is how to track it in com.day.cq.mailer.MessageGatewayService API. Is there a way we can get a response , if our mail is blocked by their server ? (I may sound stupid   ) I believe there is no way as of now where we can track a delivery status in emails send from AEM server . But if it is there I would like to know how to .

Avatar

Correct answer by
Level 2

You can enable the debugging for emails by selecting the debug Email checkbox available in Day CQ Mail Service in config manager.