Postfix: how to return mail to sender when recipient is misspelled?

Discussion in 'Server Operation' started by recin, Feb 25, 2020.

  1. recin

    recin Active Member

    I have a Ubuntu 18.04 server with dovecot & postfix.
    Sometimes I check mail queue and I have something like this:
    Code:
    -Queue ID-  --Size-- ----Arrival Time---- -Sender/Recipient-------
    ABCDE1234    41379 Mon Feb 24 18:08:05  [email protected]
               (connect to gmal.com[192.168.255.255]:25: Connection timed out)
                                             [email protected]
    A client misspelled mail recipient (gmal instead of gmail) and this is stuck on queue.
    How can I config postfix to send mail to sender informing of the error instead of getting this on queue?
    Thanks in advance
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    The typo domain gmal.com exists, so postfix tries to deliver. With usual settings, it gives up trying after 5 days, and then the sender is notified of the no delivery.
    If you set up your postfix to immediately notify user, it creates unnecessry notices. It is common that mail can not be delivered at first try.
    I bet if you test with recipient address where the domain does not exist you get immediate notice to the sender.
    If you want to solve this problem in a useful way, you have to come up with something clever. I do not know a solution that would not cause more problems than it solves.
     
  3. recin

    recin Active Member

    Sorry. I was mistaking wrong non existing domain with wrong user on existing domain, in wich case I receive response (and send it too when wrong recipient user is own domain).
    Thanks
     

Share This Page