-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.1.20 EE GA2, 7.0.0 M3
-
Fix Version/s: 6.1.X EE, 6.2.2 CE GA3 , 6.2.X EE, 7.0.0 M1
-
Component/s: Legacy Components, Legacy Components > API
-
Branch Version/s:6.2.x, 6.1.x
-
Backported to Branch:Committed
-
Git Pull Request:
In com.liferay.util.mail.MailEngine, the send method is capturing a javax.mail.SendFailedException and logging this exception.
The problem is that, the exception is not thrown, so, for a caller it is impossible to know if there was an error.
MailEngine.java
public static void send(InternetAddress from, InternetAddress[] to, InternetAddress[] cc,InternetAddress[] bcc, InternetAddress[] bulkAddresses,String subject, String body, boolean htmlFormat,InternetAddress[] replyTo, String messageId, String inReplyTo,List<FileAttachment> fileAttachments, SMTPAccount smtpAccount)throws MailEngineException { .... try { .... } catch (SendFailedException sfe) { _log.error(sfe); } catch (Exception e) { throw new MailEngineException(e); } if (_log.isDebugEnabled()) { _log.debug("Sending mail takes " + stopWatch.getTime() + " ms"); } }
It would be useful if the behaviour could be configurable via portal.properties and the exception could be thrown