J
Jason_I_Am
Guest
Hi
I have a Fedora Core 2 setup with Plesk 7.5 Reloaded and qmail as my MTA.
I am trying to use Procmail to filter certain types of mails however no matter what I try, I can't get it to work properly.
Let's say I have my mails set up in:
/var/qmail/mailnames/<DOMAIN>/<USER>/
I want to set up a procmail script in the <DOMAIN> directory which will filter mails for every user for that domain. I've edited my .qmail-default file to include the line:
|preline /usr/bin/procmail -m -p .procmailrc
so that's fine, I think.
I'm trying to filter any mails which come in with the subject TestMail. If this is found, I want it to add a line to the mail header saying X-Hi: Hi.
My .procmailrc file looks like:
I'm using the "Maildir" folder format so the end / is needed in the MAILDIR line.
The above script doesn't deliver the mails to the directory it's supposed to. If I put the complete path in the MAILDIR, it will of course work just fine but this isn't what I want. I need it to work for all current and future e-mail accounts for this particular domain.
I need help from anyone that has done this sort of thing before. What have others done in similar situations? What conclusions did you come to?
Thanks for ANY help provided.
I have a Fedora Core 2 setup with Plesk 7.5 Reloaded and qmail as my MTA.
I am trying to use Procmail to filter certain types of mails however no matter what I try, I can't get it to work properly.
Let's say I have my mails set up in:
/var/qmail/mailnames/<DOMAIN>/<USER>/
I want to set up a procmail script in the <DOMAIN> directory which will filter mails for every user for that domain. I've edited my .qmail-default file to include the line:
|preline /usr/bin/procmail -m -p .procmailrc
so that's fine, I think.
I'm trying to filter any mails which come in with the subject TestMail. If this is found, I want it to add a line to the mail header saying X-Hi: Hi.
My .procmailrc file looks like:
SHELL=/bin/sh
MAILDIR=./Maildir/
DEFAULT=${MAILDIR}
LOGFILE=${MAILDIR}procmail.log
LOG="--- Logging ${LOGFILE} for ${LOGNAME} "
:0
* ^Subject.*SWOOSHTEST
/dev/null
:0fhw
* H ?? ^Subject.*TestMail
| formail -I "X-Hi: Hi"
${MAILDIR}
# Accept all the rest to your default mailbox
:0:
${MAILDIR}
I'm using the "Maildir" folder format so the end / is needed in the MAILDIR line.
The above script doesn't deliver the mails to the directory it's supposed to. If I put the complete path in the MAILDIR, it will of course work just fine but this isn't what I want. I need it to work for all current and future e-mail accounts for this particular domain.
I need help from anyone that has done this sort of thing before. What have others done in similar situations? What conclusions did you come to?
Thanks for ANY help provided.