• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

procmail help!

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:

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.
 
Noone has any ideas or example scripts? Anything related to procmail + qmail and multiple users would be ideal, really! :D

I'm still stumped so I would appreciate the help.

Thanks
 
Back
Top