如何从我的.forward文件中运行脚本中的电子邮件?

时间:2022-02-14 20:12:16

I am writing a script to handle an automated email inbox. I've never really dealt with mail servers before, but have gotten to a point where every email sent is executing my script. I am using a .forward file in the home directory of the recipient user that looks like this:

我正在编写一个脚本来处理自动电子邮件收件箱。我以前从未真正处理过邮件服务器,但已经达到了每个发送的电子邮件都在执行我的脚本的程度。我在收件人用户的主目录中使用.forward文件,如下所示:

"|exec /home/[MY USER]/magic || exit 75 #[MY USER]"

The script simply takes it's input and writes it to a file at this point. The problem is, I don't know how to find the email being sent, and I can't seem to find any documentation on how the .forward-file works in detail. How do I get to the email?

脚本只需将其输入并在此时将其写入文件。问题是,我不知道如何找到发送的电子邮件,我似乎无法找到有关.forward文件如何工作的任何文档。我如何收到电子邮件?

Any help is greatly appeciated :)

任何帮助是非常明确的:)

1 个解决方案

#1


Some general information about the ~/.forward file and the interaction with the mail server is described here, and the Filtering Mail FAQ also contains some information.

此处描述了有关〜/ .forward文件和与邮件服务器交互的一些常规信息,Filtering Mail FAQ也包含一些信息。

While just using a dot-forward file might be sufficient you very typically want to use procmail for more powerful mail processing.

虽然只使用点前转文件可能就足够了,但您通常希望使用procmail进行更强大的邮件处理。

#1


Some general information about the ~/.forward file and the interaction with the mail server is described here, and the Filtering Mail FAQ also contains some information.

此处描述了有关〜/ .forward文件和与邮件服务器交互的一些常规信息,Filtering Mail FAQ也包含一些信息。

While just using a dot-forward file might be sufficient you very typically want to use procmail for more powerful mail processing.

虽然只使用点前转文件可能就足够了,但您通常希望使用procmail进行更强大的邮件处理。