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

    Postfix slow email delivery

    Scheduled Pinned Locked Moved pfSense Packages
    4 Posts 3 Posters 2.9k Views
    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.
    • A
      ant2ne
      last edited by

      After setting up postfix, users are complaining that it takes too long to receive emails. It can take half a day or more after an email is sent. Why is this, and how can I fix it?

      1 Reply Last reply Reply Quote 0
      • B
        biggsy
        last edited by

        If you look at the postfix logs you'll see that it temporarily rejects a remote mail server's first attempt to send and replies with the message "Service currently unavailable".  However, postfix saves the IP address for a period (1 day by default) and will pass the message the second time through.  This is to stop spam bots, which rarely try more than once.

        Postfix learns the IP addresses of (good) remote mail servers over time but many ISPs and big companies have lots and lots of servers.  The emails temporarily rejected by postfix may get passed on to another mail server in the same organization and that server tries later, only to receive the same "temporarily unavailable" message because its IP address hasn't been seen before.  That can happen two or three times for one email.

        I recently encountered a mail server that didn't try to resend for six hours after its first attempt.  That sort of misconfiguration at the sender's end can have an impact too.

        To build up a longer list of mail servers that don't send to your mail server very often, you need to extend the default period for which IP addresses are cached (which I think is seven days also 1 day).  
        Make an entry in custom main.cf options like:

        postscreen_cache_retention_time = 30d
        

        Unfortunately, postfix still as to learn the IP addresses and that can take a while.  It will get faster as it learns more IP addreses though.

        1 Reply Last reply Reply Quote 0
        • jimpJ
          jimp Rebel Alliance Developer Netgate
          last edited by

          …and that's why greylisting isn't very popular for people who want to treat e-mail like an IM… :-)

          Most things will retry within 20-30 minutes the first time, but there are plenty of servers out there that would take longer, or would try from constantly-changing IPs.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • A
            ant2ne
            last edited by

            Thanks for that information. And thanks for the tip. I added that custom main.cf options. I will continue testing and see if things improve.

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