OpenESignForms / openesignforms

Open eSignForms is the first open source SaaS web contracting platform
https://open.esignforms.com
107 stars 50 forks source link

External SMTP server question #164

Closed zosocanuck closed 8 years ago

zosocanuck commented 8 years ago

Hi,

I've deployed OpenESF in OpenShift, with an SMTP server being hosted by bluehost.com. I"m getting the following error:

2016-01-31 01:35:14,637 ERROR (OpenESignForms) Exception: Could not connect to SMTP host: xxx.bluehost.com, port: 465, response: -1 - SimpleEmailer() Could not get initial SMTP transport to: xxx.bluehost.com : 465; returnPath: support_xxx.com_h64zhqvrjs1flsr7ftia@support.xxx.com: javax.mail.MessagingException: Could not connect to SMTP host: xxx.bluehost.com, port: 465, response: -1 at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2042) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697) at javax.mail.Service.connect(Service.java:364) at javax.mail.Service.connect(Service.java:245) at javax.mail.Service.connect(Service.java:265) at com.esignforms.open.email.SimpleEmailer.getTransport(SimpleEmailer.java:140) at com.esignforms.open.email.SimpleEmailer.(SimpleEmailer.java:70) at com.esignforms.open.admin.OutboundEmailProcessor.sendAllQueuedEmail(OutboundEmailProcessor.java:94) at com.esignforms.open.admin.OutboundEmailProcessor.doEmailTasks(OutboundEmailProcessor.java:147) at com.esignforms.open.admin.OutboundEmailProcessor.run(OutboundEmailProcessor.java:162) at java.lang.Thread.run(Thread.java:745)

I've tested that email does work via a regular email client.

IQuant commented 8 years ago

Check your email settings under system config - deployment (Port - SSL - TLS checkboxes)

Below are the settings that work for gmail accounts to send mail.

SMTP Server: smtp.gmail.com SMTP Port: 587 SMTP Auth User: account@gmail.com SMTP Auth Password: xxx Use TLS: checked IMAP Server: imap.gmail.com IMAP Port: 993 IMAP User: account@gmail.com IMAP Password: xxx Use SSL: checked Default Email FROM: NOREPLYaccount@gmail.com SMTP Return Path Hostname: gmail.com

If your setup works using gmail the issue narrows down to the settings for bluehost.

zosocanuck commented 8 years ago

Ok, I've setup OpenESF with gmail however now getting the following errors:

534 5.7.14 https://support.google.com/mail/answer/78754 e34sm12474497qga.4 - gsmtp

I can verify that authentication works via the browser.

IQuant commented 8 years ago

Did you enable your gmail account for imap and smtp under gmail account settings. I would focus on debugging this issue first. Get generic gmail account to work and than expand to bluehost.

Never have had to alter any openesf settings to get gmal to work. Not sure about openshift but hear they are pretty solid.

OpenESignForms commented 8 years ago

The return-path is currently dynamically created by taking the IMAP user name and "normalizing" it so that any characters that are not a letter, digit, period, underbar or hyphen is converted to an underbar. Then we append an underbar and a random "bounce correlation code" and then append '@' and the configured return path server name from the system config view.

For outbound emails, your SMTP must allow the email to be sent with such a calculated return path, and then if a bounce or reply is sent to that return path, it ends up in your IMAP "inbox" so our application can read those emails and correlate them back to the transaction in question.

As we've not done this with gmail, we have no specific insights as to whether that's possible to do or not. It's certainly non-standard for a "user email account," but this email account is configured for automated sending/receiving and is not a general use email account.

OpenESignForms commented 8 years ago

We are closing this as the use of gmail is not specifically supported, and unless you can control inbound email (for IMAP retrieval) using a set of return-path email addresses that include a deployment prefix followed by a bounce correlation code, it's likely never going to work for handling bounces. And outbound (SMTP) is likely to have issues with a return-path that isn't just your flat email address. But if there's some fix to be be proposed, let us know and we can reopen and resolve.