Postfix deferred email - How to expire so bounce-back email gets sent back

9,010

Use postqueue -f as root to flush the entire queue; this will cause delivery to be re-tried.

If the remote server really reports a 550, then the messages will not be deferred; they will be rejected, and your postfix server will instantly bounce them.

If this does not seem to be happening, make sure you do not have soft_bounce = yes set:

postconf soft_bounce

On any production server, the soft_bounce setting needs to be no.

Share:
9,010

Related videos on Youtube

WJR
Author by

WJR

learning something new...

Updated on September 18, 2022

Comments

  • WJR
    WJR almost 2 years

    My hosted email server is "Refusing to talk : 550" with my postfix server. Gmail, Yahoo, Hotmail all accepts them fine. All of sudden hosted email provider decided not accept email from my server. I dont really know why... i dont send out spam nor have large volumes.

    Anyways, now they want me to get a bounce-back email. All the email in question are in mailq (deferred)

    How do I expire them so that postfix will send out "unable to send" to mail clients who sent them?

    I dont want to delete them...

    Thanks for the help in advance

  • WJR
    WJR over 11 years
    well, messages are in deferred (not bounced). I believe if I set "maximal_queue_lifetime = 30m", and do postqueue -f. postqueue -f will flush and attempt to send/resend messages. So in theory, anything in deferred(queue) longer than 30 min should get bounced. What do you think?
  • WJR
    WJR over 11 years
    I couldnt test out maximal_queue_lifetime setting. For now, I've changed email server to relay, then did postqueue -f which did resend the messages. (To be clear, this did not bounce messages. Rather msgs were just relayed to a server which is accepting relay, which forwarded it to my hosted email server)
  • adaptr
    adaptr over 11 years
    Please re-read the above: IF the messages are REJECTED with a 550 status, they will only be deferred IF you have soft_bounce set.
  • WJR
    WJR over 11 years
    I didn't mean to question your statement, really... But for my case, mail.log shows "Oct 31 18:04:14 mail1 postfix/smtp[15566]: 901241C0C81: host spam3.ihostexchange.net[66.46.182.94] refused to talk to me: 550 Connection refused" And the same email was in mailq! Anyways... Thank you for your help.
  • adaptr
    adaptr over 11 years
    Then soft_bounce = yes on your server. This is ill-advised.
  • WJR
    WJR over 11 years
    Just to update in case someone has same problem. My ip was blacklisted on Barracuda database. To remove : barracudacentral.org/rbl/removal-request
  • BeowulfNode42
    BeowulfNode42 over 7 years
    What about on a production server the ones where status=deferred (connect to not-an-email-server.net[some-ip]:25: Connection refused) and you want the user to receive and NDR because you know the server name they used is wrong?