How To Whitelist MX Email Backup Servers Forwarding As Not SPAM

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
User avatar
jim.bus
Senior user
Senior user
Posts: 304
Joined: 2011-05-28 11:49
Location: US

How To Whitelist MX Email Backup Servers Forwarding As Not SPAM

Post by jim.bus » 2019-10-19 00:01

I use grey listing and checking for SPF records in my antispam tests, and I use junkemailfilter.com as an MX Backup Email Filter. I am suspecting I may not be getting all my email from junkemailfilter.

Junkemailfilter specifies that SPF breaks email forwarding. From their description of how it works, my understanding of why SPF breaks forwarding must be because their IP Addresses which delivers the forwarded (saved) email to hMailServer when it is does, do not have SPF records for them for hMailServer to check and SPF fails the check. This should not be a problem if this is the case as I do not reject SPAM only mark the email as [SPAM] in the email subject line and deliver to the email to the Recipient Email ID.

Greylisting would seem to cause me problems though as I am certain that junkemailfilter.com will retry to send the email if it receives a 'Try again later' response from hMailServer. From hMailServer Help documentation on White Listing I can White List the Antispam checking but this does not seem reliable with junkemailfilter for the following reasons.
1. I can only White List Email Addresses which can include Wildcard email addresses.
2. I can Whitelist IP Addresses.
At the point hMailServer receives the email from junkemailfilte, it seems like hMailServer would not be checking each individual email address delivered by junkemailfilter unless junkemailfilter sends them one at a time which is doubtful in my mind. So I suspect I might not receive the email forwarded by junkemailfilter yet I have received email from junkemailfilter so I am not sure what is happening with them.

hMailServer does seem to address this situation a little bit but it doesn't seem to provide a way to handle this. Meaning the methods to White List seemingly aren't sufficient.
1. I can White list Email Addresses or wildcard email addresses but I believe the Email Address may not be available with email received from junkemailfilter or probably any MX Backup Email Server.
2. I can White list an IP Address. This doesn't work all the time because the IP Addresses can change and you won't be aware it has changed until you find out you aren't receiving your email.

Specifying Incoming Relays would appear to be a possible solution in the above case in that hMailServer is supposed check all the recieved-headers for the email addresses. The hMailServer Help Documentation lists this as the method to handle this situation but again the problem becomes junkemailfilter's IP Addresses change at some unknown time as would other possible MX Backup Email Servers.

So my question is, is my analysis of the way in which all this works is correct and if I am correct is there a way to 'Whitelist' the MX Backup Email Server or do I just have to turn off Greylisting to be able to receive everything for sure.

palinka
Senior user
Senior user
Posts: 1273
Joined: 2017-09-12 17:57

Re: How To Whitelist MX Email Backup Servers Forwarding As Not SPAM

Post by palinka » 2019-10-19 00:17

Is ham received from junkemailfilter.com being marked as spam by spamassassin or by hmailserver's built in spf check?

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

Re: How To Whitelist MX Email Backup Servers Forwarding As Not SPAM

Post by jimimaseye » 2019-10-19 00:33

From a skim read of your post:

Yes your understanding seems correct. Incoming Relays are the answer. If you feel you can't use that because you think the ip changes too often (define 'often': i doubt junkmailfilter changes their address that often), then your only (simple) option is to turn off grey listing. (These are the problems with grey listing and it becomes more and more problematic as email handling services grow and offer emails from several rotating ip addresses. It's impossible to use greylisting for deliveries from gmail, o365 and yahoo due to the hundreds of thousands ip addresses they use).

So.... turn it off.

[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

User avatar
jim.bus
Senior user
Senior user
Posts: 304
Joined: 2011-05-28 11:49
Location: US

Re: How To Whitelist MX Email Backup Servers Forwarding As Not SPAM

Post by jim.bus » 2019-10-19 00:34

palinka wrote:
2019-10-19 00:17
Is ham received from junkemailfilter.com being marked as spam by spamassassin or by hmailserver's built in spf check?
I am not using Spamassassin.

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

Re: How To Whitelist MX Email Backup Servers Forwarding As Not SPAM

Post by SorenR » 2019-10-19 00:43

hMailAdmin -> Settings -> Advanced -> Incoming relays

Add IP range of your TRUSTED Backup-MX or Relay server(s).

I have 3 entries here with "Lower IP" = "Upper IP" of my Backup MX'es

In SpamAssassin I have:

# Set which networks or hosts are considered 'trusted' by your mail
# server (i.e. not spammers)
#
internal_networks 80.160.77.aaa 80.160.77.bbb 80.160.77.ccc
trusted_networks 80.160.77.aaa 80.160.77.bbb 80.160.77.ccc
SørenR.

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

User avatar
jim.bus
Senior user
Senior user
Posts: 304
Joined: 2011-05-28 11:49
Location: US

Re: How To Whitelist MX Email Backup Servers Forwarding As Not SPAM

Post by jim.bus » 2019-10-19 01:02

SorenR wrote:
2019-10-19 00:43
hMailAdmin -> Settings -> Advanced -> Incoming relays

Add IP range of your TRUSTED Backup-MX or Relay server(s).

I have 3 entries here with "Lower IP" = "Upper IP" of my Backup MX'es

In SpamAssassin I have:

# Set which networks or hosts are considered 'trusted' by your mail
# server (i.e. not spammers)
#
internal_networks 80.160.77.aaa 80.160.77.bbb 80.160.77.ccc
trusted_networks 80.160.77.aaa 80.160.77.bbb 80.160.77.ccc
Thanks, Soren. But see my prior Post Response to Palinka. Junkemailfilter's IP Addresses do on occasion change so your Incoming Relays would require manual monitoring. And junkemailfilter IP address are not sequential so I cannot specify a range either. I have been using the Incoming Relays method for a long time.

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

Re: How To Whitelist MX Email Backup Servers Forwarding As Not SPAM

Post by SorenR » 2019-10-19 01:14

jim.bus wrote:
2019-10-19 01:02
Thanks, Soren. But see my prior Post Response to Palinka. Junkemailfilter's IP Addresses do on occasion change so your Incoming Relays would require manual monitoring. And junkemailfilter IP address are not sequential so I cannot specify a range either. I have been using the Incoming Relays method for a long time.
Found some old code in an old folder :mrgreen:

Code: Select all

Sub OnHELO(oClient)
   If (InStr(oClient.HELO, "backup-mx.post.tele.dk") > 0) Then
      '
      ' Dynamic management on IP address of Backup-MX
      '
      Call AddRelay(oClient.IPAddress, oClient.HELO)
      End If
End Sub

Sub AddRelay(strIP, strDesc)
   Dim i, Found : Found = False
   Dim oApp : Set oApp = CreateObject("hMailServer.Application")
   Call oApp.Authenticate(ADMIN, PASSWORD)
   oApp.Settings.IncomingRelays.Refresh
   For i = 0 to oApp.Settings.IncomingRelays.Count-1
      If (oApp.Settings.IncomingRelays(i).LowerIP = strIP) Then
         oApp.Settings.IncomingRelays(i).Name = "# " & Date & " " & strDesc
         oApp.Settings.IncomingRelays(i).Save
         Found = True
      End If
   Next
   If (Not Found) Then
      With oApp.Settings.IncomingRelays.Add
         .LowerIP = strIP
         .UpperIP = strIP
         .Name = "# " & Date & " " & strDesc
         .Save
      End With
   End If
End Sub
SørenR.

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

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

Re: How To Whitelist MX Email Backup Servers Forwarding As Not SPAM

Post by mattg » 2019-10-19 02:18

jimimaseye wrote:
2019-10-19 00:33
From a skim read of your post:
++
jim.bus wrote:
2019-10-19 00:01
I use grey listing and checking for SPF records in my antispam tests, and I use junkemailfilter.com as an MX Backup Email Filter. I am suspecting I may not be getting all my email from junkemailfilter.
I think junkemailfilter is almost abandoned
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
jim.bus
Senior user
Senior user
Posts: 304
Joined: 2011-05-28 11:49
Location: US

Re: How To Whitelist MX Email Backup Servers Forwarding As Not SPAM

Post by jim.bus » 2019-10-19 02:38

mattg wrote:
2019-10-19 02:18
jimimaseye wrote:
2019-10-19 00:33
From a skim read of your post:
++
jim.bus wrote:
2019-10-19 00:01
I use grey listing and checking for SPF records in my antispam tests, and I use junkemailfilter.com as an MX Backup Email Filter. I am suspecting I may not be getting all my email from junkemailfilter.
I think junkemailfilter is almost abandoned
I have been suspecting that myself and I have already set up a mechanism to use hMailServer supposedly as an MX Backup Email Server as well but it will be running at the same location as my hMailServer Email Server (my home) so I still needed a third party off-site MX Backup Email Server in case I had for instance a Power Failure which would take my MX Backup Email Server (hMailserver as Backup Server) offline. I have been holding off on testing hMailServer as Backup until I can get some free time at night when there will be little chance of receiving much if any email that might otherwise get lost. Whether or not I use junkemailfilter, I believe I still want to use hMailServer as a Backup as well because then I can control for instance how often the stored email is sent back to me and for how long it will store the email. I was able to set up my own MX Backup Email Server because I have more than one External Public Static IP so I can put the MX Backup Email Server on a second External Public IP.

Post Reply