procmail
[Top] [All Lists]

Re: redirect mail newbie question

2008-10-29 12:44:26
At 15:56 2008-10-29 +0000, Moldoveanu Marius George wrote:
Hy,
i have a fedora core server
with the latest spamassassin, postmail, dovecot and procmail.

FTR, "latest" isn't really that descriptive. It varies with time (say, if someone comes across this in the archives), and your idea of latest may differ from that of someone who is downloading development snapshots of any of these packages on any given day. Specify version numbers - they're easy enough to determine.

What i`m trying to do is that the marked spam message from spamassassin to be sent to spam(_at_)mydomain(_dot_)com(_dot_)

If you're marking it from within the /etc/procmailrc script, you should be able to just deliver it to the mailbox for that account (assuming that you're not running a separate procmailrc within that account's homedir), or, as I point out below, bypass your filtering (which is what is screwing you now).

i installed as folowed: installed from the website,

HUH? You mean you downloaded the source tarball from procmail.org, extracted it, ran make and make install?

created a .procmailrc folder in each user with chmod 0640 and i configure the rest in webmin.

I don't use webmin - and anything you do in webmin is specific to it - procmail has no webmin components.

The configuration is as follows:

This being _where_ exactly. It's not a "config" either - it's the recipe being run each time a message is received for local delivery to that user (or, if in the global procmailrc, for any local delivery).

INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc
DROPPRIVS=yes
:0fw
| /usr/bin/spamc

so it sends to spamassassin. The problem is that if I add this text too:
:0
* ^Subject:*SPAM
//! spam(_at_)yourdomain(_dot_)com

// is not a recognized comment character in procmail. Further, you should comment out the ENTIRE recipe, not just the action line (since if you comment out the action, procmail is very likely to parse the NEXT line as an action instead).

i get smth like loop mail message with the spam.

Let me guess -- "yourdomain.com" is the same domain that the above procmailrc is running on? What do you figure will happen when you receive the message again? You'll run it through SA, then try to forward it.

so to correct that i modified it as follows:
:0
* ^Subject:*SPAM
//* ^X-//Loop/:my-email(_at_)mydomain(_dot_)com/
! spam(_at_)mydomain(_dot_)com

ftr, you're now using "mydomain.com" here - is this the same domain reference as "yourdomain.com" is supposed to be previously?

//Now it doesnt work :| . that is the file from /etc/procmailrc

You have a very muddy way of posting code. As I mentioned above, you're not using valid comment syntax. I'm left to wonder if the commented out stuff is commented out in your actual rcfile.

If you expect to FIND an X-Loop header, you should first look to ADD an X-Loop header before forwarding the message. See 'man procmailex' for examples.

There's a MUCH easier way - Check LOGNAME. and simply don't invoke SA or forwarding.

# this should be the userid - not email address - that your spam
# mailbox is handled under.
:0
* ! LOGNAME ?? ^^spam^^
{
        # all your current SA and forwarding junk
}


If you search the list archives, you should find a message or two I've posted about using the *nix groups functionality to flag accounts to either filter or not, etc: create a group for "nospam" or whatever, and then check to see if a given LOGNAME is a member of that group when you go to spam check - if they aren't then don't. This allows you to opt out accounts from filtering.

GROUPS=`groups $LOGNAME`

:0
* GROUPS ?? [   ]nospam\>
{
        LOG="bypass spam filtering"
}


You can have a lot of different groups, and this will grab all the ones that a given account is member of, so you only need to run the groups query once, and then check the content of it against each individual string you care about around each conditional filterset.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>