• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • Debian 11 has reached its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.81 is the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

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