我需要在收到特定主题的电子邮件时启动一个脚本,我尝试了 fetchmail + procmail,这是我的配置
.fetchmailrc
set no bouncemail
defaults:
antispam -1
batchlimit 100
poll imap.googlemail.com protocol IMAP auth password
user "[email protected]" is root here
password 'xxxxx'
ssl
mda "/usr/bin/procmail -f %F -d %T";
.procmailrc
PATH=/bin:/usr/bin:/usr/local/bin:$HOME/bin:/usr/sbin
MAILDIR=/var/mail
LOGFILE=/var/log/procmail.log
:0
* ^Subject: "Test OK"
| echo "Test" >> /var/log/test.log
当发送主题为的邮件时Test OK
,我在 procmail 日志中看到以下行:
From [email protected] Sat Dec 8 18:41:16 2018
Subject: Test OK
Folder: /var/mail/root 5304
但没有执行echo
,有什么想法吗?谢谢