• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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