Receive email after x number or retry to deliver

Questions and answers about how to do stuff
Post Reply
mendark
Posts: 24
Joined: 03 Dec 2021 10:10

Receive email after x number or retry to deliver

Post by mendark »

Hello,
It's possible to customer receive an email after 2 or 3 retry, when email is in deferred state?

Thank you
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Receive email after x number or retry to deliver

Post by pdwalker »

I am not sure I understand your question.
mendark
Posts: 24
Joined: 03 Dec 2021 10:10

Re: Receive email after x number or retry to deliver

Post by mendark »

So, user from domain example.com send an email to example.eu but email not delivered, stay in queue and after 3 retry email is still in queue. I want to user@example.com receive an email from efa to inform that email is in queue but efa try to deliver de email.
Did you understand now?

Thank you
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Receive email after x number or retry to deliver

Post by pdwalker »

I see.

Normally that completely under the control of the MTA (mail transfer agent) that handles the delivery and redelivery of mail that is queued.

Do you know why the mail is not being delivered? Usually when there is a delivery problem, the mail system will give you some reason, which you can find in the logs, or by using the mailq command.

I am not completely clear on your example, but let me describe two scenarios:



1/ sending mail to the internet
internal user sends email -> efa4 -> somewhere else

If the mail is in the queue because it cannot be delivered, then the "mailq" command will list all the queued messages and the last error as to why they cannot be delivered.

Usually if a message cannot be delivered to a 3rd party, it'll be for reasons that are beyond our control - their mail server is down, DNS problems, some other reason. Rarely does it occur because of a fixable problem on our side.

There are postfix configuration options to send notifications to the sender of an email if an email is queued. You can find them described here: https://www.postfix.org/postconf.5.html

For example, in my system, I set "delay_warning_time = 15m" and "confirm_delay_cleared = yes" so the senders will be notified when a message is delayed for more than 15 minutes and when that message is eventually delivered.


2/ the internet delivers mail to the internal user
internet mail -> efa4 -> internal user

Now if the mail is getting queued and not delivered to our internal user, then we should be able to fix these problems. Perhaps my internal user mail server is down for maintenance? Whatever it is, we should be able to diagnose and fix the problem as it is on our network.

Again, the "mailq" command can be used to find out why EFA4 is not delivering the message.

EFA will not be able to notify our internal user that there is mail waiting for them because that would require sending an email - and we already know we cannot send email.

postfix, using the parameters described in #1 above, can send a message back the sender telling them that the message delivery is delayed, but that's about it.


Does that explanation help any?
mendark
Posts: 24
Joined: 03 Dec 2021 10:10

Re: Receive email after x number or retry to deliver

Post by mendark »

Hello,
It's ok now, i understand. I have set delay_warning_time, but i put 1h :D

Thankyou so much.
Post Reply