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

Outgoing SMTP Proxy ONLY | NO Incoming

Hi All,  

I used to be able to configure SMTP Proxy for my LAN to scan Outgoing mails and then the SMTP Proxy -> ISP SMTP Server. 
This is perfect in the 6.x version as no SMTP Ports is opened to external.

Since the 7.x, I have never been able to do that.
The SMTP ports are always open as long as SMTP Proxy is enabled but cannot be used as a relay as I did not configure any domains, I only set my LAN to allow relay. But I do not like the fact port scan shows the port open.

I tried to block manually by setting firewall rules on top to block incoming but it remains open, i think it is some auto rules thus my block rules does not apply.

PORT 25, 465, 587.


I reinstalled 7.402 from Scratch as I could not figure our what I missed and at a stage, I noticed something.

On the Basic Setup Wizard, there is stage for e-mail security that says
" Email traffic can be scanned for spam, viruses and spyware. If you want to use the ASG as an SMTP relay for your internal email clients, enable the outbound SMTP Relay. If you want to scan incoming SMTP Traffic for malware and spam, enable the inbound SMTP relay.

[] Enable POP3 Poxy
[] Enable Inbound SMTP Relay

BUT There is NO Enable Outbound SMTP Relay on the screen which is what I need.

Please advice, thank you.[:S]


This thread was automatically locked due to age.
Parents
  • Scanning outbound mail has never been available in V7.

    Post-install:
    'Mail Security >> SMTP' 'Relaying' tab - 'Scan relayed (outgoing) messages' checkbox

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Hi,
    If you do a search in this forum for my user id, sometime in the last 3 months I posted a detailed description on how to setup scanning on out going smtp mail using the proxy for a home user.

    Ian M
  • Hi All,

    Thanks for all the reply.

    - Yes I am able to Scan my out going mails.
    - Yes it goes to my ISP SMTP

    The issue I have now is, I want to close the External Ports as I do not have a SMTP Server at home.

    The 3 ports are open as long as I enable SMTP Proxy.
    I created Rules to block and place at top but remains Open.


    The second issue I want to show is, as part of the Basic Setup wizard, which I The option of Only scan Outgoing but do Not allow Incoming is not available.

    Attached screenshot
  • The second issue I want to show is, as part of the Basic Setup wizard, which I The option of Only scan Outgoing but do Not allow Incoming is not available.

    Of course, the Basic Setup wizard is aimed at business users.

    1. See my post above for scanning outbound.
    2. On the 'Routing' tab of 'Mail Security >>  SMTP', do not enter anything in 'Domains and routing target'.


    Have you configured POP3 pre-fetch?

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Hi,
    proxies are higher up the processing queue than packet filters. If you are that paranoid about having ports open when there isn't a path beyond the ASG you could try routing the offending packets to a null device.

    If setup correctly the ASG will close itself up if it suspects a port scan. 

    Ian M
  • Hi

    Bob: Thanks for your reply. Yes I know the Basic Setup Wizard is targetted at Business Users who generally have a SMTP Server.

    But the wording on the screen does give the impression, if you Only want to scan Outgoing SMTP, enable that Only. Thus when I read it, I am looking for the option for Outgoing Only.

    " Email traffic can be scanned for spam, viruses and spyware. If you want to use the ASG as an SMTP relay for your internal email clients, enable the outbound SMTP Relay. If you want to scan incoming SMTP Traffic for malware and spam, enable the inbound SMTP relay.

    [] Enable POP3 Poxy
    [] Enable Inbound SMTP Relay"

    That line that says Enable the outbound SMTP Relay which is what I want but not on the list, I thought I found a bug [[:)]]


    Ian M: Thank you for your explanation that the Proxy is above the Packet Filter thus my explicit block rules does not work, I learn something new.
    I always thought Explict Block will "win" everything else.

    The reason this Open Port is disturbing to me is because I use SecuritySpace to Audit my configuration (which does help me a lot to identify mistakes such as webadmin set to any etc)

    In the past during the 6.x, my ports is 100% Closed thus now when it is on the 7.x and shows open, it is disturbing and securityspace audit would get shows some "keys" and headers etc which is beyond my level but I felt I just want to close it.


    Bob: On the 'Routing' tab of 'Mail Security >> SMTP', do not enter anything in 'Domains and routing target'.

    Yes I left mine blank, I specifically set Allow relay to LAN and on top of that under the Block, I set ANY just to be safe.

    I believe my SMTP is secure as in I do not see it as a spam relay etc.

    Yes I do enable the port scan detection to defend port scan.

    But the thing is when we do audits from security space, I would turn off the port scan so that those ports that is really open such as VPN etc, it can see it and also check if there is any vulnerabilities.

    With the port scan enabled, the results may not be as good even if it gives the all clear as I think the port scan simply block that IP for a certain amount of time but if the attacker is not doing port scan, then it won't protect me.

    Sorry if what I am writing does not make sense, I am learning too [[:)]]
  • As Ian suggested, create a dnat rule and forward the ports you don't like open to an IP that is not used on your network. So lets say your local network is 192.168.1.***. Create a DNAT rule:

     Traffic source ANY, traffic service smtp traffic destination external address DNAT TO some IP you don't use in the 192.168.1.*** range and make sure you don't check the create automatic filter rule.

    This will make your port 25 stealth again even if the scan was only done against port 25. It will not show up as open even if the port scan protection was turned off. Pretty similar to v6 where nat/masq rules were always used before packet filter rules.

    You might have to tweak the DNAT a little to make sure your outbound is not affected since I haven't tested it.[;)]
  • Billybob, doesn't the SMTP Proxy capture port-25 packets before they're ever considered by SNAT,  packet filter rules, DNAT or explicit routes?

    NOTE! - DNAT's are first, then proxies, finally, manual routes and packet filter rules.  SNATs are the last thing applied when the packet is ready to leave the interface.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Seems like DNAT has carried over from v6, I didn't try snat or other masq rules but if you put a dnat rule, atleast in my testing it is applied before the proxy is. I only tested it on smtp proxy because of the nature of the question but I am sure it will work on all if it is working on one.
Reply
  • Seems like DNAT has carried over from v6, I didn't try snat or other masq rules but if you put a dnat rule, atleast in my testing it is applied before the proxy is. I only tested it on smtp proxy because of the nature of the question but I am sure it will work on all if it is working on one.
Children
  • Ian, Bob and Billybob.

    - Yes I did read about the suggestion on the DNAT but yet to implement as I was thinking there might be a easier way to do it such as maybe I configure something wrongly etc.

    I proceeded to do the DNAT but somehow SMTP 25 remains open on ShieldUp.

    465 and 587 is now closed with the same DNAT.

    - I created a Host Blackhole with a non exist IP.

    - I Created 

    For Port 25

     1) From ANY Service SMTP Destination WAN Address
         To Blackhole Service SMTP
         Auto Packet Filter Rule UNchecked.

    For Port 465

     2) From ANY Service SMTP SSL Destination WAN Address
         To Blackhole Service SMTP SSL
         Auto Packet Filter Rule UNchecked.

    For Port 587
    I created a TCP PORT 587 in the services as I do not see it.

     1) From ANY Service TCP Port 587 Destination WAN Address
         To Blackhole Service TCP Port 587
         Auto Packet Filter Rule UNchecked.


    The result from ShieldUp is Port 25 remains OPEN.

    Port 587 and Port 465 is now closed.

    But I do not understand why 25 remains open.

    Under SMTP Proxy, below is the settings, those not stated is not touched.

    Global = Simple Mode
    Domains and Routing Target = Empty.
    Route by MX Records. ( It used to be Static Host List but after I tried to play around, I can no longer set it back to Static Host List which is empty thus I choose MX Records)
    Host Based Relay = LAN Only.
    Host / Network Blacklist = ANY
    Scan Relayed (outgoing) messages = Checked
    Use Transparent Mode = Checked
    Use Smarthost = Checked with my ISP SMTP.
  • Hi All

    Recall I mentioned I did the DNAT as suggested by all the gurus, and the theory is DNAT is on top of Proxy etc. ( How I hope we can see all these "invisible" rules to troubleshoot better).

    Anyway originally, Port 25 is really always OPEN with DNAT.

    I came up with the idea, maybe the SMTP Proxy is "holding" to it thus DNAT cannot "take it"

    Thus I turned OFF SMTP and DNAT.

    ON the DNAT First, then the SMTP and now Port 25 is Closed ! [:D]

    Feels so great now...

    Question: Under Domains Routing: Should I put STATIC or Route by MX ?

    THANK YOU All for the help, really learned a lot such as can use DNAT to block, I always have the concept it is to open only.
  • Port 25 remains Open with DNAT.

    Added Block Rule on Top in Packet Filter still remains open.

    Just to confirm my DNAT is right, I disable DNAT and other ports open, so I am doing correctly just that somehow the other 2 ports will close but somehow 25 remains Open.

    Question just to make sure I do correctly.

    Routing should I set to

    1) MX Records
    2) STATIC -> Empty Domain List -> Blackhole Hostname which is Non exist IP.

    Which is better?

    The disturbing part is it started as 100% Empty, now I cannot make it 100% empty as it simply won't accept.

    One last port 25 to go.
  • It used to be Static Host List but after I tried to play around, I can no longer set it back to Static Host List which is empty thus I choose MX Records

    Something is not right and the webadmin is not behaving as it should. Just for FYI, I always use static host in there since it saves the firewall from making one extra query and saves on another point of failure. But that point is moot in your case since you are not allowing any from outside.

    You have stated that the port is stealth if you turn off smtp all together on grc.com? In my limited testing, DNAT made port 25 stealth on 7.401 (haven't taken the plunge to 7.402) on grc. Are you sure your router doesn't have smtp port. 

    Just out of curiosity, how were you blocking incoming smtp on v6 without DNAT if you had smtp proxy running?

    Added Block Rule on Top in Packet Filter still remains open.

    Builtin rules are always and have always been applied before manually added packet filter rules even in v6.
  • Hi Billybob.

    1) As I went thru the 7.402 setup from scratch several times. I am very sure this is the behavior.
    1.1) During the Basic Setup Wizard, I did Not check Allow Incoming SMTp.
    1.2) When log into Web Admin, the Routing is STATIC with Domain Empty and the Host List Empty.
    1.3) As part of my attempt to find the right configuration, I changed to MX Record and saved sucessfully, saw that it did not meet my requirements and wanted to change back.
    1.4) Now when I try to change back to Static, I can leave the list of domains empty But the Host List is a must to set something before it will save. So I set it to the "Blackhole" Hostlist I created to do the DNAT.

    2) I do not have a seperate Router, Astaro is my router. It is connected to Cable Modem directly.
    2.1) Yes all ports are simply closed when I disabled SMTP Proxy, absolutely sure of this.

    3) During the V6, It was simple, I remember I just state I use a SMART Host and that is it.
    [:)]
  • Have you tried to set a smarthost in the current version?
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Hi Alvin,
    I have just finished a basic security scan of my ASG with the same website you refer to in your message and not found any open ports. I will try again with the IPS disabled and see what happens.

    Ian M

    I ran the "No Risk Audit". It returned one intermediate threat ??, 3 minors and 6 others. The 3 minors were all about my non existent e-mail server which happens to be my hp7150 printer. The "others" were informational only "no risk".

    I did forget to add in my configuration post that I block all packet filter traffic below 1024 to ensure everything goes through the proxy. Some applications are very dumb and can't work with a proxy even when they have the ability to. I then put specific packet filter rules to allow them to talk to specific sites eg microsoft update, adobe update, Australian Tax Office (e-tax) etc.
  • Hi

    Balfson - Yes I added my ISP SMTP to the smarthost and looking at headers, yes it is working fine.

    RFCat_vk - Ensure your port scan detection under IPS is disabled.

    [:D]
  • Hi Alvin,
    yes, I had detect portscan disabled, I also disabled the DOS rules as well.

    Put them all back after I finished the tests.

    Ian M
  • RFCAT_VK

    So did your SMTP Ports shows Open?