This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Restrict Inbound IP's connecting to SMTP Proxy

I've done a little search, and cannot find anything answering this:

Is it possible to restrict the source IP's that can connect to the SMTP proxy?
Obviously if I don't use the proxy, I can restrict the IPs that are allowed to connect to my internal mail server, but I'd like to play with some of the new features in ASL4 now I finally got round to upgrading from 3.2 on my home network.
The reason for wanting to restrict the IPs is that I use MessageLabs SkyScan services (as I work for them!) and all my mail comes through their systems, so I need to restrict my inbound mail to only come from their IPs.

Thanks in advance,

Karl 


This thread was automatically locked due to age.
Parents
  • Why not just create a rule and allow only your desired IP range to access the inbound SMTP server? Other servers won't be able to access any way if there is not a specific rule to allow them.

    Maurice 
  • Yep, that's what I do at the moment, as I currently do not use the smtp proxy, but I would like to use the ASL smtp proxy, but only if it is possible to restrict which IP's on the internet can relay inbound to me. 
  • No problem. Thanks for your suggestions.

    I think it may be possible to restrict incoming in exim.conf somewhere, but I'm more familiar with qmail. I need to read the [exim] docs more, as my tinkering has not worked so far.

    Thanks again,

    Karl 
  • When you enable smtp-proxy there will be automatically created a rule (for ip-tables). This rule will allow all traffic to connect to your ASL - on either interface - but does not mean that they can relay. This is beeing limited by [Allowed Networks:]
    Since this rule is placed in a chain BEFORE your custom policy it will always match before yours will drop.
    So what can you do about that: either "hack" ip-tables or do NOT use smtp-relay but setup a rule that will allow smtp from your provider through the ASL right to your internal mail server.

    techno.kid   
  • Ah. There's an idea. To be honest, I'd not thought of that. The best answer is usually the simplest.

    I'll have a look for the iptables configs, and see if I can hack it, so that if smtp proxy is enabled, the rule that gets created is the restricted one I want [:$])

    >>but setup a rule that will allow smtp from your provider through the ASL right to your internal mail server

    This is what I currently do, but I'd like to play around with the new features in the proxy.

    Thanks,

    Karl 
  • Just for my own curiosity, if you hack the IP Tables configuration, are there any changes you can make in WebAdmin that will revert your manual changes, or even break the IP Tables config?

    I'm thinking of a situation where you hack the IP tables config to limit the inbound servers that can access the proxy.  If you disable and re-enable the proxy, how will it respond?  Will it fail to disable the hacked IP Tables rule because it isn't the same as the original rule that was defined by WebAdmin?    Or perhaps there are options in the WebAdmin that may cause the entire IP Tables config to be re-generated, which will overwrite your hacked changes.

    I'm just wondering what the chances are of accidentally destroying your firewall config when you start hacking files that the WebAdmin will modify.  
  • I can't look until later today, but, I'm hoping that there will be a defaults config file where I can change the line that get's added and removed. If I hack it, I want it to work seamlessly, without needing attention after a reboot etc.
    I'll give a scan with nessus after from out on the net as well..... 
  • Hmmm. Can't find it. Can someone at Astaro let me know if this rule is in a template somewhere, or if it is hard coded somewhere in the depths of the (what looks like) compiled perl [:)]
    The rule I'm looking for is the default mail rule that gets added to AUTO_INPUT :

    DROP       tcp  --  0.0.0.0/0            0.0.0.0/0          tcp spts:1:65535 dpt:25

    That gets changed automatically to :

    ACCEPT       tcp  --  0.0.0.0/0            0.0.0.0/0          tcp spts:1:65535 dpt:25

    When the smtp proxy is enabled. I'd like to change it to only allow a restricted network range to connect to me -- my MX records point to a MessageLabs server, and they relay to me -- so I just want to accept from them.....

    If it's hard coded, then I'm out of luck!

    Thanks in advance,

    Karl 
  • search for ipfilter.local

    /marcel 
  • Cheers Marcel. I thought/hoped it would be around there somewhere, just couldn't find it.

    I'll let you know how I get on.

    Thanks,

    Karl 
  • OK. I'm possibly being daft, and missing something right under my nose, but (and I hate to admit this)..... I can't find it. It's quite late here, and I've spent 45 mins looking for it, and just don't seem to be able to locate it.....

    Ah..... I'll look some more tomorrow....

    Cheers,

    Karl 
  • Karl,

    check this out https://community.sophos.com/products/unified-threat-management/astaroorg/f/52/t/25525

    it was the third topic from a search for 'ipfilter.local'  

    read you
    o|iver  
Reply Children