Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an Ubuntu mail server that retrieves mails from ISP by fetchmail and delivers it through amavis and postfix.

Postfix has a size limit of about 20MB. Mails larger than this are removed from server, but have been silently deleted so far, because /etc/fetchmailrc had no definition for postmaster and contained "set no bouncemail".

I'd like to inform the sender about the rejected mail. But the comment for "set no bouncemail" ("Avoid loss on 4xx errors.") makes me think it could be dangerous or unwise to change it into "set bouncemail". How should this comment been understood?

Is there any way to customize that bounce message? It appears to originate from "Mail" and contains a couple of local information that seems to be useless for the sender of the too large message.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
Very helpful! On the second part - It's clear that Postfix cannot process the message if Fetchmail didn't download it. But IMO, if the message is too large, what Fetchmail clearly knows, Postfix does not need to run at all. Fetchmail could decide "Message is too large - ignore it and/or delete it and send a notification". -- Unfortunately there's no setting on the server to restrict the size. This would've been the best solution indeed. –  JeffRSon Aug 16 '13 at 20:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.