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.
The amount of non-SSL smtp servers is shrinking fast, and I for one don't have access to any non-SSL smtp servers thus making my life very much impossible with the poor SSL support of the php mailer and related systems.
Maybe you could save the day and implement support for ssl smtp connections?
Comment | File | Size | Author |
---|---|---|---|
#3 | smtp47.patch | 659 bytes | EmanueleQuinto |
Comments
Comment #1
LukeLast CreditAttribution: LukeLast commentedThat sounds cool to me, do you know of any resources to start from?
Comment #2
LukeLast CreditAttribution: LukeLast commentedI would not be able to do this myself so unless someone can get the ball rolling I'll close the issue.
Comment #3
EmanueleQuinto CreditAttribution: EmanueleQuinto commentedNot only the amount of non-SSL smtp servers is shrinking fast, but GMail is asking SSL authentication (on port 465 currently) as stated in Configuring other mail clients.
So if someone is using Google Apps for Your Domain and need to use SMTP there is a possible solution.
First of all you have to check if ssl is enabled in your php configuration (look on php.ini or run phpinfo).
Then use attached patch. What it does?
Following a suggestion on phpmailer forum all that we need it's adding a protocol specification on fsockopen $host parameter. Instead of smtp.gmail.com we need to open ssl://smtp.gmail.com
So basically the patch change on SMTP
function Connect($host,$port=0,$tval=30)
to
Other small changes add parameter management (editing on drupal, adding on class definitions etc.).
Seems to work on drupal 4.7 (if someone is interested there is also a 4.6 patch).
Comment #4
danbh CreditAttribution: danbh commentedI got this error
warning: fgets() [function.fgets]: SSL: fatal protocol error in /var/www/drupal.hollocher.is-a-geek.com/modules/smtp/smtp.module on line 2775.
and the email did not send
Comment #5
danbh CreditAttribution: danbh commentedI'm sorry, the email did, in fact, send! I do get that warning, but the emails are being sent. Thanks.
Comment #6
EmanueleQuinto CreditAttribution: EmanueleQuinto commentedOn the forum post there is another step that I didn't include in the patch:
Anyway mail is sent.
I googled around to find another solution but I failed :-(
Comment #7
danbh CreditAttribution: danbh commented@ doesn't work.
I saw an error report for drupal somewhere mentioning that behavior in a different context. Maybe its a drupal bug.
Regardless, it looks like I will have to live with the error, which is fine.
Thanks!
Comment #8
nrasmus CreditAttribution: nrasmus commentedThis looks very promising--I do have a question though--if your php.ini has no mention of ssl, what do I do? Running php 4, do I need to recompile that?
Comment #9
nrasmus CreditAttribution: nrasmus commentedJust wanted to report something here--it took me almost 2 weeks (of not constant) effort to figure this out:
Depending on where you look, google tells you to use smtp on port 465 or on 587. Turns out that 465 is ssl (not sure what version), and 587 is TLS. FYI--if you have a stable version of php4 or php5, you probably will not get this to work with TLS of 587. With 465, the error danbh reports does show up in your log, but the mails get sent. I didn't dig far enough--but this has something to do with how php can use STARTTLS.
Comment #10
LukeLast CreditAttribution: LukeLast commentedThanks for all the great information.
HEAD has been updated to support SSL. It was working for me with gmail.
Comment #11
(not verified) CreditAttribution: commented