Mail Header Received from Unknown via GMAIL

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
w3ph
New user
New user
Posts: 4
Joined: 2019-05-20 16:34

Mail Header Received from Unknown via GMAIL

Post by w3ph » 2019-05-20 17:33

Im using latest Version of HMailServer latest build 5.6.7.

All is working fine. However, when a user is sending out emails via an IP that DOES NOT have a PTR record for its IP. Gmail is putting the email under Junk Box. I noticed this because when a user is using an IP with PTR record for its IP, the email goes directly to Gmail INBOX.

This is the header of the email via Gmail Original Message View

spf=pass (google.com: domain of test@dommin.com designates 180.91.63.98 as permitted sender) smtp.mailfrom=test@domain.com
Received: from 000PC (Unknown [60.19.12.213]) by mail.domain.com with ESMTPA ; Mon, 20 May 2019 22:29:59 +0800

Kindly refer particularly at the "UNKNOWN".

I have tried to use the suggested settings in hmail INI that is
[Settings]
AuthUserReplacementIP=127.0.0.1

However, even if i place an IP with a PTR record it still reflects the "UNKNOWN".

Question:
1. Is there a way to initialize the hmail header to reflect the equivalent PTR of a particular IP using the AuthUserReplacementIP=127.0.0.1 ?
OR
2. Is there a way to initialize the hmail header to disregard the "'UNKNOWN" and just reflect the IP?

Anyone having the same issue with me?

Hope somebody can help.

Best Regards.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8157
Joined: 2011-09-08 17:48

Re: Mail Header Received from Unknown via GMAIL

Post by jimimaseye » 2019-05-20 19:30

Everyone will have the same problem as you if they do the same thing and ignore the point of ptr records. You are asking to override the very purpose of having a ptr record and still allow your email to land without suspicion and avoid the 'potential spam' branding.

Ptr is there and used by real mail admins who intend to do things properly and avoid looking like a spammer. (Spammers don't like going through the hassle of setting up ptr records).

What to do: set up a ptr record or use a relay.

[Entered by mobile. Excuse my spelling.]
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

w3ph
New user
New user
Posts: 4
Joined: 2019-05-20 16:34

Re: Mail Header Received from Unknown via GMAIL

Post by w3ph » 2019-05-20 19:52

Thank you for your input.

Actually, its our client who is demanding that this issue be resolved.

They are using another hosting company for another email domain hostgator to be exact. We just do not know what mail server are they particularly using. They are using the same ISP with an IP that has no PTR record but their emails are not being place at junk folder in Gmail.

Thus, they concluded that its the hMailServer settings that should be changed / adjusted so that their emails will not land as Junk email in Gmail.

Another point they are raising is that when their users travel to another place and uses a Public IP that has no PTR Record. They will never know if the emails they sent went to Gmail Junk Box.

On our end, all our server IPs that the hMailServer is running has a PTR record matching the domain name that is being used. In addition, we have set a complete SPF records for the domain name vis-avis the IPs that is being used by the server including that of our client IP number at their office connection.
In addition, all the server IPS are clean meaning they are not in any blacklist databases.

So this is the only issue we are now resolving. How to go about it when the end user IP does not have a PTR Record.

We have another client using a different email server application and we are using windows server smtp as relayer but the problem using it as relayer is it does not have much feature. Like undeliverable notification of sent out emails etc. etc.

I hope anyone can help on how to resolve this issue so that emails will not land on Gmail Junk Folder whenever a user unknowingly is using an internet service provider IP that does not have a PTR record.

Best Regards.

User avatar
mattg
Moderator
Moderator
Posts: 20233
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Mail Header Received from Unknown via GMAIL

Post by mattg » 2019-05-21 05:02

w3ph wrote:
2019-05-20 19:52
Another point they are raising is that when their users travel to another place and uses a Public IP that has no PTR Record. They will never know if the emails they sent went to Gmail Junk Box.
But the mail server serving the mail surely doesn't change IP address, only the IP address of their mail client connecting to their OWN mail server will change

w3ph wrote:
2019-05-20 19:52
So this is the only issue we are now resolving. How to go about it when the end user IP does not have a PTR Record.
That makes NO sense to me at all
w3ph wrote:
2019-05-20 17:33
All is working fine. However, when a user is sending out emails via an IP that DOES NOT have a PTR record for its IP. Gmail is putting the email under Junk Box. I noticed this because when a user is using an IP with PTR record for its IP, the email goes directly to Gmail INBOX.
and yet...
w3ph wrote:
2019-05-20 19:52
They are using the same ISP with an IP that has no PTR record but their emails are not being place at junk folder in Gmail.
What makes you think that PTR record (or lack thereof) is the issue here?

Seems to me that you are guessing...
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

w3ph
New user
New user
Posts: 4
Joined: 2019-05-20 16:34

Re: Mail Header Received from Unknown via GMAIL

Post by w3ph » 2019-05-21 10:25

Mattg,

Thanks so much for your thoughts. I really appreciate your feedback.

But again, I think you are missing the point...

Gmail detects the actual ISP IP Number that the email sender is using beside the server IP where the HMailServer is running. If Gmail detects the IP having NO PTR Record then the email is forwarded to Junk Box.

As I have said, the Server where the hMailServer is running has PTR Record all well and is configured properly. The end user when sending an email will pass thru the server so that is fine BUT GMAIL still detects the actual IP where the user actually sent the email before passing thur the server. If the IP has no PTR Record then, GMAIL will place the email on Junk Box.

We have tested this scenario using various Internet Service Provider with and without PTR record and Indeed, GMAIL detects the actual location where the email was actually sent.

Just further sharing. Anyone here can try to send and email with their ISP having no PTR to check that their email will land in Junk Box in Gmail.

User avatar
SorenR
Senior user
Senior user
Posts: 3213
Joined: 2006-08-21 15:38
Location: Denmark

Re: Mail Header Received from Unknown via GMAIL

Post by SorenR » 2019-05-21 11:49

w3ph wrote:
2019-05-21 10:25
Mattg,

Thanks so much for your thoughts. I really appreciate your feedback.

But again, I think you are missing the point...

Gmail detects the actual ISP IP Number that the email sender is using beside the server IP where the HMailServer is running. If Gmail detects the IP having NO PTR Record then the email is forwarded to Junk Box.

As I have said, the Server where the hMailServer is running has PTR Record all well and is configured properly. The end user when sending an email will pass thru the server so that is fine BUT GMAIL still detects the actual IP where the user actually sent the email before passing thur the server. If the IP has no PTR Record then, GMAIL will place the email on Junk Box.

We have tested this scenario using various Internet Service Provider with and without PTR record and Indeed, GMAIL detects the actual location where the email was actually sent.

Just further sharing. Anyone here can try to send and email with their ISP having no PTR to check that their email will land in Junk Box in Gmail.
Bull... My client have a private IP address, so does my mailserver but it is translated via NAT to a public IP address and I have NO problems sending to GMail...

The only way GMail can know your client IP address is if they use GMail SMTP server... Are you sure you know what you are doing?

I suspect you are using GMail SMTP service and have hMailServer POP3 all mailboxes to local server for your clients. Your ISP probably block your SMTP (port 25) so you had to do it that way... Am I close?
SørenR.

“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde

User avatar
RvdH
Senior user
Senior user
Posts: 812
Joined: 2008-06-27 14:42
Location: Netherlands

Re: Mail Header Received from Unknown via GMAIL

Post by RvdH » 2019-05-21 12:44

@w3ph
Are you sure it's because of the missing PTR record or could it possibly be the actual IP address it origination from is on one or more blacklists?

Maybe you could anonymise the offending ip in the 'Receiver from' header
https://www.hmailserver.com/forum/viewtopic.php?t=18467
CIDR to RegEx: d-fault.nl/CIDRtoRegEx
DNS Lookup: d-fault.nl/DNSTools
DNSBL Lookup: d-fault.nl/DNSBLLookup
GEOIP Lookup: d-fault.nl/GeoipLookup

w3ph
New user
New user
Posts: 4
Joined: 2019-05-20 16:34

Re: Mail Header Received from Unknown via GMAIL

Post by w3ph » 2019-05-22 02:27

Hi Guys,

This is the format of Gmail via the Show Original Header

1. This is the header of the email that was placed in the JUNK FOLDER

Received: from maill.xxx.com (mail.xxx.com. [181.91.61.91])
by mx.google.com with ESMTPS id p7si19211576pfa.207.2019.05.20.07.18.58
for <xxxx@gmail.com>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Mon, 20 May 2019 07:18:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of test@xxx.com designates 181.91.61.91 as permitted sender) client-ip=181.91.61.91;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of test@xxx.com designates 181.91.61.91 as permitted sender) smtp.mailfrom=test@xxx.com
Received: from 000PC (Unknown [45.1.2.3]) by mail.xxx.com with ESMTPA ; Mon, 20 May 2019 22:19:01 +0800


2. This is the header of the email that was place DIRECTLY IN THE INBOX.
Received: from mail.xxx.com (mail.ems.com.ph. [181.91.61.91])
by mx.google.com with ESMTPS id i7si7066098pgb.597.2019.05.16.23.56.06
for <xxx@gmail.com>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Thu, 16 May 2019 23:56:06 -0700 (PDT)
Received-SPF: pass (google.com: domain of test@xxx.com designates 181.91.61.91 as permitted sender) client-ip=181.91.61.91;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of test@xxx.com designates 181.91.61.91 as permitted sender) smtp.mailfrom=test@xxx.com
Received: from [100.100.111.217] (visit.keznews.com [110.54.199.217]) by mail.xxx.com with ESMTPA ; Fri, 17 May 2019 14:56:09 +0800


The difference:
1
Received: from 000PC (Unknown [45.1.2.3]) by mail.xxx.com with ESMTPA ; Mon, 20 May 2019 22:19:01 +0800
End user IP has no PTR Record
2
Received: from [100.100.111.217] (visit.keznews.com [110.54.199.217]) by mail.xxx.com with ESMTPA ; Fri, 17 May 2019 14:56:09 +0800
End User IP has PTR Record

NOTE:
My client IP as well as the server IP where HMail is installed is NOT in any BlackList Database. The IP is perfectly clean.

I have asked my client for them to ask their ISP to give a PTR name on their office IP. This will then solves the issue. However, what if they wen to another country say Vietnam and the IP number of the hotel they are staying doe snot have PTR Record. They the email will be place in Gmail Junk Box.

I could have easily explained this to my client bu they are comparing hMailServer to other Mail Servers wherein their emails are not being place in junk email by Gmail and they are using the same ISP when sending out emails.

Please bear with me guys on this. As i really need a solution.

Many thanks for all your feedback and inputs.

Best Regards,

User avatar
mattg
Moderator
Moderator
Posts: 20233
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Mail Header Received from Unknown via GMAIL

Post by mattg » 2019-05-22 03:38

I still don't believe that that is the ONLY difference between the two messages, what about the message content, or who the sender is, or how many recipients were listed or BCCd.

We all do spam assessment on the run, gmail is no different.

Many of my client's emails are sent with a mail client on a mobile phone network, as is the case for ANY user who uses mobile phones to check their mail and send new messages. If Gmail were moving these to junk just because of this perceived issued then we would all have this problem - and we don't.



At any rate - this will remove that detail from header if you truly believe that this alone will fix your problem,
You could also simply remove ALL received headers, a new one will be added by gMail when they accept the message.
RvdH wrote:
2019-05-21 12:44
Maybe you could anonymise the offending ip in the 'Receiver from' header
https://www.hmailserver.com/forum/viewtopic.php?t=18467
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
SorenR
Senior user
Senior user
Posts: 3213
Joined: 2006-08-21 15:38
Location: Denmark

Re: Mail Header Received from Unknown via GMAIL

Post by SorenR » 2019-05-22 09:15

The Unknown client is NOT the issue. When I send to gmail I get this:

Code: Select all

Authentication-Results: mx.google.com;
       dkim=pass header.i=@acme.inc header.s=key1 header.b=UiL+0uR2;
       spf=pass (google.com: domain of soren@acme.inc designates 123.123.123.123 as permitted sender) smtp.mailfrom=soren@acme.inc;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=acme.inc
dkim-signature: v=1; a=rsa-sha256; d=acme.inc; s=key1; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:MIME-Version:Content-Type; bh=+D1al3rjKIt/QrPO3eHIoiJhMAl5VdsNXeu3GrXLRRM=; b=UiL+0uR20IQDccX7Ly4Mq6X/2N6SR+GTIYnNFcTv/OukqorVEF56xVwNVJzZnjLhVF/VH3L0qWZ6GdQ5hTgG/WV/st2yqhW3aJadL9dnwS6lGAXH8vHfQv1RVjINwxjZELsIYKl940BgKf1Iya55dcAF1mgVCo4+8TC0MIzuObQ=
Received: from sr (Unknown [192.168.0.190]) by mx.acme.inc ; Wed, 22 May 2019 09:04:50 +0200
SørenR.

“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde

Post Reply