您的电子邮件客户端是否允许您以编程方式添加自定义标头?
我正在开发一个反垃圾邮件项目(centmail),该项目涉及让发件人使用添加自定义的客户端插件标头(以及签名,但这部分更简单)。 一般问题是向外发邮件添加电子邮件标头,其中标头字段的内容是为每封邮件动态确定的。
令人惊讶的是,这在 Pine/Alpine 中似乎不可能。 Pine 允许您为外发邮件指定过滤器脚本,但只有正文而不是标头可以通过它。 您当然可以在 Pine 设置中定义自定义标头,但我认为没有办法动态更改它们的内容。
我很高兴听到如何在其他电子邮件客户端(Thunderbird、Outlook、Evolution、Mutt 等)中执行此操作。 当然,如果我对 Pine 的看法是错误的。
I'm working on an anti-spam project (centmail) that involves having the sender use a client plugin that adds a custom header (as well as a signature, but that part's easier). The general problem is to add an email header to your outgoing mail where the contents of the header field is determined dynamically for each message.
Surprisingly, this does not seem to be possible in Pine/Alpine. Pine lets you specify a filter script for outgoing mail but only the body and not the headers get passed through it. You can of course define custom headers in the Pine settings but I see no way to dynamically change the contents of them.
I'd be grateful to hear how to do this in other email clients (Thunderbird, Outlook, Evolution, Mutt, etc). And of course if I'm wrong about Pine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
您可以在 Eudora 中执行此操作。
您可以在 Outlook 中使用 自定义表单。
您可以在 Mozilla 的 about:config 中执行此操作。
You can do it in Eudora.
You can do it programmatically in Outlook with a custom form.
You can do it in Mozilla from about:config.
虽然它不是严格意义上的插件,但您可以创建一个代理 SMTP 服务器来修改电子邮件 - 例如 AVG 外发电子邮件扫描程序之类的东西。 这将具有与许多电子邮件客户端合作的优势; 您还可以制作一个插件,一侧与代理通信,另一侧与电子邮件 UI 通信。
Although it's not a plugin in the strictest sense, you could make a proxy SMTP server which would modify the e-mails - e.g. something like the AVG Outgoing E-mail Scanner. This would have the advantage of working with many e-mail clients; you could also make a plug-in which would communicate with the proxy on one side and the e-mail UI on the other.
Thunderbird 插件 Enigmail 控制外发邮件的标头。 所以这是一个存在证明,证明它在 Thunderbird 中是可能的。
The Thunderbird plugin Enigmail controls the headers for outgoing mail. So that's an existence proof that it's possible in Thunderbird.
我同意皮斯克沃尔的观点。 我会将其实现为代理 SMTP 服务器,这将带来许多好处:
I agree with Piskvor. I would implement it as a proxy SMTP server which would yield a number of benefits:
Emacs 可以通过编程来完成此操作。 您可以创建一个缓冲区(
get-buffer-create
),用标头信息填充它,然后以非交互方式调用mail-send
(设置mail-interactive
)代码> 到nil
)。与
mail-send
一起使用的缓冲区内容(标头+正文)示例:您还可以通过向
mail-send-hook
添加挂钩来更改每封外发电子邮件(标头+正文)代码>.Emacs can do this programmatically. You can create a buffer (
get-buffer-create
), fill it with header information, and callmail-send
non interactivelly (setmail-interactive
tonil
).Example of buffer content (header+body) to use with
mail-send
:You can also alter every outgoing email (header + body) by adding a hook to
mail-send-hook
.已经专门询问了有关 Thunderbird 的问题:
最上面的答案包含修改纯 xul/js 中标头的代码。
This has already been asked specifically about Thunderbird:
The top answer contains the code to modify the headers in plain xul/js.
我从 Brainunes 的旧部分中挖掘出这个内容...
我认为这种方法是去配置 SENDMAIL 并通过 [bash/etc] 脚本执行如果我理解正确。
根文件
http://snap.nlc.dcccd.edu/reference/sysadmin/ julian/ewtoc.html
SendMail 配置
标头声明
http://snap.nlc.dcccd。 edu/reference/sysadmin/julian/ch04/061-064.html#Heading22
http://snap.nlc.dcccd.edu/reference/sysadmin/julian/ch04/078-080.html
I dug this from the old parts of Brain tunes to other things...
I think that approach is to go to config SENDMAIL and do via [bash/etc] scripting if i understand correctly.
Root file
http://snap.nlc.dcccd.edu/reference/sysadmin/julian/ewtoc.html
SendMail Configuration
Header Declarations
http://snap.nlc.dcccd.edu/reference/sysadmin/julian/ch04/061-064.html#Heading22
http://snap.nlc.dcccd.edu/reference/sysadmin/julian/ch04/078-080.html
我想到,由于 pine 是开源的,如果这个功能对您来说对于这个程序很重要,您可以尝试为该项目做出贡献以添加该功能。
It occurs to me that since pine is open source, if this functionality is important to you for this program you could try contributing to the project to add the feature.
您可能想要研究的一件事是使用伪标头而不是标头。 因为 pine/alpine 让您指定电子邮件要经过的过滤程序,所以您可以在开头将标头添加到正文中,这应该很容易处理。 我不确定它是否完全符合您的目的,因为我不知道您要组合什么类型的系统。
我通过在 Debian BTS 系统 中使用伪标头了解了它们。
回答这个问题,我使用 GMail,并且您无法以编程方式编辑标头(我有兴趣看到可以让您编辑的网络邮件)。 您甚至无法过滤像X-List这样的自定义标头,这非常烦人。
One thing that you might want to look into is using pseudo-headers instead of headers. Becasue pine/alpine let you specify a filter program for the email to go through, you can add the header to the body at the beginning, which should be easy enough to process. I'm not sure if it would fit your purposes exactly though since I do not know what type of system you are putting together.
I learned about pseudo-headers through their use in the Debian BTS System.
Answering the question, I use GMail, and you can't edit the headers programmatically (I would be interested to see a webmail that lets you). You can't even filter on custom headers like X-List, it's quite annoying.
将邮件客户端插入自定义标头的一般想法有问题。
那里有很多客户。 包括不同的版本、不同的系统。
header+body 格式背后的好处是所有非用户、服务器和路由特定数据对用户隐藏。 遵循这个想法很重要。 我认为用户不应该被一些自定义的、服务器相关的标头所困扰。
此外,您尝试附加的数据实际上是用户特定的数据。
就像签名一样。 它验证发送者的有效性。 没有理由向用户隐藏它。
电子邮件数据的签名是众所周知的过程,由 PGP、SMIME 等使用。可能有更多的邮件客户端允许此类操作(通过外部程序验证和签名),而不是允许添加或修改自定义邮件标头。
自定义标头应由邮件服务器修改; 邮件客户端的用户数据。
我认为你应该把你的数据放在消息或消息部分。
Something is wrong with general idea to plug mail clients for custom headers.
There is just to many clients out there. Including different versions, on different systems.
Good thing behind header+body format is that all non-user, server and routing specific data is hidden from the user. And that idea is important to follow. I don't think that user should be bothered with some custom, server related headers.
Also, the data that you are trying to append is, in fact, user specific data.
Like signature. It verifies validity of sender. There is no reason to hide it from user.
Signing of email data is well-known process, used by PGP, SMIME, etc. There is probably more mail clients allowing such actions (verify and sign by external programs) than allowing to add or modify custom mail headers.
Custom headers should be modified by mail servers; user data by mail clients.
I think that you sholud put your data in message or message part.
使其在 pine 中工作而不修改 pine 本身或修改邮件服务器的一种方法是让 pine 通过命令行程序(传统上 /usr/sbin/sendmail 等)进行传递,并让被调用的程序成为原始程序的包装器程序。 然后您可以添加您需要的任何标头。
虽然这很丑陋,但它肯定无法扩展到整个用户群。
One way to make it work in pine without modifying pine itself or modifying the mail server is to have pine deliver via a command line program (traditionally /usr/sbin/sendmail or the like) and have the called program be a wrapper for the original program. Then you can add whatever header you need.
That's ugly though, it certainly wouldn't scale for a whole user base.
对于所有支持使用外部编辑器的邮件客户端,您可以使用一个脚本将特定标头添加到发送到编辑器的模板中。 在 mutt 中,有一个配置参数,名为
edit_headers
添加一组通用的标头,以便轻松添加您自己的标头。 还有另一个参数,名为my_hdr
可以使用。 Mutt 确实支持“反引号”符号来运行外部命令。能够指定自己的模板会更好,但目前还不可能。
For all mail clients that support using an external editor, you could have a script that add a specific header to the template that gets send to the editor. In mutt, there is a configuration parameter called
edit_headers
that add a common set of headers so it would be easy to add your own. There is also another parameter calledmy_hdr
which could be used. Mutt does support the ` backtick `` notation to run external commands.It would be better to be able to specify one's own template but it is not possible yet.