• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 Email notifications filtered as SPAM in gmail! HELP

NeoCHI

Active member
#1
I've recently migrated my server to a new hosting company and now my email notifications don't work. Anyone have any ideas how to resolve this issue?
 

Mike

XenForo developer
Staff member
#2
Sending emails is the domain of the server itself -- at least if you use the standard email system which sends them through PHP. Your host should be able to provide guidance.

If they can't sort it, you can flip to use an external SMTP server.
 

NeoCHI

Active member
#3
Sending emails is the domain of the server itself -- at least if you use the standard email system which sends them through PHP. Your host should be able to provide guidance.

If they can't sort it, you can flip to use an external SMTP server.
This was their response:

Look like your forum app is not generating mails or its from address is different. I suggest to check with the application developer to find the root cause.

Anyway I can resolve this myself?
 

Mike

XenForo developer
Staff member
#4
Presumably they've identified something based on the "from address is different" comment, but they're not being clear on what it is -- or specifically, what restrictions they have in place.

You may need to look at using SMTP instead.
 

NeoCHI

Active member
#5
Presumably they've identified something based on the "from address is different" comment, but they're not being clear on what it is -- or specifically, what restrictions they have in place.

You may need to look at using SMTP instead.
They've just responded with:

I believe the issue is being caused by the SMTP_BLOCK feature of the CSF firewall.

When SMTP_BLOCK is enabled, the firewall prevents non-privileged users from sending mail via SMTP over TCP. This is enabled by default on our VPS's as an anti-spam measure, but we can disable it at your request.

To address the issue, you might be able to configure Xenforo to use the "PhpMail method" to send mail via the sendmail command-line interface.

Alternatively, we can probably address this without modifying Xenforo's configuration by disabling SMTP_TWEAK. Would you like me to do this now?

What should I have them do?
 

Mike

XenForo developer
Staff member
#6
Wait, so you're using SMTP already? (This is something you would have configured in XenForo yourself.)
 

Mike

XenForo developer
Staff member
#8
In that case, you're already using the method they recommend ("PhpMail method"). They should be able to look at the server logs to see why mail isn't being sent (or to confirm that it is).
 

NeoCHI

Active member
#9
In that case, you're already using the method they recommend ("PhpMail method"). They should be able to look at the server logs to see why mail isn't being sent (or to confirm that it is).
They've just replied:

Thank you for the update. When I go to this url in my web browser:
===
http://mysite.com/
===

and then click the "Register/Login" button, and then enter my email address, chosing "No, create an account now." and then clicking "Sign up", I am brought to a form, at which I enter the following information:
===
Name: Test-kh
email: mscherf@knownhost.com
Password: Zgqz73cACpF2uuwhPYkd959
Date of Birth: Jan 01 1988
Gender: unspecified
Currently playing: (left blank)
Time zone: (UTC-06:00) Central Time (US & Canada)
===

and clicked "Sign up".

A green check mark appeared where the verification box had been.

The confirmation email was generated, but bounced:
===
root@host [~]# grep 1XK6vF-0001Ya-JA /var/log/exim_mainlog
2014-08-20 09:31:34 1XK6vF-0001Ya-JA <= neochi@host.mysite.com U=neochi P=local S=3712 id=b9f40ce8c7ba3f85f589d6af66948adf441b4e8e@mysite.com T="App Invasion Account Confirmation Required" for mscherf@knownhost.com
2014-08-20 09:31:34 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1XK6vF-0001Ya-JA
2014-08-20 09:31:34 1XK6vF-0001Ya-JA SMTP connection outbound 1408545094 1XK6vF-0001Ya-JA mysite.com mscherf@knownhost.com
2014-08-20 09:31:34 1XK6vF-0001Ya-JA ** mscherf@knownhost.com R=lookuphost T=remote_smtp: SMTP error from remote mail server after RCPT TO:<mscherf@knownhost.com>: host relay.knownhost.com [67.222.0.2]: 550-Verification failed for <neochi@host.mysite.com>\n550-The mail server could not deliver mail to neochi@host.mysite.com. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.\n550 Sender verify failed
2014-08-20 09:31:34 cwd=/var/spool/exim 7 args: /usr/sbin/exim -t -oem -oi -f <> -E1XK6vF-0001Ya-JA
2014-08-20 09:31:34 1XK6vG-0001Yz-JN <= <> R=1XK6vF-0001Ya-JA U=mailnull P=local S=4925 T="Mail delivery failed: returning message to sender" for neochi@host.mysite.com
2014-08-20 09:31:35 1XK6vF-0001Ya-JA Completed
===

The recipient mailserver is attempting to use Sender Verification, which failed. The recipient mailserver was unable to send a message to address "neochi@host.mysite.com".

To test this, I have sent an incoming message to address "neochi@host.mysite.com". This test message bounced:
===
Return-path: <>
Envelope-to: mscherf@knownhost.com
Delivery-date: Wed, 20 Aug 2014 10:35:18 -0400
Received: from mailnull by core.knownhost.net with local (Exim 4.82)
id 1XK6ys-0003e6-6y
for mscherf@knownhost.com; Wed, 20 Aug 2014 10:35:18 -0400
X-Failed-Recipients: neochi@host.mysite.com
Auto-Submitted: auto-replied
From: Mail Delivery System <Mailer-Daemon@core.knownhost.net>
To: mscherf@knownhost.com
Subject: Mail delivery failed: returning message to sender
Message-Id: <E1XK6ys-0003e6-6y@core.knownhost.net>
Date: Wed, 20 Aug 2014 10:35:18 -0400

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

neochi@host.mysite.com
The mail server could not deliver mail to neochi@host.mysite.com. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.

------ This is a copy of the message, including all the headers. ------

Return-path: <mscherf@knownhost.com>
Received: from [24.73.185.86] (port=31183 helo=localhost.localdomain)
by core.knownhost.net with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128)
(Exim 4.82)
(envelope-from <mscherf@knownhost.com>)
id 1XK6ys-0003e0-42
for neochi@host.mysite.com; Wed, 20 Aug 2014 10:35:18 -0400
Message-ID: <53F4B225.6000109@knownhost.com>
Date: Wed, 20 Aug 2014 09:35:17 -0500
From: Marjorie Scherf <mscherf@knownhost.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0
MIME-Version: 1.0
To: neochi@host.mysite.com
Subject: Test
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

This message is a test. No response is necessary.
===

It doesn't appear to be a dns issue, since the mx record resolves fine:
===
$ dig mx host.mysite.com +short
0 host.mysite.com.
$ dig host.mysite.com. +short
67.222.158.202
===

It seems when the email account "neochi@host.mysite.com" is emailed directly, the server does not know how to direct the message. This is because it is not a normal email address. I recommend reconfiguring the script to use an email address within the domain as the sender address, so that recipient mailservers using sender verification will be able to accept the messages.
But within Xenforo I clearly have Default Email Address set to my email (valid). Any idea what's going on here. This is driving me nutts...
 
Last edited:

NeoCHI

Active member
#10
Something else that's weird is emails are shown to be sent (Message accepted) successfully to one of my emails in the Mail Delivery Reports in WHM but I'm not actually receiving them...
 

Mike

XenForo developer
Staff member
#11
Well, deliverability of emails to host.mysite.com would be their issue. It's a configuration in their system that appears to be rejecting emails, likely based on the envelope sender (which is ok but rather strict, especially as the values for this are set, by default, based on their server configuration).

That said, I'm guessing you don't have the -f parameter enabled in XF? Try enabling that. Make sure your default email address is set correctly as well.
 

NeoCHI

Active member
#12
Well, deliverability of emails to host.mysite.com would be their issue. It's a configuration in their system that appears to be rejecting emails, likely based on the envelope sender (which is ok but rather strict, especially as the values for this are set, by default, based on their server configuration).

That said, I'm guessing you don't have the -f parameter enabled in XF? Try enabling that. Make sure your default email address is set correctly as well.
Here's the latest from them:

Mail is being delivered to gmail and it looks like it's being directed to spam. I've set up an account with my personal address and received the notification:

# tail -10000 /var/log/exim_mainlog | grep matthew.c.cheatham@gmail.com
2014-08-20 11:29:08 1XK8l1-000602-V7 <= pad@host.guardiancrossforum.com U=pad P=local S=1136 id=24c905d9c18aafdfd6d9cd6afafc146a@puzzleanddragonsforum.com T="Account Activation at Puzzle & Dragons Forum" for matthew.c.cheatham@gmail.com
2014-08-20 11:29:08 1XK8l1-000602-V7 SMTP connection outbound 1408552148 1XK8l1-000602-V7 puzzleanddragonsforum.com matthew.c.cheatham@gmail.com
2014-08-20 11:29:08 1XK8l1-000602-V7 => matthew.c.cheatham@gmail.com R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [173.194.64.26] X=UNKNOWN:ECDHE-RSA-AES128-GCM-SHA256:128 C="250 2.0.0 OK 1408552148 d8si30117332oeo.68 - gsmtp"

I've verified you have SPF and DKIM email authentication records set up as well as rDNS for your hostname so I'm not positive as to why email is being delivered as spam. This could be due to the content of the message itself.
Anyone know why these messages would be sent as spam? When I open one of these notification emails it contains a Report phishing link...
 

NeoCHI

Active member
#13
Here's some more from my hosting service:

From address neochi@host.mysite.com doesn't look like a legitimate mail address. You need to change your web application settings and use a legitimate mail id as SMTP login to send mails. Please find an article about sending mail using SMTP froma PHP script below :

http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm

Your web application might have already implemented it, so it will be just changing few settings and putting in mail login details.
Is what they're saying accurate? What do I need to do? Why wasn't this an issue on my old server then?
 

NeoCHI

Active member
#14
So I've setup my email settings to use SMTP from an email account I created on my server and my SPF and Authentications look good now:

Received-SPF: pass (google.com: domain of admin@mydomain.com designates 67.222.158.146 as permitted sender) client-ip=67.222.158.146;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of admin@mydomain.com designates 67.222.158.146 as permitted sender) smtp.mail=admin@mydomain.com;
dkim=pass header.i=@mydomain.com

This finally got rid of the "Report phishing" link from my notification emails but their still getting filtered as spam in gmail...Please anyone know what's causing this?
 

NeoCHI

Active member
#15
I've thought about using Mandrill but looking at my servers Mail Delivery Reports I'm sending about 10k emails a day...making it quite expensive a month for me to use Mandrill.

PLEASE I NEED HELP!
 

Mike

XenForo developer
Staff member
#17
Email deliverability is a complex topic. There are a ton of variables, many of which aren't publicized. If you're having problems, you need to ensure that as many things are setup correctly (SPF, DKIM, reverse DNS) and that you have a good reputation for your IP -- the IP listed in the last message is in at least one spam block list.
 

NeoCHI

Active member
#19
Email deliverability is a complex topic. There are a ton of variables, many of which aren't publicized. If you're having problems, you need to ensure that as many things are setup correctly (SPF, DKIM, reverse DNS) and that you have a good reputation for your IP -- the IP listed in the last message is in at least one spam block list.
My SPF, DKIM and reverse DNS are all setup. It's just my IPs apparently have bad reputation from the server's previously owner. That's why I'm on that blacklist but I'm working on getting off it.

I have done everything in that guide.

I guess question now is how long does it take to build good reputation?
 

Biker

Well-known member
#20
This is one of the reasons why I've kicked everything Google to the curb. After years and years of receiving my server notices and log reports, Google changed something and they started getting rejected over a year ago. Even after using their supposed "automatic" form to clear things up (https://support.google.com/mail/contact/bulk_send_new?rd=1), my emails from the server continued to be rejected. I switched to Outlook and haven't had an issue since then.

I watch my mail logs like a hawk. There are still times when Google gets stupid and notices from the forum start getting rejected. I then spend a good 2-3 days fighting with them to fix things on their end so the emails go through.