Koozali.org: home of the SME Server

Have given up on tinkering with email filtration

Offline MSmith

  • *
  • 675
  • +0/-0
Have given up on tinkering with email filtration
« on: August 26, 2015, 11:28:13 PM »
Got tired of fighting it. There are lots of MX-based hosting solutions out there, but I ended up choosing SpamHero. I do NOT work for them, nor am I a reseller. But so far, so good!

http://www.spamhero.com

Free 30-day trial, and a mere $60/year for an entire domain after that (up to 100,000 messages per month.)

MANY thanks to mmccarn, who provided the key to configuring SME Server to only accept incoming SMTP traffic from SpamHero's servers.

Here's his generic commands (I of course inserted IP addresses provided by SpamHero):

Code: [Select]
config setprop smtpd AllowHosts a.b.c.d,x.y.z.0/24
signal-event remoteaccess-update

...

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Have given up on tinkering with email filtration
« Reply #1 on: August 27, 2015, 10:13:46 AM »
MSmith

Did you try Knuddi's scanmailx, see
http://forums.contribs.org/index.php/topic,51845.msg264478.html#msg264478
also a free tryout & cheap when you pay
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline MSmith

  • *
  • 675
  • +0/-0
Re: Have given up on tinkering with email filtration
« Reply #2 on: August 27, 2015, 03:18:20 PM »
Looks like a good choice, maybe I'll give that one a try with another client.
...

Offline crazybob

  • *****
  • 894
  • +0/-0
    • Stalzer R&D
Re: Have given up on tinkering with email filtration
« Reply #3 on: August 28, 2015, 01:19:45 AM »
Claiming ignorance, I am not sure exactly what to substitute in the config setprop smtpd AllowHosts a.b.c.d,x.y.z.0/24 command.
I understand what I should use for a.b.c.d, but not sure what to use for x.y.z.0/24.
I am trying to set up to try spamhero.

TIA
Bob
If you think you know whats going on, you obviously have no idea whats going on!

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Have given up on tinkering with email filtration
« Reply #4 on: August 28, 2015, 09:54:12 AM »
crazybob

Quote
I understand what I should use for a.b.c.d, but not sure what to use for x.y.z.0/24.

For specifying additional hosts
see
http://wiki.contribs.org/Firewall
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
Re: Have given up on tinkering with email filtration
« Reply #5 on: August 28, 2015, 02:45:42 PM »
I understand what I should use for a.b.c.d, but not sure what to use for x.y.z.0/24.
The AllowHosts property contains a comma-separated list of hosts and/or networks that are allowed access to the specified service.  In that example command, a.b.c.d is an example of how to specify a single IP address, while x.y.z.0/24 is an example of how to specify an entire network (any IP address beginning with x.y.z.).  To limit connections to smtpd to the spamhero servers as strictly as possible, you won't specify a network; you'd just identify their 7-8 IP addresses separated by commas.  The command will be

Code: [Select]
config setprop smtpd AllowHosts 108.60.195.218,108.60.195.213,108.60.195.222,208.53.48.218,208.53.48.191,208.53.48.71,208.53.48.64
Now, if you wanted to shorten that command and get kind of fancy, and didn't mind that you hadn't set the configuration 100% as secure as possible, you could specify a netmask for the 108. IP addresses.  To explain that requires some background, though.

IPv4 addresses are 32-bit binary numbers.  We usually see them denoted with four, eight-bit values ("octets"), converted to decimal, and separated by periods: [0-255].[0-255].[0-255].[0-255], but internally they are binary numbers.  An address with a network mask identifies a range of addresses as belonging to the same network; the network mask identifies how many bits of the address remain the same.  The old-fashioned way to do that was something like 192.168.1.0/255.255.255.0.  The first address is the network address--everything on 192.168.1.whatever; the second has the first 24 bits set, so it denotes that those first three numbers will remain constant.  The more modern way to denote this would be 192.168.1.0/24.  Rather than you needing to figure out that 255.255.255.0 had the first 24 bits set, this just gives you the number of bits.  It's shorter and a bit clearer.

So, you could set AllowHosts to 108.60.195.0/24,208.53.48.0/24.  This would probably work pretty well, and it would block most other hosts from connecting, but it's still pretty broad.  You could narrow down the 108. network quite a bit by noticing that the last octet (number) in those three IP addresses is pretty similar.  If you convert each of them (213, 218, 222) to binary, you'd notice that the first four digits of each of them were the same (1101), but the last four digits differed.  To convert this to a network address, then, you'd first convert 11010000 to decimal (208), and then determine how many bits to specify.  You know that the first three octets are the same, so that's 24 bits, and four more bits of the last octet are also the same, so that's a total of 28 bits.  The network address would thus be 108.60.195.208/28.  Using that value for AllowHosts would allow 16 different IP addresses to connect; using 108.60.195.0/24 would allow 255.
......

Offline crazybob

  • *****
  • 894
  • +0/-0
    • Stalzer R&D
Re: Have given up on tinkering with email filtration
« Reply #6 on: August 28, 2015, 03:08:52 PM »
Thank you Janet and DanB35. I feel I have a reasonable grasp on this now. You were great help. I did a little booking on this, but to me the info was kind of vague. I was not sure if there was a limit on comma separated values or not.
I am now ready to move forward.  :-)
If you think you know whats going on, you obviously have no idea whats going on!