News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Sending mail from forum by SMTP - does it just not work at all?

Started by outdoors-stuff, June 22, 2017, 05:09:16 PM

Previous topic - Next topic

outdoors-stuff

Hi, and apols for yet another post about emails failing, but I've not found the answer in other posts.

I've been having hassles with sending emails from the forum for about 6months now. (We're running 2.0.14 on php 5.4.45). Up til now I'd believed this was down to a highly frustrating problem with our host having issues with email blacklisting after someone else on a shared server got hacked. Although that issue is still not 100% resolved I no longer believe this is the main cause of our forum email hassles.

We were asked to switch phpmail to SMTP as apparently sending via phpmail can get emails blacklisted. Seemed sensible in the circumstances, but no attempt at getting SMTP working has produced any forum notifications since. (With several different email addresses - including a couple of gmail ones (yes I did try the SSL:// trick and no, that didn't solve it...

Other email addresses (ie not gmail) either just didn't generate an email for any notification, or they sat in the mail queue never sending.

So, does SMTP simply not work? Or just not work with gmail? (which seems about the only viable option to server hosted email?) That's not a rhetorical question, I could do with knowing!

Switching back to phpmail both I and some users now get notifications again. But not everyone and too many notifications are ending up in spam until whitelisted. (Which may cause a problem for some of our wider membership who may not be able to do whitelisting and will just abandon using the forum...)

Very little in the error logs other than a few "530 5.7.0 Must issue a STARTTLS command first. d4sm4484777wra.65 - gsmtp)." which  I presume was before I found a posting about gmail needing the SSL:// bit before the main [email protected] addy.

Has anyone any suggestions on how to get forum notifications working again and not being treated as spam? As I now do believe this is much more likely an SMF issue than a server blacklisting issue.

Apologies that got long - thanks in advance.

vbgamer45

Changes have to be made for gmail in order to work. There are a couple of topics on it. I do not recommend using gmail as your smtp host. As they have limits and could block your gmail account.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

outdoors-stuff

I found a few topics, but most seemed to be saying you had to put ssl:// in front of the actual email addy. Tried that and it didn't work for us.

Did I miss something? (There were a few topics I simply didn't understand enough of to start reading!)

outdoors-stuff

vbgamer, when you say changes - do you mean I have to mod the code myself - or is this something that is coming in a new version? If a mod I have to do myself, that's really not good, and may be beyond my skills... And really shouldn't be needed in this day and age!

But in case it's something I can do, please can you post link to the bit I need?

Or just that you have to add ssl:// in front of the email addy? As said, tried that and it didn't work for us :(
(May well be server blacklisting as well as SMF issues here... Very hard to tell, but ultimately between them they're killing our forum and something has to change...)

Shambles

As well as using "ssl://smtp.gmail.com", did you change the port to 465?

PS, the "ssl://" doesn't go in front of the email address, but the server address.

outdoors-stuff

Sorry my poor explanation there - yes - I used ssl://smtp.gmail.com as the server address.

And yes, pretty sure it was port 465. But jsut chucked (yet another) test message on the forum to see.

I fully expect it to just hang in the mail queue and not send...

outdoors-stuff

#6
Btw - thanks Shambles for a quick reply ;)

Attached 2 screen grabs. I assume the first means that only 4 folks appear to have signed up to receive notifications (out of the 12 that should have!) But that they wont get the notification as SMF isn't sending it?

The second appears in the log having changed back to SMTP, with gmail, with ssl:// in the server addy and port 465. They won't shift from there until I delete the mail queue by changing settings (based on previous tests!) :(

(Correction - still there after changing back to phpmail - must be the queue deletes itself when changing email addresses, not just from SMTP to phpmail...)

outdoors-stuff

OK This gets even weirder. One of those who I thought should have had notifications switched on, did indeed have notifications for that board.

But his email wasn't in the mail queue, and hasn't received notifications on previous attempts either.

We are noticing that users with btinternet addresses tend to be worst affected by this.

And I've also just spotted notifications from **this** forum are ending up in my spam.

Which is somewhat worrying for us being able to fix the problem of some of our users notifications ending up in spam on the now rare occasions we can get them to send at all (only via phpmail, which if I understand correctly is an automatic blacklist on some hosts?)

Shambles

You can check your domain's MX record blacklist here (in the "domain" box, enter "blacklist: xxxxx" and it will show if your domain (xxxxx) is blacklisted, and by whom)

Are there any mail-related errors in your admin error log, such as timeouts or socket failures?

outdoors-stuff

Just the message I posted a screenshot of. Which appeared rather general but was defo from the time I changed the mail settings.

Blacklisting - yes a thorny issue. This problem has been going on for about 6 months, and I had believed it was down to the failure of our host to get everyone on our shared server off multiple blacklists after a neighbour on the server was hacked in January. But he still has no real answer as to why we keep getting put back on them so long after the original event.

Even a move at his end to a fresh new server isn't sorting it :(

Up til now, I had been believing that all our forum notification issues were down to the blacklisting problems.

But surely using a gmail address gets around this? And surely SMTP should send to some folks, not just get stuck refusing to send to any, even if still (wrongly) blacklisted on some lists?

And right now I'm really not sure whether it's server woes, SMF woes or I suspect (most likely) a combo of both. But it's been an issue for too long to work around now and has to be sorted... :(

outdoors-stuff

Now that's very odd. A "DNS record not published" under that MX toolbox link. Does that mean we're finally clear of blacklists? :) Or that something else is awry :(

Or it could just mean I forgot to type blacklist: in front of our web address - doh!

But is it something to worry about? Something that could be causing our hassles?

Shambles

If you suspect a DNS issue, try this tool

https://www.whatsmydns.net/

Other than that I've no idea. I use gmail as my smtp relay and have no issues whatsoever.

outdoors-stuff

Tried that. All seems to propogates except one in the states (dallas). Guessing very vaguely (am out of comfort zone here!) that one failure and all the rest ok is probably down to that one server and nothing to worry about?

But we're on 3 blacklists currently. No surprises there... Sadly :(

outdoors-stuff

Just stepping back a few steps.

If we're using gmail, surely it shouldn't matter that domain based email is currently blacklisted? As gmail has it's own servers? So a red herring surely?

Shambles

Yep.

I was in the same boat last year as I "adopted" a former spammer's website's IP address when I moved host.

I wrote to the various establishments and got mitigation allowances which eventually cleared the black spot.

Didn't affect gmail though, as you say.

Gmail just works. Plain and simple.

Arantor

Where, exactly, did you get told it was blacklisted at the domain level?

outdoors-stuff

Quote from: Shambles on June 23, 2017, 11:38:59 AM
Gmail just works. Plain and simple.

I wish that were the case for us!

Several of our members simply aren't receiving notifications when I've set it to use phpmail with a gmail account. Those that are, find said notifications end up in spam.
If I try and use gmail with smtp, absolutely nothing happens and no members get notifications :( (But some mails get stuck permanantly in the mail queue.)

Not using gmail and trying to use website server-based email? Many of our members simply don't receive any emails of any sort (let alone notifications) from those email addresses as they've annoyingly (and nothing to do with us directly) found their way onto a blacklist after someone else on a shared server got hacked. (Arantor - this is where we got told it's blacklisted - it's the whole server that is, not just our domain - which wasn't the cause). Shambles - sounds like you had a similar issue there, only were able to get them cleared permanently? Our host has been trying with no success on the permanent clearing, but has worked really hard including moving servers at his end as a final resort...

I'm rather coming to the conclusion that notifications is simply bust... And that we've got a server-based-email issue of our own... But if anyone can fix our notifications issue with gmail, I'd really appreciate it!

Shambles

QuoteIf I try and use gmail with smtp, absolutely nothing happens..

There really should be entries in your error log when that happens. Do any errors get logged if you click the "Send Mail Queue Now" link?

Here's my setup:



Addendum: I had to ask my host to open port 465 through the firewall

Arantor

Quote from: Arantor on June 23, 2017, 11:54:00 AM
Where, exactly, did you get told it was blacklisted at the domain level?

I ask this so I can get some information on where your problem might actually be.

I should note, as a day job I manage systems that send literally millions of emails per week...

outdoors-stuff

Reply to shambles first:

Ta for your settings - other than reducing number of mails sent at a time, seems like what I've been trying.

Mail just sits in the mail queue - even if press send mail queue now.

An error in log attached:

Advertisement: