Koozali.org: home of the SME Server

Gmail directing all SME Server Emails to spam.

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Gmail directing all SME Server Emails to spam.
« on: May 17, 2023, 11:38:30 AM »
Hello,

Just curious if there have been any further developments in being able to make Google (gmail) accept emails from an SME Server instead sending them right to the spam folder?

Google's suggestion of adjusting SPF and DKIM records in the DNS don't work like they say they are supposed too.

Thanks.

Offline Jean-Philippe Pialasse

  • *
  • 2,763
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Gmail directing all SME Server Emails to spam.
« Reply #1 on: May 17, 2023, 12:55:53 PM »
have you disabled the test mode and enforced the rejection on both spf and dkim?

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #2 on: May 17, 2023, 09:30:39 PM »
Not 100% sure, all work I have done is in the DNS program none on the server does test mode need to be disabled in the Server?

Offline Jean-Philippe Pialasse

  • *
  • 2,763
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Gmail directing all SME Server Emails to spam.
« Reply #3 on: May 18, 2023, 04:04:30 AM »
you do not need to enable the inconing dkim filtering.  you just need to enable the  outgoing dkim signing and check that in your dns the dkim field has no t=y and dmarc field enforce dkim and spf rejection.

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #4 on: May 18, 2023, 09:29:05 AM »
Okay I looked over the SPF and DKIM records and I redid them because I choose Soft fail not Hard fail.... However I tried it again with the Hard fail settings and it didn't work emails from SME Server still go to spam in Gmail.

Here are the settings I used Can you guys see any problems?

SPF

"v=spf1 mx a include:_spf.mydomain.com ip4:ipaddress -all"

DKIM

the Host I used was "s._domainkey.mydomain.com"

the Text I used was

v=DKIM1;t=s;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDEiywEQT9CEIDRkDBA01VkM5+9mXLwIDCfUeGafAghwtQ99RKlfhRvttShV2Ml5bJz2A8TWMGNUPEs/B+TgFaR/eU0fOCeKxrFuzzL5kuQAR4tZdEKq8VjuSxUVTFjmTxbN5hZ5i+vYxq4J5dJffhvatDXut6cjAZe2f9f226udQIDAQAB


Offline mmccarn

  • *
  • 2,627
  • +10/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #5 on: May 18, 2023, 01:35:41 PM »
Does your SPF validate correctly?
https://kitterman.com/spf/validate.html

Does your DKIM validate correctly?
https://mxtoolbox.com/dkim.aspx


Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #6 on: May 18, 2023, 10:30:32 PM »
Okay so looks like the DKIM record checks out there is no errors just check marks.... However it looks like the SPF record is not correct because I got this error below

Input accepted, querying now...
evaluating v=spf1 mx a include:_spf.domain.com ip4:ipaddress -all ...
Results - PermError SPF Permanent Error: No valid SPF record for included domain: _spf.domain.com: include:_spf.domain.com

I used a program from my domain provider to make a new SPF record so not sure what I did incorrect here....

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #7 on: May 19, 2023, 05:56:34 AM »
Quote
v=spf1 mx a include:_spf.domain.com ip4:ipaddress -all

I can't tell if you realize it but this is all filler content.

"include:", if used, would be followed by another DNS entry whose TXT record was an SPF record for your domain.

"ip:" should be followed by an actual, fixed (non-dynamic) IP address.

"apache.org", for example, has this SPF record:
v=spf1 include:_spf.apache.org -all

The "include:" directive tells us to look up the entry indicated, which gives us this long list of IP addresses plus some more "include:" directives:
v=spf1 ip4:95.216.194.37 ip4:3.227.148.255 ip4:207.244.88.153 ip4:207.244.88.131 ip4:116.203.166.180 ip4:207.244.88.144 ip4:116.203.246.181 ip6:2a01:4f8:c2c:e8b::/64 ip6:2a01:4f9:c010:567c::1 include:spf.mandrillapp.com -all

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #8 on: May 19, 2023, 06:13:30 AM »
I know I didn't really want to put my "sensitive info" down in the public forum. But I guess I can... But I want to try again first. I'll let you know if it worked or not....

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #9 on: May 19, 2023, 06:23:35 AM »
Okay so trying to mimic the apache websites SPF record didn't work my DNS says it requires an IP address in the record to send mail so I need it but not sure what is wrong with it nothing will recognize it even it is drawn up from a SPF Wizard from my DNS company....

here is the spf record with all of the info.

v=spf1 mx a include:spf.kspk.com ip4:208.117.68.42 -all

Online warren

  • *
  • 293
  • +0/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #10 on: May 19, 2023, 12:42:53 PM »
Okay so trying to mimic the apache websites SPF record didn't work my DNS says it requires an IP address in the record to send mail so I need it but not sure what is wrong with it nothing will recognize it even it is drawn up from a SPF Wizard from my DNS company....

here is the spf record with all of the info.

v=spf1 mx a include:spf.kspk.com ip4:208.117.68.42 -all

if you dont have any third party domains sending mail on your behalf remove the "include:spf.kspk.com "  This fails the lookup.

so this as spf record  :
Code: [Select]
v=spf1 mx a  ip4:208.117.68.42 -all

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #11 on: May 19, 2023, 10:01:55 PM »
No 3rd parties thanks I will try that.

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #12 on: May 19, 2023, 11:07:48 PM »
Okay that worked because now the SPF Record is recognized by the program you gave me to check it with

SPF record passed validation test with pySPF (Python SPF library)!

However emails from SME Server still go to spam in Gmail.... Is it something that google needs to wake up and accept or am I missing something? I think I did everything required for them but it still doesn't work..........

Offline Jean-Philippe Pialasse

  • *
  • 2,763
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Gmail directing all SME Server Emails to spam.
« Reply #13 on: May 20, 2023, 12:14:45 AM »
give it some time and wine. 
aging is the same for reputation and good wines.

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #14 on: May 20, 2023, 07:25:03 AM »
Okay will do its still not working though.... Any idea how long it would take for Gmail to recognize the changes?
 

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #15 on: May 20, 2023, 02:26:43 PM »
Make sure that google's reason is still the SPF record.

There are lots of other things that Google will use to classify email as SPAM.

Possibly relevant in your case:
* IP Addresses from ranges of IPs assigned by your ISP to residential internet connections
* Mismatch between your server's DNS, HELO and PTR records



Way too much detail

IP Address Space
- If your IP address belongs to a range that has been identified by your ISP, or by any of several spam filters (spamhaus etc) or by Google as belonging to an IP Address space used mostly by residential users some of whom have dynamic IP addresses, your email may go to SPAM.
- The recourse in this case is to pay your ISP for an IP with a different reputation, or to relay your email through an outgoing service
--> If you start relaying email through a service you will need to adjust your SPF record

HELO
- whatever your server uses as its HELO string needs to return your server IP address in a DNS lookup
- Some services also insist that the name used for HELO return an "A" record, and not a "CNAME" record
- SME 'HELO' is set using qpsmtpd->HeloHost, defaulting to DomainName if qpsmtpd->HeloHost is not set:
Quote from: /etc/e-smith/templates/var/qmail/control/helohost
{ $qpsmtpd{HeloHost} || $DomainName }
Quote from: bash command to check the DNS lookup of your HELO value
nslookup $(config getprop qpsmtpd HeloHost || config get DomainName) 4.2.2.2

PTR
- your IP address needs to have a PTR record
- The name returned for the PTR lookup for your IP needs to resolve to the same IP
- The PTR record for your IP is controlled by whoever owns the IP address -- almost certainly your ISP.  Changing or setting a PTR record for your IP would require asking the ISP, who may or may not do what you ask.

Quote from: Demonstrating using apache.com (edited for readability)
# nslookup -type=txt apache.com
apache.com   text = "v=spf1 +a +mx +ip4:67.227.199.17 ~all"

# nslookup -type=ptr 17.199.227.67.in-addr.arpa
17.199.227.67.in-addr.arpa   name = host2.accelrf.com.

# nslookup host2.accelrf.com
Name:   host2.accelrf.com
Address: 67.227.199.17

Quote from: Figure out who owns the IP (who can change the PTR record)
# curl ipinfo.io/67.227.199.17/org
AS32244 Liquid Web, L.L.C

# nslookup -type=soa 17.199.227.67.in-addr.arpa
# (nothing, so chop off the last octet
# nslookup -type=soa 199.227.67.in-addr.arpa
Non-authoritative answer:
199.227.67.in-addr.arpa
   origin = ns.sourcedns.com
   mail addr = admin.sourcedns.com
   serial = 2023050301
   refresh = 28800
   retry = 7200
   expire = 3600000
   minimum = 14400
« Last Edit: May 20, 2023, 02:37:45 PM by mmccarn »

Offline Jean-Philippe Pialasse

  • *
  • 2,763
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Gmail directing all SME Server Emails to spam.
« Reply #16 on: May 21, 2023, 02:16:57 AM »
there are a lot of variable. including people taging it as spam, organization inside goigle adding score for incoming emails.
wait few days and reevaluate

Offline JRBATM20192021

  • ***
  • 111
  • +0/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #17 on: May 21, 2023, 07:59:14 AM »
Sounds good I will take a look at that stuff and reevaluate in a few days... Thanks!

Offline ReetP

  • *
  • 3,736
  • +5/-0
Re: Gmail directing all SME Server Emails to spam.
« Reply #18 on: May 21, 2023, 03:36:39 PM »
give it some time and wine. 
aging is the same for reputation and good wines.

:lol:

I can testify to that.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation