MyBB Community Forums
[Pushed] SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+----- Forum: Pushed (https://community.mybb.com/forum-183.html)
+----- Thread: [Pushed] SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 (/thread-211585.html)



SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 - memeber1 - 2017-07-04

hey all,

As I am trying to set up a new SMTP server and  I've encoutered this weird problem where I can not authetificate.
I get this error message saying "The SMTP server does not support any of the AUTH methods that MyBB supports". Doesn't matter if I use ssl, tls or plain authetication, it just won't work.

So I poked around in the auth() function of smtp.php and I found out, that my SMTP server is returning these authentication methods DIGEST-MD5, CRAM-MD5 but the function is only checking for LOGIN or PLAIN methods. (see lines 357 and 381)

If I change these lines:

Quote:if(in_array("LOGIN", $auth_methods)) 

to:

Quote:if(in_array("DIGEST-MD5", $auth_methods))

,doesn't matter which line I change to DIGEST-MD5 or CRAM-MD5, the email gets sent.

Now that is cool that I can send emails by changing these values, but:

  1. I might won't be the only once facing this issue
  2. I am not sure, if the code bellow the "if" is the right way to use CRAM-MD5 or DIGEST-MD5
Thank you for the time devs! I think this issue should be solved in the next release, or just point me into the right direction Rolleyes .

Have a nice day!


RE: SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 - Euan T - 2017-07-06

May I ask what email server you're using? We try to cater to a fairly vast range, but there are a lot of different configurations out there that all behave slightly differently.


RE: SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 - memeber1 - 2017-07-06

I don't know its full specs but here you go: mail server is IceWarp and you might find these specs useful: https://www.icewarp.com/product/technical-specification/.

May I ask who is responsible for maintaining the mail handlers code in mybb?
Thank you!


RE: SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 - Euan T - 2017-07-06

(2017-07-06, 03:20 PM)memeber1 Wrote: I don't know its full specs but here you go: mail server is IceWarp and you might find these specs useful: https://www.icewarp.com/product/technical-specification/.

May I ask who is responsible for maintaining the mail handlers code in mybb?
Thank you!

Interesting, I've never heard of them before now.

It's a joint effort between staff and community members - all of the code is on GitHub here: https://github.com/mybb/mybb/blob/feature/inc/mailhandlers/smtp.php


RE: SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 - memeber1 - 2017-07-06

(2017-07-06, 04:37 PM)Euan T Wrote:
(2017-07-06, 03:20 PM)memeber1 Wrote: I don't know its full specs but here you go: mail server is IceWarp and you might find these specs useful: https://www.icewarp.com/product/technical-specification/.

May I ask who is responsible for maintaining the mail handlers code in mybb?
Thank you!

Interesting, I've never heard of them before now.

It's a joint effort between staff and community members - all of the code is on GitHub here: https://github.com/mybb/mybb/blob/feature/inc/mailhandlers/smtp.php


Well... there is always a first time.

In my humbe opinion, MyBB should use some more robost SMTP library, PHPMailer for example, or there should be another robust equivalent. My email server is returning the above mentioned AUTH options but on the other side the two, coded into MyBB smtp library, works as well. I've even tested in terminal, it works like charm but HEY, I'd like to use more secure option if there is one.

Don't know exactly yet how this problem is going to be solved on my side, butif so, I will try to make a pull request with the changes.


RE: SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 - Euan T - 2017-07-06

I've helped a couple of people patch in SwiftMailer, but unfortunately I doubt there's much chance that'll get into the core for 1.8.

2.0 is using SwiftMailer under the hood to handle mail attachments and more.


RE: SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 - fizz - 2017-07-07

(2017-07-06, 09:39 PM)Euan T Wrote: 2.0 is using SwiftMailer under the hood to handle mail attachments and more.

Laravel ftw!


@OP: I agree, there are definitely a lot of good free PHP mail wrappers out there but the issue is just integrating them with MyBB fully, as Euan said. You have to consider then that the licenses for any third-party libraries need to be respected and included, and MyBB itself will have to maintain an updated implementation of the library and include it with each new release since most board owners are likely not using any package management tools themselves. Maybe try to push the code up yourself and become the hero you were born to be Big Grin Big Grin

Also never heard of icewarp, but their SSL cert is invalid and the site forces the connection over HTTPS. Too lazy to add an exception so I'll check it out whenever they fix that.


RE: SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 - memeber1 - 2017-07-10

These pull request should resolve the issue


RE: SMTP authentication problem with DIGEST-MD5 or CRAM-MD5 - StefanT - 2017-07-11

Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/2798

Thanks for contributing to MyBB!

Regards,
The MyBB Group