简体   繁体   English

procmail如何知道邮件文件所在的位置?

[英]How does procmail know where the mail file exists?

I inherited some software that somebody else wrote that uses procmail with which I have no experience. 我继承了其他人编写的某些软件,这些软件使用的procmail我没有经验。
When I run procmail it seems to just sit there. 当我运行procmail时,它似乎就坐在那儿。 I'm assuming it is looking the mail file in a particular location, but I'm not exactly sure where that is. 我假设它正在特定位置查找邮件文件,但我不确定该在哪里。

If I go in to my mail client (mail on linux), I can see I have two messages (unread) there, but procmail does not seem to be processing it. 如果我进入邮件客户端(Linux上的邮件),可以看到我有两条消息(未读),但是procmail似乎没有处理它。
My default mail file location is in /var/mail/<myUsername> . 我的默认邮件文件位置在/var/mail/<myUsername>

Is procmail looking in some other location? procmail是否在其他位置查找? How do I tell procmail where to look for the mail file? 如何告诉procmail在哪里寻找邮件文件?

Sounds like you are not invoking Procmail correctly. 听起来您未正确调用Procmail。 The usual way is by creating a file .procmailrc . 通常的方法是通过创建文件.procmailrc If your sysadmin is not running Procmail as the default LDA, you may also need to create a .forward or similar. 如果您的系统管理员未将Procmail作为默认的LDA运行,则可能还需要创建.forward或类似文件。

It will not handle any existing mail, but it will be hooked in when new mail arrives. 它不会处理任何现有邮件,但是会在收到新邮件时将其挂接。 You can process old mail via formail -s procmail but that's not how you usually deploy it. 您可以通过formail -s procmail处理旧邮件, formail -s procmail不是通常的部署方式。

If you run it from the command line, it will be expecting an email message on standard input. 如果您从命令行运行它,它将在标准输入中期待一封电子邮件。 If you don't know how to type in an RFC822-compatible message, you could be messing up your inbox, although it's probably not very hard to clean up. 如果您不知道如何输入与RFC822兼容的消息,则可能会弄乱收件箱,尽管清理起来可能并不难。

procmail -v will reveal how it was configured at compile time, including the default mail location. procmail -v将显示在编译时如何配置它,包括默认的邮件位置。

See also http://porkmail.org/era/mail/procmail-debug.html 另请参阅http://porkmail.org/era/mail/procmail-debug.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM