在我使用的系统上,sendmail会检查〜/ .forward文件,所以我在~username / .forward中有这个
# pipe incoming mail to procmail# ref: http://www.panix.com/~elflord/unix/procmail.HTML# ref: http://porkmail.org/era/procmail/mini-faq.HTML#forward"|IFS=' ' && p=/usr/local/bin/procmail && test -x $p && exec $p -f- || exit 75 #username"
然后,~username / .procmailrc包含:
# procmail tutorial: http://tldp.org/LDP/LG/issue14/procmail.HTMLPATH=/usr/local/bin:/bin:/usr/binMAILDIR=$HOME/MailDEFAulT=$HOME/Mail/inBoxLOGfile=$HOME/procmail.`date +%Y-%m`.logSHELL=/usr/bin/kshMY_XLOOP='X-Loop: username@hostname.subdomain.example.com'MY_RECIPIENT='mailing.List@example.com'############################################################################## if the email comes from the clIEnt with a specific Subject,# send a copy of the message to the processing script,and # carry on with the next recipe:0c* ^From:.*@clIEntdomain\.invalID* ^Subject:.*Account.*(Request|Access|Approval)| $HOME/bin/process_account_request_email.pl | \ mailx -s "Account request results" $MY_RECIPIENT############################################################################## forward all mail to mailing List:0* ! ^$MY_XLOOP{ # add a header # 'f' = filter: pass message to program and continue processing results # 'h' = pass message headers to program # 'w' = wait for program to return :0fhw | formail -A "$MY_XLOOP" # then forward the message # 'c' = send a copy to recipIEnt and continue processing :0c ! $MY_RECIPIENT}# if we get here,then the message has an X-Loop header.# let it fall into $DEFAulT总结
以上是内存溢出为你收集整理的linux – 使用mailx和bash脚本解析邮件的正文全部内容,希望文章能够帮你解决linux – 使用mailx和bash脚本解析邮件的正文所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)