我们使用 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,因为用户无论如何都无法对 base64 流执行任何操作。