I have configured the SMTP module to use AWS Simple Email Service. Sending the SMTP module test email works. As does every other email service from the web site including new user notifications, password resets, Core Contact Form, etc.

Webform email sending fails with the following error (debugging enabled on SMTP module)

...
SMTP -> get_lines(): $str is "334 [REDACTED] " 
SMTP -> get_lines(): $data is "334 [REDACTED] " 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "334 [REDACTED] " 
SMTP -> get_lines(): $data is "334 [REDACTED] " 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "235 Authentication successful. " 
SMTP -> get_lines(): $data is "235 Authentication successful. " 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "250 Ok " 
SMTP -> get_lines(): $data is "250 Ok " 
SMTP -> FROM SERVER:250 Ok 
...
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "354 End data with . " 
SMTP -> get_lines(): $data is "354 End data with . " 
SMTP -> FROM SERVER:354 End data with . 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "554 Transaction failed: Missing '<' " 
SMTP -> get_lines(): $data is "554 Transaction failed: Missing '<' " 
SMTP -> FROM SERVER:554 Transaction failed: Missing '<' 
SMTP -> ERROR: DATA not accepted from server: 554 Transaction failed: Missing '<' 
SMTP Error: Data not accepted. Redirecting to http://mysite.local/form/...

I tried every combination of enabling and disabling HTML Emails in the SMTP settings as well as the webform email settings.

I tried creating new webforms, and using the built-in contact webform.

I tried other SMTP servers, and webform emails send just fine. For some reason AWS SES is more picky?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Shawn DeArmond created an issue. See original summary.

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)

Is there any chance you could export and upload an example of a broken webform?

This would help us figure what is wrong with the generated email header.

jrockowitz’s picture

#2937764: Decode Html entities in mail headers might be a related issue. Maybe you can test the patch associated with that ticket.

Shawn DeArmond’s picture

Status: Postponed (maintainer needs more info) » Active

Here's the webform export:

company_name:
  '#type': textfield
  '#title': 'Company Name'
  '#required': true
contact_information:
  '#type': custom_composite
  '#title': 'Contact Information'
  '#multiple': 4
  '#description': 'Enter at least one contact person so we can get in touch with you.'
  '#element':
    name:
      '#type': textfield
      '#title': Name
    email:
      '#type': email
      '#title': Email
    phone:
      '#type': tel
      '#title': Phone
sponsorship_level:
  '#type': radios
  '#title': 'Sponsorship Level'
  '#help': 'See level descriptions on the <a href="/sponsor-uccsc">Sponsorship</a> page.'
  '#options':
    platinum: Platinum
    gold: Gold
    silver: Silver
    bronze: Bronze
  '#required': true
logo:
  '#type': image_file
  '#title': Logo
  '#description': 'Upload an image file of your company logo to display on the web site and/or printed materials. A vector-format file, such as pdf, svg, or ai, is preferred.'
  '#max_filesize': '2'
  '#file_extensions': 'gif jpg png svg ai pdf'
company_web_site:
  '#type': webform_link
  '#title': 'Company Web Site'
  '#title__access': false
  '#url__title': URL
  '#url__required': true
  '#required': true

Unfortunately, #2937764: Decode Html entities in mail headers did not solve the problem for me.

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)

Please export and attach a webform that can be used to duplicate the problem. We need to be able to replicate the generated email header and hopefully, something will be obviously wrong with it.

Keep in mind that we can only guess at what the problem is because we don't have an AWS instance to debug this issue with.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
gooddev’s picture

@Shawn DeArmond did you find a Solution, i also have this issue with AWS SES and can't find any misconfiguration in webform. The testing-Mail from the SMTP-Modul is working.

Shawn DeArmond’s picture

Yes, I did find a solution. Basically, the SMTP module needed to have the default email address field filled out or else webforms wouldn't send email. Other systems send mail, but not webform. My solution was to simply fill out the default email address.

I still think it's a problem, but I do have a workaround.

jrockowitz’s picture

Status: Closed (cannot reproduce) » Active

@Shawn DeArmond Where does the default email address need to be filled out? The SMTP module or the Webform Module?

Shawn DeArmond’s picture

SMTP module.

But for all other Drupal functions, the default email address setting is optional. Only Webform throws errors if the default email address is not set.

jrockowitz’s picture

The default email address that we are talking about is here /admin/config/system/smtp


I am able to send email from the default Contact webform (/form/contact) via SMTP using Gmail without any default email address.

Have you tested default Contact webform?

Shawn DeArmond’s picture

I tested all Webforms, and they failed similarly. Note that I was using AWS SES, not Gmail, though. All other mail sending, including the Contact module, worked.

mr.baileys’s picture

I'm also able to consistently reproduce this with all mails sent from a webform using SMTP/Amazon SES. The From-header sent to Amazon SES is clearly malformed (GMail might be more lenient accepting malformed headers?).

I think this is a bug in the SMTP-module rather than webform though, and have opened #2984144: Malformed "From"-header when sending through Amazon SES via SMTP.

jrockowitz’s picture

Status: Active » Postponed

I marking this postponed in the hope that #2984144: Malformed "From"-header when sending through Amazon SES via SMTP will resolve this issue.

jrockowitz’s picture

Status: Postponed » Closed (duplicate)