procmail

Automatic procmail filter based on username

大憨熊 提交于 2021-01-29 12:47:56
问题 I use postfix and procmail for mail and folder filtering. I have a main address and a bunch of alias addresses that go to it, then I sort the username to a folder that matches. For example I have the main address of 'address@domain.com" and a alias of "customer1@domain.com" pointing to it, and I have a folder called 'customer1' under 'address@domain.com' and a script like the following in .procmailrc - :0: * ^(To|Cc).*customer1@domain.com .customer1/ and it works fine, but every time I add a

Procmail setup, to execute PHP script

喜欢而已 提交于 2021-01-24 19:12:24
问题 I've got a procmail setup working pretty well, seems to be executing my PHP script no problem when it receives an email. Here is an example of the .procmailrc file: #BEGIN PROCMAIL SCRIPT FOR MAIL PARSING DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir PMDIR=$HOME/.procmail LOGFILE=$PMDIR/log.`date +%y-%m-%d` SHELL=/bin/sh :0 |`/usr/local/php53/bin/php /home/usrmail/email/script.php` The log output below: From x13542053@homiemail-mx22.g.dreamhost.com Mon Feb 18 20:49:35 2013 Subject: TEST Folder

Procmail setup, to execute PHP script

。_饼干妹妹 提交于 2021-01-24 19:08:41
问题 I've got a procmail setup working pretty well, seems to be executing my PHP script no problem when it receives an email. Here is an example of the .procmailrc file: #BEGIN PROCMAIL SCRIPT FOR MAIL PARSING DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir PMDIR=$HOME/.procmail LOGFILE=$PMDIR/log.`date +%y-%m-%d` SHELL=/bin/sh :0 |`/usr/local/php53/bin/php /home/usrmail/email/script.php` The log output below: From x13542053@homiemail-mx22.g.dreamhost.com Mon Feb 18 20:49:35 2013 Subject: TEST Folder

Procmail setup, to execute PHP script

岁酱吖の 提交于 2021-01-24 19:08:36
问题 I've got a procmail setup working pretty well, seems to be executing my PHP script no problem when it receives an email. Here is an example of the .procmailrc file: #BEGIN PROCMAIL SCRIPT FOR MAIL PARSING DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir PMDIR=$HOME/.procmail LOGFILE=$PMDIR/log.`date +%y-%m-%d` SHELL=/bin/sh :0 |`/usr/local/php53/bin/php /home/usrmail/email/script.php` The log output below: From x13542053@homiemail-mx22.g.dreamhost.com Mon Feb 18 20:49:35 2013 Subject: TEST Folder

Procmail setup, to execute PHP script

不羁岁月 提交于 2021-01-24 19:08:07
问题 I've got a procmail setup working pretty well, seems to be executing my PHP script no problem when it receives an email. Here is an example of the .procmailrc file: #BEGIN PROCMAIL SCRIPT FOR MAIL PARSING DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir PMDIR=$HOME/.procmail LOGFILE=$PMDIR/log.`date +%y-%m-%d` SHELL=/bin/sh :0 |`/usr/local/php53/bin/php /home/usrmail/email/script.php` The log output below: From x13542053@homiemail-mx22.g.dreamhost.com Mon Feb 18 20:49:35 2013 Subject: TEST Folder

Procmail setup, to execute PHP script

陌路散爱 提交于 2021-01-24 19:06:20
问题 I've got a procmail setup working pretty well, seems to be executing my PHP script no problem when it receives an email. Here is an example of the .procmailrc file: #BEGIN PROCMAIL SCRIPT FOR MAIL PARSING DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir PMDIR=$HOME/.procmail LOGFILE=$PMDIR/log.`date +%y-%m-%d` SHELL=/bin/sh :0 |`/usr/local/php53/bin/php /home/usrmail/email/script.php` The log output below: From x13542053@homiemail-mx22.g.dreamhost.com Mon Feb 18 20:49:35 2013 Subject: TEST Folder

How do I use Procmail with PHP?

只愿长相守 提交于 2020-01-07 06:52:17
问题 I'm trying to use procmail to send emails to a PHP script so the script will check a MySQL database and edit the subject line based on the sender email. I believe I've got a working procmail to do this: :0: * ^To:.*@barrett.com ! '/usr/local/bin/php-5.2 -f $HOME/ticket/emailcustcheck.php' However, I'm not sure exactly how procmail executes the command. How does the email get passed to the PHP script, and therefore, how do I refer to it inside the script? 回答1: The correct syntax for piping to

Extract text from “content-disposition: attachment” body part

蓝咒 提交于 2020-01-07 06:15:23
问题 I regularly receive a generated email message containing a text part and a text attachment. I want to test if attachment is base64 encoded, then decode it like: :0B * ^(Content-Transfer-Encoding: *base64(($)[a-z0-9].*)*($)) { msgID=`printf '%s' "$MATCH" | base64 -d` } But it always say invalid input, anyone know what's wrong? procmail: Match on "^()\/[a-z]+[0-9]+[^\+]" procmail: Assigning "msgID=PGh0b" procmail: matched "^(Content-Disposition: *attachment.*(($)[a-z0-9].*)* |Content-Transfer

How to put some text into procmail forwarded e-mail?

久未见 提交于 2020-01-06 07:21:34
问题 For a couple of days, I've been trying to write procmail script. I want to forward messages, and inject some text into message contents. What I want to accomplish : someone send me e-mail, with word "weather" in the subject email is forwarded to address "mymail@somedomain.com" every forwarded email gets some added text in contents But so far, no success. In .procmail.log , there's a message "procmail: Missing action" SHELL=/bin/bash VERBOSE=off LOGFILE=/home/test/.procmail.log LOGDATE_=`/bin

How to make procmail forward and BCC too

こ雲淡風輕ζ 提交于 2020-01-06 06:03:53
问题 I'm trying to forward e-mails matching a certain pattern to a set of addresses, and BCC the same e-mail to some other e-mail addresses. From looking at my procmail log, it appears that all my rules are matching, yet the BCC recipient does not receive the message. The relevant lines of my .procmailrc look like this: :0fhw * ^From.*@example.com * ! ^X-Loop: test | formail -A "Bcc: $BCCS" :0fhw * ^From.*@example.com * ! ^X-Loop: test | formail -A "X-Loop: test" :0 * ^From.*@example.com * ! $DEST