fetchmail / postfix - Bounce-Nachricht, wenn sie zu groß ist

1818
JeffRSon

Ich habe einen Ubuntu-Mail-Server, der E-Mails von ISP über fetchmail abruft und über Amavis und Postfix ausliefert.

Postfix hat eine Größenbegrenzung von etwa 20 MB. E-Mails, die größer als diese sind, werden vom Server entfernt, wurden aber bisher stillschweigend gelöscht, da / etc / fetchmailrc keine Definition für Postmaster hatte und "set no bouncemail" enthielt.

Ich möchte den Absender über die abgelehnte Mail informieren. Aber der Kommentar zu "Set no bouncemail" ("Vermeiden Sie Verlust bei 4xx-Fehlern.") Lässt mich denken, dass es gefährlich oder unklug sein könnte, es in "set bouncemail" zu ändern. Wie ist dieser Kommentar zu verstehen?

Gibt es eine Möglichkeit, diese Bounce-Nachricht anzupassen? Es scheint aus "Mail" zu stammen und enthält ein paar lokale Informationen, die für den Absender der zu großen Nachricht nutzlos erscheinen.

Wenn man weiter darüber nachdenkt, scheint es dumm zu sein, so große Nachrichten herunterzuladen, zu verarbeiten und dann abzusenden. fetchmail hat eine Option, um die Größe der herunterzuladenden Nachrichten zu beschränken. In diesem Fall kann ich jedoch nicht herausfinden, wie eine Bounce-Nachricht gesendet wird (und die Nachricht bleibt auf dem Server). Gibt es eine Möglichkeit, den Trick zu machen?

1

1 Antwort auf die Frage

2
VL-80

I do not see any problem for using set bouncemail. As per manual page:

set bouncemail Direct error mail to the sender (default) set no bouncemail Direct error mail to the local postmaster (as per the ’postmaster’ global option above). 

On my understanding comment "Avoid loss on 4xx errors." could mean following:

Errors starting on number 4 are temporary errors. Errors 4xx are not fatal errors and mean "I have a small problem at moment and can not process your message, you should try later". Example of this error would be 451 Temporary lookup failure. In this case sender server (if configured correctly per RFC) will try to deliver the message again later. If by the time of next attempt problem on receiving server will be solved - message will be delivered. If problem persists - than again it will give 451 Temporary lookup failure. This scenario will continue until message will expire (which is separate setting for mail server).

Now, how this can be applied to our situation. Let's say someone's server is not configured properly and thus on receiving 4xx error it will not try later - it will just delete the message. And he sends you e-mail while you have temporary lookup problem. So your postfix returns 451 error. Sender's server receives 451 error and stops any further attempts to deliver it (which is WRONG). At this point you lost your e-mail letter because you had temporary problem AND because of wrong configuration of another server.

So, fetchmail is trying to avoid the problem by not bouncing e-mail back in case of 4xx errors. Since it is already downloaded and it is already on your computer it does make some sense to just keep the message and not send it back.

Just enable set bouncemail and do not worry about anything, since majority of mail servers have proper (per RFC ) configuration and they will try to deliver messages again. You will have 1-5% chances to lost 1 e-mail in a while from wrong configured mail server.

On this:

On further thinking it seems to be silly to download such large messages, process and then bounce them. fetchmail has an option to limit the size of messages to be downloaded, but I cannot figure out how to send a bounce message in this case (and the message stays on server). Is there any way to do the trick?

Fetchmail must download the message if you want postfix to process the message. If fetchmail will not download the message - postfix will never see it. I doubt fetchmail will inform sender about that. If you want to inform sender about that - you have to have fetchmail to download the message and give it to postfix.

Another possible option - fetchmail downloads messages from somewhere (IMAP/POP3). If you have control over this POP3 account - set limit there and it will work as well.

Sehr hilfreich! Zum zweiten Teil - Es ist klar, dass Postfix die Nachricht nicht verarbeiten kann, wenn Fetchmail sie nicht heruntergeladen hat. Aber IMO, wenn die Nachricht zu groß ist, was Fetchmail genau weiß, muss Postfix überhaupt nicht laufen. Fetchmail könnte entscheiden, "Nachricht ist zu groß - ignorieren Sie sie und / oder löschen Sie sie und senden Sie eine Benachrichtigung". - Leider gibt es keine Einstellung auf dem Server, um die Größe einzuschränken. Dies wäre in der Tat die beste Lösung gewesen. JeffRSon vor 10 Jahren 0