Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformmajorhave not tried2018-05-11 13:292018-08-08 13:06
ReporteralostaleView Statuspublic 
Assigned Tojarmendariz 
PrioritynormalResolutionfixedFixed in Version3.0PR18Q4
StatusclosedFix in branchFixed in SCM revisioncf4416b527d9
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0038524: can't configure timeout for sending emails

DescriptionIt's not possible to configure any timeout for sending emails. In case the email server doesn't respond, it is possible to reach a situation where the thread sending the email is indefinitely stuck.
Steps To Reproduce1. Configure a very slow smtp server
    You can use, ie., a fake smpt server like dumbster [1]

    and add breakpoints to simulate slowness

2. Configure Client in Openbravo to make use of it
3. Open a completed Sales Order
4. Click on send email
  -> Check the threads gets stuck while the email server is not responding:
"ajp-bio-" daemon prio=10 tid=0x00007fd2800cf800 nid=0x1f7ff runnable [0x00007fd38befb000]
   java.lang.Thread.State: RUNNABLE
    at Method)
    - locked <0x00000001efd082a0> (a
    at com.sun.mail.util.LineInputStream.readLine(
    at com.sun.mail.smtp.SMTPTransport.readServerResponse(
    at com.sun.mail.smtp.SMTPTransport.openServer(
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(
    at javax.mail.Service.connect(
    - locked <0x00000001efd083f0> (a com.sun.mail.smtp.SMTPTransport)
    at javax.mail.Service.connect(
    at javax.mail.Service.connect(
    at org.openbravo.erpCommon.utility.poc.EmailManager.sendEmail(
    at org.openbravo.erpCommon.utility.reporting.printing.PrintController.sendDocumentEmail(

[1] [^]
Proposed Solution* Make it possible to configure email to include timeouts
* Although JavaMail supports up to 3 different timeouts (timeout, connectiontimeout, writetimeout), I think this shouldn't be exposed to end user, a single timeout field should configure (with the same value?) all of them.
* Note current 1.4.4 JavaMail version, released in 2011, only supports connectiontimeout. We might need to upgrade to latest version to do a better support. Attached patch is tested with current latest version (1.6.1) and I found no issues, using gmail as smtp server.
TagsNo tags attached.
Attached Filesdiff file icon 38524-WiP.diff [^] (1,214 bytes) 2018-05-11 13:31 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0038567 closedalostale Openbravo ERP can get stuck sending emails 
related to defect 0038934 newRetail Retail Modules Emails are no longer sent via POS 
related to feature request 0040622 newplatform Openbravo ERP Improve testing coverage on mail configuration 
causes defect 0039649 closedcaristu Openbravo ERP Cannot send mail using EmailEventManager 
causes defect 0040603 closedjarmendariz Openbravo ERP NPE sending email if timeout not set 

-  Notes
hgbot (developer)
2018-07-11 13:42

Repository: erp/devel/pi
Changeset: cf4416b527d97adba57b97484b66a33284101738
Author: Javier Armendáriz <javier.armendariz <at>>
Date: Mon Jun 25 09:27:44 2018 +0200
URL: [^]

Fixed issue 38524: Cannot configure timeout for sending emails.

In order to fully support timeout for emails the following has been done:
- Updated javax.mail to the latest version to date (1.6.1), which includes
along with socket read timeout, connection and write timeout.
- Added a Smtp server timeout field in Smtp Server configuration tab which
defines the timeout that will be used in seconds.
- Improved EmailManager API by including a cleaner implementation of sendMail

M legal/Licensing.txt
M src-db/database/model/tables/C_POC_CONFIGURATION.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src/org/openbravo/email/
M src/org/openbravo/erpCommon/ad_process/
M src/org/openbravo/erpCommon/utility/poc/
M src/org/openbravo/erpCommon/utility/reporting/printing/
A lib/runtime/javax.mail-1.6.1.jar
A src/org/openbravo/erpCommon/utility/poc/
R lib/runtime/mail-1.4.4.jar
hgbot (developer)
2018-07-11 13:43

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 7e3885eef8d0cae90beb0cb7dca2144213c5bf56
Author: Javier Armendáriz <javier.armendariz <at>>
Date: Wed Jul 11 10:54:21 2018 +0200
URL: [^]

Related to issue 38524: Can't configure timeout for sending emails.

sendMail method is marked as deprecated. This changeset adds a suppress warning
to the place that uses this method.

M src/org/openbravo/retail/posterminal/
jarmendariz (developer)
2018-07-11 17:29

Updated SMTP Server configuration wiki page: [^]
jarmendariz (developer)
2018-07-12 14:01

Created manual test case in test link: [^]
alostale (developer)
2018-07-13 11:42

reviewed + tested
hudsonbot (developer)
2018-08-08 13:06

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2018-05-11 13:29 alostale New Issue
2018-05-11 13:29 alostale Assigned To => platform
2018-05-11 13:29 alostale Modules => Core
2018-05-11 13:29 alostale Triggers an Emergency Pack => No
2018-05-11 13:31 alostale File Added: 38524-WiP.diff
2018-05-17 08:50 alostale Status new => acknowledged
2018-05-17 08:55 alostale Issue cloned 0038567
2018-05-17 08:55 alostale Relationship added related to 0038567
2018-05-17 16:06 alostale Steps to Reproduce Updated View Revisions
2018-06-21 16:26 jarmendariz Assigned To platform => jarmendariz
2018-06-28 12:01 jarmendariz Status acknowledged => scheduled
2018-07-11 10:52 jarmendariz Review Assigned To => alostale
2018-07-11 13:42 hgbot Checkin
2018-07-11 13:42 hgbot Note Added: 0105700
2018-07-11 13:42 hgbot Status scheduled => resolved
2018-07-11 13:42 hgbot Resolution open => fixed
2018-07-11 13:42 hgbot Fixed in SCM revision => [^]
2018-07-11 13:43 hgbot Checkin
2018-07-11 13:43 hgbot Note Added: 0105701
2018-07-11 17:29 jarmendariz Note Added: 0105703
2018-07-12 14:01 jarmendariz Relationship added related to 0038934
2018-07-12 14:01 jarmendariz Note Added: 0105715
2018-07-13 11:42 alostale Note Added: 0105737
2018-07-13 11:42 alostale Status resolved => closed
2018-07-13 11:42 alostale Fixed in Version => 3.0PR18Q4
2018-08-08 13:06 hudsonbot Checkin
2018-08-08 13:06 hudsonbot Note Added: 0106211
2018-11-20 09:35 aferraz Relationship added causes 0039649
2019-04-12 09:20 alostale Relationship added causes 0040603
2019-04-15 18:52 jarmendariz Relationship added related to 0040622

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker