On Wed, 2005-11-23 at 11:05 +1100, [EMAIL PROTECTED] wrote:
> However I've now setup virtual pop/imap users which have no real unix
> account and these users mailboxes exist as
>
> /home/vmail/[EMAIL PROTECTED]
>
> So thus my rules in procmail to send spam to $HOME/Maildir/.Junkmail fails
> for virtual users.
>
> Anyone know of a why to write a rule that will work for virtual pop/imap
> users too.
It might be worth checking the documentation for your MTA (or whatever
virtual hosting thingy you're using that's delivering to procmail).
There's a reasonable chance it's setting environment variables
containing the virtual user/domain. Failing that, there's nothing
automatically in procmail containing it, but you can fudge it slightly
by using the MATCH variable. Something like:
:0
* ^To:.*<?\/[EMAIL PROTECTED]>]
should do the trick, although it'll probably need some tweaking. It
should match anything that has a To: header, and procmail will take
everything to the right of the \/ token and put it in the MATCH
environment variable. So a rule to match something that spamassassin has
marked as junk might end up looking like
:0
* X-Spam-Status: *Yes
{
:0
* ^To:.*<?\/[EMAIL PROTECTED]>]
/home/vmail/$MATCH/Maildir/.Junkmail
}
Trying to match To: headers can be problematic though. It fails horribly
for BCC'ed recipients, and some mailing lists.
Procmail has some very extensive and useful documentation. Check out the
procmailrc and procmailex man pages.
--
Pete
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html