docusealco / docuseal

Open source DocuSign alternative. Create, fill, and sign digital documents ✍️
https://www.docuseal.co
GNU Affero General Public License v3.0
5.97k stars 410 forks source link

React to email sending errors #76

Closed max-tet closed 11 months ago

max-tet commented 1 year ago

Hi and thanks for a great and useful app! I just encountered the following problem.

If an email cannot be sent because of faulty SMTP settings, the application reacts as if it was sent and no error is shown. Only the log contains an error like:

E, [2023-08-08T17:14:46.427469 #1] ERROR -- : [ActiveJob] [ActionMailer::MailDeliveryJob] [2757984d-9d45-4fa2-9da0-d971a8a33716] Error performing ActionMailer::MailDeliveryJob (Job ID: 2757984d-9d45-4fa2-9da0-d971a8a33716) from Async(default) in 53.07ms: Net::SMTPUnknownError (* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS LOGINDISABLED] Dovecot ready.

If such an error is encountered, at least the application should not lie to the user by saying, the mail was sent. Instead, an error message should promt the user to double-check the SMTP settings.

Also, on the SMTP settings screen, there should be a way to test the settings. This would attempt to establish a connection to the server using the given variables and report the results.

AlexandrToorchyn commented 1 year ago

@max-tet In the latest release (1.1.2), I added more options for configuring SMTP. Maybe now you can solve your issue. Let me know if this works for you.

max-tet commented 1 year ago

Unfortunately not. However, there is now another error message in the log.

E, [2023-08-11T06:16:24.479213 #1] ERROR -- : [ActiveJob] [ActionMailer::MailDeliveryJob] [160c5b48-b5f4-444d-8059-c3f32c7a2f5a] Error performing ActionMailer::MailDeliveryJob (Job ID: 160c5b48-b5f4-444d-8059-c3f32c7a2f5a) from Async(default) in 39.16ms: OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 peeraddr=83.149.68.26:143 state=error: wrong version number)

I don't know much about SMTP security, but I am missing the STARTTLS option that other email clients offer. I have configured Thunderbird with STARTTLS and "normal password" as an authentication method. How does that map to the settings in DocuSeal?

In any case, I believe a better user feedback for failed emails is still a crucial feature. And a connection test method as well.

AlexandrToorchyn commented 1 year ago

Unfortunately not. However, there is now another error message in the log.

E, [2023-08-11T06:16:24.479213 #1] ERROR -- : [ActiveJob] [ActionMailer::MailDeliveryJob] [160c5b48-b5f4-444d-8059-c3f32c7a2f5a] Error performing ActionMailer::MailDeliveryJob (Job ID: 160c5b48-b5f4-444d-8059-c3f32c7a2f5a) from Async(default) in 39.16ms: OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 peeraddr=83.149.68.26:143 state=error: wrong version number)

I don't know much about SMTP security, but I am missing the STARTTLS option that other email clients offer. I have configured Thunderbird with STARTTLS and "normal password" as an authentication method. How does that map to the settings in DocuSeal?

In any case, I believe a better user feedback for failed emails is still a crucial feature. And a connection test method as well.

Did you use UI or environment variables to configure the SMTP?

max-tet commented 1 year ago

I used the UI.

AlexandrToorchyn commented 11 months ago

@max-tet now errors messages are displayed when configuring SMTP via the settings form. Also there is a test email sent via SMTP once the configurations are saved. This should make it easier to configure and debug emails sending.