Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    PFSense Locking SMTP

    General pfSense Questions
    6
    13
    4.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kewing75
      last edited by

      Have a customer been working great, then last week they added about 6 more employees to the building. Now when they go to send email via SMTP it just locks and hangs and about ever hour or 2 it will just randomly send out. I have changed outbound SMTP servers to 2 different providers and happens the same with both providers. I have even setup the SMTP to use the IP and not the DNS names and still same issue. Im not sending out via port 25 but port 587. I have contacted the internet provider and they arent blocking ports. I have put just a basic linksys router in place and can send and receive fine. I see in the state tables there is a timeout on the connections for port 587. I thought possibly had bad hardware so replaced the pfsense with another one and did a clean config and manually entered all the rules and still have the same issues. Is anyone else having this problem or know how to fix it?

      1 Reply Last reply Reply Quote 0
      • P
        podilarius
        last edited by

        I have pfsense in front of 2 zimbra and one exchange server and there is no problem sending or receiving mail.
        What version are you running? What other packages do you have installed?

        1 Reply Last reply Reply Quote 0
        • chpalmerC
          chpalmer
          last edited by

          SMTP only allows 1 email client to connect to an account at a time. This is per the RFC

          This is not pfSense doing this. Your email server is locking the account to the first client device on an account that checks for new email. The second client device (same account) trying at the same instant will get the lockout message.

          Check the thread below for more info.

          http://www.hmailserver.com/forum/viewtopic.php?f=7&t=23818&start=0&hilit=locked

          Triggering snowflakes one by one..
          Intel(R) Core(TM) i5-4590T CPU @ 2.00GHz on an M400 WG box.

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            That link appears to be a problem specific to pop3 not SMTP. Am I missing something?

            @kewing75: The only thing that changed was the company added more employees? Presumably they got new emails addresses etc?

            Steve

            1 Reply Last reply Reply Quote 0
            • K
              kewing75
              last edited by

              @podilarius Im Running 2.0.2. And Normally we run squid on the box to do transparent proxy but on the new box we dont have it running. I saw people saying they had issues sending when they had squid running but never installed it on the new box hoping it would correct the problem.

              @Stephenw Yes all the new employees have new email addresses.

              Yesturday if i went into the state table and removed the entries for the external smtp server that had the TIME_WAIT:TIME_WAIT state they could hit send and receive on the outlook client were able to send out again. I have changed the Firewall Optimization to Aggressive to try and drop these connections faster.

              1 Reply Last reply Reply Quote 0
              • chpalmerC
                chpalmer
                last edited by

                Wow- Thats what happens when I try and answer a post after a 16 hour day I guess.  Totally misread that last night. Sorry!

                Triggering snowflakes one by one..
                Intel(R) Core(TM) i5-4590T CPU @ 2.00GHz on an M400 WG box.

                1 Reply Last reply Reply Quote 0
                • N
                  NOYB
                  last edited by

                  Not only that but the OP says it works fine with a basic Linksys router in place rather than pfSense.

                  Was the Linksys connected with the same cables and switch ports etc?  A long shot I know.

                  1 Reply Last reply Reply Quote 0
                  • K
                    kewing75
                    last edited by

                    Yes the linksys was hooked with same cables. Only problem is the PFSense has VPN connections to the other 4 branches (vpn only used for connection back to AS400) So i could only test for about an hour. I talked with them today and havent had any issues yet today but alot of the staff is on vacation today and tomorrow so probably wont truely know till monday if setting firewall to aggressive has fixed the issue.

                    1 Reply Last reply Reply Quote 0
                    • K
                      kewing75
                      last edited by

                      After everyone is back to work today SMTP traffic was getting locked up in the firewall again. I had an extra static IP from the ISP so programmed up a linksys router and put a static route in for the SMTP server and routing all SMTP traffic out the Linksys router and everything is running fine since i have done this. Im showing the routes in the state table showing ESTABLISHED:ESTABLISHED then they clear out once the client is done sending mail. I saw a similar post on this but it was in french or spanish so couldnt get all the information from that post. Any help would be great.

                      1 Reply Last reply Reply Quote 0
                      • D
                        dhatz
                        last edited by

                        pfSense has no ALG that might interfere with SMTP protocol, so there should be no difference between using port 25 or 587 for submission.

                        This appears to be a "stale states" issue, but I can't imagine why. Do you utilize policy-based-routing, or multiWAN, or WAN IP change etc?

                        Also when experiencing this issue, could you please check states (e.g. using pfctl -ss | fgrep :587 or smtp host-ip) ?

                        I don't think that setting the pf state optimization algo to "aggressive" will really help, because TCP timeouts will still be quite long, let alone that it might backfire in other ways …

                        1 Reply Last reply Reply Quote 0
                        • K
                          kewing75
                          last edited by

                          Well in a new situation the linksys router locked after being in place for about 6 hours then i switched everything around to go out the PFSense firewall again and all working. Im going to guess after a few hours the PFSense will lock again. There is something else going on internally.

                          1 Reply Last reply Reply Quote 0
                          • K
                            kewing75
                            last edited by

                            Found the issue. I combed through all 2500 state table entries and found that our firewall was being bombarded by incoming port udp 53 (DNS) traffic. This for some reason was causing issues with connecting to our SMTP provider. After blocking inbound DNS traffic from the 3 external IP addresses my state table went down to about 300 states and havent had an issue since. Im having the client run virus and malware scans on their PC's to see if there is a possible virus on their systems that was causing this issue. Thanks for all your help everyone

                            1 Reply Last reply Reply Quote 0
                            • stephenw10S
                              stephenw10 Netgate Administrator
                              last edited by

                              Hmm, interesting.
                              Incoming DNS queries should be blocked by default anyway (like anything else). I assume you hadn't opened port 53 deliberately.
                              Perhaps it's related to the on going record breaking DDOS against Spamhaus. They are using DNS amplification with open DNS servers, check you don't have some misconfigured dns server internally.
                              Interesting that the linksys router appeared less susceptible.  :-\

                              Steve

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.