我们使用qmail作为邮件服务器。
如果用户发送一封无法发送的邮件,他会收到一封qmail的消息,内容是关于这个错误的一些细节。
Hi. This is the qmail-send program at our.server.tld I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. <[email protected]>: 123.123.123.123 failed after I sent the message. Remote host said: 552 5.3.4 Message is too large, rejected. --- Below this line is a copy of the message. ... header information ... ... message ... ... attachments in base64 ... ------_=_NextPart_001_000A0F27.508A4479-- ------_=_NextPart_000_000A0F27.508A4479 Content-Type: application/pdf; name="file.pdf" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="file.pdf"; modification-date="Wed, 24 Oct 2012 14:27:24 +0000" JVBERi0xLjUNCiXi48/TDQo0IDAgb2JqDQo8PA0KL1R5cGUgL1BhZ2UNCi9QYXJlbnQgMiAwIFIN Ci9Db250ZW50cyA1IDAgUg0KL01lZGlhQm94IFstMC4wMDAwIC0wLjAwMDAgMTcwMC43ODc0IDIy ...
带有标题和消息信息的消息的副本是很好的。 但是,是否有可能告诉qmail不要包含完整的附件到这个错误信息? 这是一个很大的开销,最好将消息的大小限制在几kb,因为用户无论如何都不能对base64stream做任何事情。
据我所知,在香草Qmail中没有办法做到这一点。 DJB有自己奇怪的想法应该如何工作。 当然,就像QMail世界中的其他一切,有一个补丁大概是你想要的。 如果您已经在使用JMS的组合补丁,它已经包含在那里。
这不是一个完美的解决scheme,但如果它足够重要,你可以打补丁和更新你的qmail安装,你可以考虑它。