Closed (fixed)
Project:
SMTP Authentication Support
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Feb 2020 at 23:01 UTC
Updated:
16 Oct 2022 at 11:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wellsComment #3
wellsComment #4
wellsOops, one additional fix needed to fully resolve this -- the setting of
$mailer->SMTPSecurewas using a comparison instead of assignment operator.Comment #5
morenstratThanks, fixes the problem, patch looks good, too.
Comment #6
arnoldbird commentedThe patch doesn't fix the issue for me. I applied this patch: smtp_error_could_not_authenticate-3114989-3.patch
In my status report, I still see "SMTP module is enabled, turned on, but SmtpConnect() threw exception SMTP Error: Could not authenticate."
I tried sending a test email with the SMTP module, just to see if the error is a false positive, but the email was not delivered.
Comment #7
morenstrat@arnolbird Sending a test e-mail worked for me even without the patch. Maybe you have a different problem? Have you double-checked that your credentials are correct?
Comment #8
wellsIndeed. The symptoms here are seeing this error when email delivery works.
Comment #9
rivimeyCan I suggest another change:
Change the lines that set SMTPSecure from:
to:
which is simpler, faster and doesn't exceed the code standard line length.
Comment #10
tiikeri commentedApplying the patch make the error gone away for me too.
Comment #11
klemendev commentedThe patch from comment #4 fixed the error in our case too and the module works properly.
Comment #12
wellsRe: #9 I agree that would be a good change. The related files have a number of coding standards issues so I figure that makes more sense to handle in a separate ticket. I was keeping my patch to just fixing the issue.
Comment #13
lisa.rae commentedMarking Needs Work per comments
Comment #14
wellsTo clarify the comments: the patch in #4 has been RTBC'd by #5, #10 and #11. Other comments are unrelated to the issue this patch fixes.
Reverting to RTBC.
Comment #15
jungleRefactored according to #9, which is good for me, avoid calling $this->configGet('smtp_protocol') twice, and setted the third parameter strict of in_array to TRUE. Meanwhile, fixed coding standard violations
Comment #16
jungleComment #18
jungleFix test
Comment #19
rmcom commentedsubscribing
Comment #20
lomale@bluewin.ch commentedHi I got this message as well
SMTP CONNECTION SMTP module is enabled, turned on, but SmtpConnect() threw exception SMTP Error: Could not authenticate.
Drupal 8.8.4 and SMTP Authentication Support 8.x-1.0-beta7
I asked my host provider. All the settings are correct.
And I can also send mails.
Does this have consequences??
In the meantime I was able to get a debug report.
I append it here.
Comment #21
jungleHi @lomale, applying the patch attached will get the error gone. it does not have serious consequence. Just only show you wrong error info on the status report page even it's correct, nothing more.
Comment #22
rmcom commentedThank you for fixing this!
It would be great to include it in the next release.
Comment #23
sagesolutions commented#18 patch works for me as well. Marking as RTBC
Comment #24
EktaPuri commentedPatch is not working for Drupal 8.8.3 version. Any help is appreciated
Comment #25
jungleRe:#24 The tests against 8.8.x passed, https://www.drupal.org/pift-ci-job/1617443 and one of my Drupal 8.8.3 instances with this patch appiled works as expected.
Comment #26
th.sigit commentedpatch in #18 seems working for me for one staging and one dev sites.
Module version 8.x-1.0-beta7 Drupal 8.8.3
Comment #27
destinationsound commentedPatch in #18 worked for me too. Thanks!
Comment #28
kris77 commentedPatch in #18 worked for me too. Thanks @jungle
Comment #29
publishing future commentedPatch in #18 did NOT solve the problem for me with Drupal 8.8.4. Still the same error message in SMTP module when sending a test email and in watchdog.
Comment #30
wells#29 — Please confirm, does the email actually send? This bug relates to getting that error message even though the email sends successfully (i.e. you will still get the error legitimately if there is an actual issue with your SMTP module config).
Comment #31
xdequinze#30 I confirm I still have the same problem with 8.8.4. Test email is sent successfully and the error appears on the status report (but no error in the log).
Comment #32
arnoldbird commentedIf you see an error like I saw in #6, it can be because of changes at Google (our SMTP provider). In my case, my colleague had to adjust the security settings in the Google account to get things working again. In other words, it was not a Drupal issue in my case.
Comment #33
publishing future commentedNo, emails are actually NOT sent. I double checked the credentials for authentication and they are correct.
Comment #34
wells#31 -- could you enable debugging in SMTP and send a log? Also, could you test with the patch from #3? I am still using that one and I have updated multiple sites to 8.8.4 with the patch and no issue.
#33 -- if mail is not sending, I recommend opening a separate issue with more details. This issue only covers the case of getting the error message even though mail send is working fine.
Comment #35
publishing future commentedFinally it turned out that an update on the mailserver caused the authentication problem. As this is fixed now, the patch also works for me.
Comment #36
r4arnys commentedI used #18's patch and it seems to have worked. (drupal 8.8.4)
Comment #37
lomale@bluewin.ch commentedHi I come back once more.
I still this message as well
SMTP CONNECTION SMTP module is enabled, turned on, but SmtpConnect() threw exception SMTP Error: Could not authenticate.
Drupal 8.8.4 and SMTP Authentication Support 8.x-1.0-beta7
I asked my host provider. All the settings are correct.
And I can also send mails.
Does this have consequences??
In the meantime I was able to get a debug report.
I append it here:
SMTP module is enabled, turned on, but SmtpConnect() threw exception SMTP-Fehler
Ein AJAX-HTTP-Fehler ist aufgetreten.
HTTP-Rückgabe-Code: 200
Im Folgenden finden Sie Debugging-Informationen.
Pfad: /de/batch?id=1583&op=do_nojs&op=do
Statustext: parsererror
Antworttext: SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "220 asmtp013.mail.hostpoint.ch ESMTP Exim 4.92.3 Thu, 26 Mar 2020 21:57:16 +0100
"
SMTP -> get_lines(): $data is "220 asmtp013.mail.hostpoint.ch ESMTP Exim 4.92.3 Thu, 26 Mar 2020 21:57:16 +0100
"
SMTP -> FROM SERVER:220 asmtp013.mail.hostpoint.ch ESMTP Exim 4.92.3 Thu, 26 Mar 2020 21:57:16 +0100
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
"
SMTP -> get_lines(): $data is "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
"
SMTP -> get_lines(): $data was "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
"
SMTP -> get_lines(): $str is "250-SIZE 52428800
"
SMTP -> get_lines(): $data is "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
"
SMTP -> get_lines(): $data was "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
"
SMTP -> get_lines(): $str is "250-8BITMIME
"
SMTP -> get_lines(): $data is "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
250-8BITMIME
"
SMTP -> get_lines(): $data was "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
250-8BITMIME
"
SMTP -> get_lines(): $str is "250-PIPELINING
"
SMTP -> get_lines(): $data is "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
"
SMTP -> get_lines(): $data was "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
"
SMTP -> get_lines(): $str is "250-AUTH PLAIN LOGIN
"
SMTP -> get_lines(): $data is "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
"
SMTP -> get_lines(): $data was "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
"
SMTP -> get_lines(): $str is "250-STARTTLS
"
SMTP -> get_lines(): $data is "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
"
SMTP -> get_lines(): $data was "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
"
SMTP -> get_lines(): $str is "250 HELP
"
SMTP -> get_lines(): $data is "250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
"
SMTP -> FROM SERVER: 250-asmtp013.mail.hostpoint.ch Hello s32.server.hostpoint.ch [2a00:d70:0:b::1:20]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6
"
SMTP -> get_lines(): $data is "334 VXNlcm5hbWU6
"
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6
"
SMTP -> get_lines(): $data is "334 UGFzc3dvcmQ6
"
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "235 Authentication succeeded
"
SMTP -> get_lines(): $data is "235 Authentication succeeded
"
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 "250 Accepted
"
SMTP -> get_lines(): $data is "250 Accepted
"
SMTP -> FROM SERVER:250 Accepted
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "354 Enter message, ending with "." on a line by itself
"
SMTP -> get_lines(): $data is "354 Enter message, ending with "." on a line by itself
"
SMTP -> FROM SERVER:354 Enter message, ending with "." on a line by itself
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250 OK id=1jHZZ2-000Fe3-7Y
"
SMTP -> get_lines(): $data is "250 OK id=1jHZZ2-000Fe3-7Y
"
SMTP -> FROM SERVER:250 OK id=1jHZZ2-000Fe3-7Y
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "221 asmtp013.mail.hostpoint.ch closing connection
"
SMTP -> get_lines(): $data is "221 asmtp013.mail.hostpoint.ch closing connection
"
SMTP -> FROM SERVER:221 asmtp013.mail.hostpoint.ch closing connection
{"status":true,"percentage":"3","message":"Sent 1 of 34 messages.","label":""}
I can send emails.
Can someone give me the exact code I have to write for a correct patch. i.e. #18 or is there a new one.
I'm not very familiar with Terminal commands.
will there be a module update soon.
Thanks Lothar
PS I tested on the Weekend. The mails get out, Functionality is given, but it's an nasty bug with the coming back Errormessage.
Comment #38
wells#37 -- That is indeed the bug this ticket relates to in beta7. The patch in #18 resolves the issue but has not been applied and committed yet so if you want to use it, you'll need to configure your Drupal instance to apply it. See Apply Drupal 8 Patch by Composer without update Drupal Core for a basic introduction to how to apply patches via Composer.
Comment #39
gobnat commentedWhen I try to apply the patch in #18 on my dev site I get the following error:
I have never had it before on composer updates or installs. Can anyone clarify why it would be happening?
Comment #40
rivimeyThe problem with composer is unrelated to the patch. You should modify your composer.json such that the version constraint on behat/mink is "~1.8", then rerun composer. I had a similar issue which seems to result from mink v1.7 no longer being available.
Comment #41
dqdRTBC from here.
Comment #42
promo-il commented#18 3114989-18.patch OK php7.1 D:8.8.5
Comment #43
dqd@ #37: Before adding tags read the issue tag guidelines. Do NOT use tags for adding random keywords or duplicating any other fields. Separate terms with a comma, not a space.
Comment #44
dqdPatches should usually be applied against latest dev to commit to HEAD. Lucky enough latest Beta seems to be the same than latest dev so we need no reroll.
Comment #45
dqd@#18 / #4 while I have confirmed the patches as RTBC already before, I strongly recommend NOT to add cosmetic changes in issues they do not belong to (I have seen some of them in the patches). And at least - IF - then please report them here for tracking them down later. Apart form that +1 for the fixes provided. Code looks good, patch applies on dev also and do not add any harm. Fixes the issue without drawbacks.
Comment #46
klemendev commentedI can confirm the patch works fine on 2 production sites too.
Comment #47
bkosborne+1, please let's get this in. Wasted an hour debugging this alarming status message even though everything is fine.
Comment #49
japerryYup, looks good to me too. Fixed!
Comment #50
dqd+1!
Comment #51
bkosborneThank you
Comment #52
klemendev commentedThanks! :)
Comment #53
lomale@bluewin.ch commentedUups it's me
With Drupal Version 8.8.4
i was happy that we had a Update.
SMTP Authentication Support 8.x-1.0-beta7
recommended Version:
8.x-1.0-rc1 (2020-May-08)
I installed it and NEW, I wasn't able to start the status report.
The website encountered an unexpected error, please try later.
i rolled back to beta 7 and the error dissappeared. I have no specific error log messages.
I could show it on 3 other local project's.
I also tried the newest Drupal Version 8.8.5 and both settings on other platforms. Same error.
Just for information.
Comment #54
lomale@bluewin.ch commentedComment #55
rmcom commented@lomale : it is likely due to the introduction of the PHPMailer library
see https://www.drupal.org/project/smtp/issues/3135015
Comment #56
japerryYup, RC2 should help you find your issue here. Which is likely due to missing the PHPMailer library. This issue itself should be fixed though.
Comment #57
lomale@bluewin.ch commentedYEP rc2 worked also for me.
It show's correctly : missing the PHPMailer library
Thanks
Comment #58
lomale@bluewin.ch commentedYes I made it to apply with
composer update drupal/smtp --with-dependencies
the phpmailer library
the error in status report that shows correctly Comment #57 has gone
i ad a picture SMTP Module.png where I found the PHP Mailer
under src in SMTP Module
The sending of the email works, but still an error message. I think nothing critical but anoying.
Error copy
Ein AJAX-HTTP-Fehler ist aufgetreten.
HTTP-Rückgabe-Code: 200
Im Folgenden finden Sie Debugging-Informationen.
Pfad: /de/batch?id=1712&op=do_nojs&op=do
Statustext: parsererror
Antworttext: 2020-05-15 19:41:47 Connection: opening to ssl://asmtp.mail.host***:465, timeout=30, options=array()
2020-05-15 19:41:47 Connection: opened
2020-05-15 19:41:47 SMTP INBOUND: "220 asmtp012.mail.hos*** ESMTP Exim 4.92.3 Fri, 15 May 2020 21:41:47 +0200"
2020-05-15 19:41:47 SERVER -> CLIENT: 220 asmtp012.mail.hos*** ESMTP Exim 4.92.3 Fri, 15 May 2020 21:41:47 +0200
2020-05-15 19:41:47 CLIENT -> SERVER: EHLO www.istdp.ch
2020-05-15 19:41:47 SMTP INBOUND: "250-asmtp012.mail.hostpoint.ch Hello s32.server.h*** [2a00:d70:0:b::1:20]"
2020-05-15 19:41:47 SMTP INBOUND: "250-SIZE 52428800"
2020-05-15 19:41:47 SMTP INBOUND: "250-8BITMIME"
2020-05-15 19:41:47 SMTP INBOUND: "250-PIPELINING"
2020-05-15 19:41:47 SMTP INBOUND: "250-AUTH PLAIN LOGIN"
2020-05-15 19:41:47 SMTP INBOUND: "250-STARTTLS"
2020-05-15 19:41:47 SMTP INBOUND: "250 HELP"
2020-05-15 19:41:47 SERVER -> CLIENT: 250-asmtp012.mail.host*** Hello s32.server.hostp*** [2a00:d70:0:b::1:20]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
2020-05-15 19:41:47 Auth method requested: UNSPECIFIED
2020-05-15 19:41:47 Auth methods available on the server: PLAIN,LOGIN
2020-05-15 19:41:47 Requested auth method not available:
2020-05-15 19:41:47 Auth method selected: LOGIN
2020-05-15 19:41:47 CLIENT -> SERVER: AUTH LOGIN
2020-05-15 19:41:47 SMTP INBOUND: "334 VXNlcm5hbWU6"
2020-05-15 19:41:47 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2020-05-15 19:41:47 CLIENT -> SERVER: c2VrcmV0YXJpYXRAaXN0ZHAuY2g=
2020-05-15 19:41:47 SMTP INBOUND: "334 UGFzc3dvcmQ6"
2020-05-15 19:41:47 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2020-05-15 19:41:47 CLIENT -> SERVER: RnFFM3ZGajhGYQ==
2020-05-15 19:41:47 SMTP INBOUND: "235 Authentication succeeded"
2020-05-15 19:41:47 SERVER -> CLIENT: 235 Authentication succeeded
2020-05-15 19:41:47 CLIENT -> SERVER: MAIL FROM:
2020-05-15 19:41:47 SMTP INBOUND: "250 OK"
2020-05-15 19:41:47 SERVER -> CLIENT: 250 OK
2020-05-15 19:41:47 CLIENT -> SERVER: RCPT TO:
2020-05-15 19:41:47 SMTP INBOUND: "250 Accepted"
2020-05-15 19:41:47 SERVER -> CLIENT: 250 Accepted
2020-05-15 19:41:47 CLIENT -> SERVER: DATA
2020-05-15 19:41:47 SMTP INBOUND: "354 Enter message, ending with "." on a line by itself"
2020-05-15 19:41:47 SERVER -> CLIENT: 354 Enter message, ending with "." on a line by itself
2020-05-15 19:41:47 CLIENT -> SERVER: Date: Fri, 15 May 2020 21:41:47 +0200
Comment #59
aiphesHi.
Face off this issue with 8.x-1.0-beta7 and D884.
Is it related to Drupal or/and module version ?
On other website with 8.x-1.0-rc1 + D885 : no message but messages doesn't send.
Test with D885 + rc2 : ?
The test message work in both cases but the D884 display the error message on status report:
SMTP module is enabled, turned on, but SmtpConnect() threw exception SMTP Error: Could not authenticate.So who say right ? Status report or test message ?
Comment #60
aiphesThe error disappear after update the module to rc2 + D886:
- Updating drupal/smtp (1.0.0-beta7 => 1.0.0-rc2): Downloading (100%)Comment #62
bendqh1 commentedCan someone help me here?
https://www.drupal.org/forum/support/post-installation/2022-10-15/unable...