procmail 并发送到 IMAP 服务器?
我运行自己的邮件服务器。它使用 procmail 来过滤传入的邮件,然后将其存储在 maildirs 中并使用 IMAP 从我的 MUA 中获取服务。我有大约 1.5GB 的电子邮件,即 135000 个索引节点。
这一切都非常有效。然而,我宁愿停止使用 maildir 并切换到更有效的东西 --- maildb 或 Dovecot 的 dbox,例如。不幸的是,procmail 只能传送到非常有限的一组后备存储格式(Maildir、MH 和 mbox、AFAICT)。
我真正想做的是说服 procmail 通过 IMAP 发送电子邮件,而不是直接将其写入后备存储;这意味着我可以随时更改后备存储格式,而无需重新配置 procmail。但我找不到任何方法可以做到这一点。有什么想法吗?
(我也对任何其他像 procmail 但支持 IMAP 的邮件过滤工具感兴趣。我知道的唯一其他过滤工具是 maildrop --- 但它与 procmail 具有类似的限制。)
I run my own mail server. It uses procmail to filter incoming mail, which is then stored in maildirs and gets served out my MUA using IMAP. I've got about 1.5GB of email is 135000 inodes.
This all works very nicely. However, I'd rather like to stop using maildir and switch to something more efficient --- maildb, or Dovecot's dbox, for example. Unfortunately, procmail can only deliver to a very limited set of backing store formats (Maildir, MH and mbox, AFAICT).
What I'd really like to do is to persuade procmail to deliver email via IMAP, rather than writing it directly to the backing store; this means that I can change the backing store format whenever I like without needing to reconfigure procmail. But I can't find any way of doing this. Any ideas?
(I'm also interested in any other mail filter tools that work like procmail but support IMAP. The only other filter tool I know is maildrop --- but that has similar restrictions to procmail.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,这是一个正确的解决方案。
Cone 项目(http://www.courier-mta.org/cone/cone00index.html,Debian 项目:cone)有一个非常方便的工具,称为
mailtool
,它可以在邮箱类型之间复制文件,包括远程 IMAP 服务器。因此,要将邮件传递到远程邮箱,您需要一个脚本:
mailtool -tofolder destinationfolder -copyto imaps://username :[email protected] mbox:/full/path/to/message.mbox
然后将上传邮件。
我实际上不需要再这样做了,所以没有准备好的脚本来发布,但是在可用的八九个不同的 IMAP 工具中,这是唯一一个实际上可以做到这一点的工具,因此值得记录下来。
Okay, here's a proper solution.
The cone project (http://www.courier-mta.org/cone/cone00index.html, Debian project: cone) has a very handy tool called
mailtool
which will copy files between mailbox types, including remote IMAP servers.So, to deliver a message to a remote mailbox, you need a script which:
mailtool -tofolder destinationfolder -copyto imaps://username:[email protected] mbox:/full/path/to/message.mbox
That will then upload the message.
I don't actually need to do this any more so don't have a prepared script to post, but of the eight or nine different IMAP tools available, this was the only one that would actually do this, so it's worth documenting as such.
作为我自己问题的部分答案,Dovecot 似乎确实配备了专门为此类事情设计的
deliver
工具;它在 procmail 中运行,带有如下一行:...它会自动计算出所有其余的设置。
所以现在我可以更改 Dovecot 邮件存储格式,一切仍然有效;但我仍然喜欢一种实际使用 IMAP 传递消息的方法,这样我就可以尝试 Dovecot 之外的 IMAP 服务器。
As a partial answer to my own question, it seems that Dovecot does come with a
deliver
tool specifically designed for this kind of thing; it works from procmail with a line like:...and it figures out all the rest of the settings automatically.
So now I can change the Dovecot mail storage format and everything will still work; but I'd still like an approach that actually uses IMAP to deliver the messages, so that I can try IMAP servers other than Dovecot's.