我有 Postfix(3.6.3)将用户的邮件转发到脚本
maild: "| /usr/local/sbin/mailsave"
这些邮件有多余的 From 和 id 行,会破坏 Python 的 email.Parser
您能阻止 Postfix 添加这些行吗?
From [email protected] Sun Nov 21 19:11:19 2021
Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: by host.my.tld (Postfix, from userid 1001)
id D3DFD783; Sun, 21 Nov 2021 19:11:19 +0100 (CET)
To: [email protected]
Subject: s1
Message-Id: <[email protected]>
Date: Sun, 21 Nov 2021 19:11:19 +0100 (CET)
From: Jürgen Weber <[email protected]>
body
答案1
mailsave 脚本中存在一个错误,该错误删除了 id 行之前的空格,因此邮件解析器失败。