Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Original summary: "It is observed that when invalid address is provided, smtp module does add watchdog but does not mentioned the invalid email address in watchdog entry."
Optional summary: "In cases with multiple addresses, the code will add a space in front of the second and subsequent addresses in the comma delimited string, causing the later portion of the SMTP module code to interpret this as an invalid address."
Comment | File | Size | Author |
---|---|---|---|
#23 | screen.jpg | 45.24 KB | mr.pomelov |
Comments
Comment #2
DamienMcKennaThe problem here is that the address value being used was blank, for some reason. In case the summary on the dbdog list page is being truncated, can you please paste in the details from the full watchdog message?
Comment #3
TuWebO CreditAttribution: TuWebO at Metadrop commentedHello,
Just watching this module and I realized that maybe the
smtp_send_queue_runner
function has wrong key values for one parameter of the watchdog function.I just created a patch for it, maybe it is what is causing this issue.
Comment #4
TuWebO CreditAttribution: TuWebO at Metadrop commentedHello,
I added the !error_message also as 3rd key and updated the patch, don't know if it is correct so reviews will be very welcome.
Comment #5
nidhi.badani CreditAttribution: nidhi.badani as a volunteer and at TATA Consultancy Services commentedWill be testing and sharing the results soon.
Comment #6
nidhi.badani CreditAttribution: nidhi.badani as a volunteer and at TATA Consultancy Services commentedComment #7
GeduR CreditAttribution: GeduR at Metadrop commentedI'm not sure if patch solves this issue as this code is for legacy reasons, but it fixes a php coding error. '@form" without quotes are considered defined vars despite the @ which hides the error
Comment #8
wundo CreditAttribution: wundo at Chuva Inc. for Chuva Inc. commentedComment #9
wundo CreditAttribution: wundo at Chuva Inc. for Chuva Inc. commentedComment #10
wundo CreditAttribution: wundo at Chuva Inc. for Chuva Inc. commentedComment #12
wundo CreditAttribution: wundo at Chuva Inc. for Chuva Inc. commentedComment #15
catalinvlad CreditAttribution: catalinvlad commentedI've also encountered this issue while sending some emails using webform module to multiple addresses. The problem is that webform is building a string with a space after the comma so when the string is exploded, the space makes the email invalid.
So calling the function $this->_get_components(' abc@yahoo.com') will return the array ['input' => ' abc@yahoo.com', 'name' => '', 'email' => ''] - email is empty and it's used in the next line $mailer->AddAddress($to_comp['email'], $to_comp['name'])
I've managed to fix the issue by trimming the email before is validated in the _get_components function.
Comment #16
jeromewiley CreditAttribution: jeromewiley commentedUsed the suggestion from @cvlad_tremend in comment 15 and it began sending to all multiple addresses again (initially was throwing SMTP errors).
Rolling patch.
Comment #17
jeromewiley CreditAttribution: jeromewiley commentedFind patch attached. Per Richard Eriksson (Acquia), it appears this was fixed in the SMTP module, but a subsequent security update came through and the change was reverted. Began seeing email failures on December 27, the day after the SMTP 7.x-1.6 security patch came out. First email in array will deliver fine (forms that only send to one email are thus unaffected.) Second and subsequent email addresses are all interpreted as invalid because of a leading space.
Comment #18
joelstein CreditAttribution: joelstein at On Fire Media commented@jeromewiley, since this issue is closed and can only be re-opened by maintainers, would you kindly report this in a new issue so we can track it there?
Comment #19
joelstein CreditAttribution: joelstein at On Fire Media commentedNevermind, I posted a follow-up issue at #2856373: Problem with multiple email addresses.
Comment #20
ogursoy CreditAttribution: ogursoy commentedI can confirm #15 is the issue for those using web forms & rules to send some custom emails. For emails, changing token [data:email-value] to [data:email-value-raw] fixed my problem.
Comment #21
dadderley CreditAttribution: dadderley as a volunteer and commentedThe issue as described in comment 15 seems to have reappeared.
Drupal core 7.67
SMTP Authentication Support 7.x-1.7
Webform 7.x-4.19
Webforms that send email to multiple addresses generate this error.
The mail does not get sent.
When I removed one of the email addresses so that the form only sends email to one address, the problem goes away. The email gets sent with no errors.
Comment #22
ivnish CreditAttribution: ivnish commented+1
I get this error on webform submit
Comment #23
mr.pomelov CreditAttribution: mr.pomelov as a volunteer commented+1
I also get the "Invalid address" error. I tried to disable additional addresses and delete them, leaving one-the error does not disappear. I tried using the regular and DEV version of the SMTP module.
Despite the error, the emails are sent to several mailboxes.
Drupal core 7.80
SMTP Authentication Support 7.x-1.7+21-dev
Webform 7.x-4.24