Koozali.org: home of the SME Server

Mail Rules Before Spam Rules.

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Mail Rules Before Spam Rules.
« on: January 25, 2005, 03:45:51 AM »
I'm using the Spam and Virus contribs from http://sme.swerts-knudsen.dk and userpanel from http://www.dungog.net/sme/files/userpanel/ ,

How do I add mail rules before the spam rule?

To which template would I add it to? I don't mind if it's a static entry with no server-manager control.


William.
Regards,
William

IF I give advise.. It's only if it was me....

Offline gzartman

  • *
  • 306
  • +0/-0
    • LEI Engineering & Surveying
Mail Rules Before Spam Rules.
« Reply #1 on: January 25, 2005, 05:31:31 PM »
Well it all depends on how your spam solution is setup.  I'm guessing the developer is piping email to spamassassin via the qmail-queue envir. var.   If this is the case, then mailfront mailrules are applied before messages are sent to spamassassin.  

Therefore, you only need to define a mailfront mailrule to have the rule applied before any spam scanning.  

How you define a mailrule depends on what you are using to control this rules.  Have you installed a contrib or did you set it up yourself?

Greg
----
Greg J. Zartman
LEI Engineering & Surveying

SME user and community member since 2000.

Offline Knuddi

  • *
  • 540
  • +0/-0
    • http://www.scanmailx.com
Mail Rules Before Spam Rules.
« Reply #2 on: January 25, 2005, 10:03:15 PM »
The spamfilter does it procmail filtering before the userpanel filtering and as Greg writes the actuall scanning in the qmail queue. If you want the user (UserPanel) rules to be run first the rename the /etc/e-smith/templates-user/.procmailrc/40user  file to f.ex 29user so that it gets processed before 30_spamfilter_sort. After that you need to save setting in the Spamfilter server manager panel.

Rgds,
Jesper

Offline gzartman

  • *
  • 306
  • +0/-0
    • LEI Engineering & Surveying
Mail Rules Before Spam Rules.
« Reply #3 on: January 25, 2005, 11:15:36 PM »
If you are using a spamassassin contrib that relies on procmail, then I'd look for another contrib.  There are a few of them floating around that implement spam scanning at the mail queue, which is much more efficient.

Greg
----
Greg J. Zartman
LEI Engineering & Surveying

SME user and community member since 2000.

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Mail Rules Before Spam Rules.
« Reply #4 on: January 26, 2005, 03:23:02 AM »
Quote from: "Knuddi"
The spamfilter does it procmail filtering before the userpanel filtering and as Greg writes the actuall scanning in the qmail queue. If you want the user (UserPanel) rules to be run first the rename the /etc/e-smith/templates-user/.procmailrc/40user  file to f.ex 29user so that it gets processed before 30_spamfilter_sort. After that you need to save setting in the Spamfilter server manager panel.

Rgds,
Jesper


Thanks.

I'll give it a go and see what happens.

What I really need is some rules before spam scanning (for mailing lists) and most rules after spam scanning.

William.
Regards,
William

IF I give advise.. It's only if it was me....

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Mail Rules Before Spam Rules.
« Reply #5 on: January 26, 2005, 03:29:00 AM »
Quote from: "gzartman"
If you are using a spamassassin contrib that relies on procmail, then I'd look for another contrib.  There are a few of them floating around that implement spam scanning at the mail queue, which is much more efficient.

Greg


I see a Spamassassin rule in .procmailrc. Does this mean it's not being done in the mail queue? Jesper's comment abouve has me a little confused.

Oh and Mailfront. I definitly need more information about this.


William.
Regards,
William

IF I give advise.. It's only if it was me....

Offline gzartman

  • *
  • 306
  • +0/-0
    • LEI Engineering & Surveying
Mail Rules Before Spam Rules.
« Reply #6 on: January 26, 2005, 05:06:27 AM »
Quote from: "william_syd"
I see a Spamassassin rule in .procmailrc. Does this mean it's not being done in the mail queue? Jesper's comment abouve has me a little confused.


No, by the time a message hits procmail it has already been delivered to the user.  You need a solution that injects message into spamassassin before they get delivered.  I put together a contrib that does this, but it is many months old:

http://mirror.contribs.org/smeserver/contribs/index.php?subdir=gzartman%2FBeta%2Fspamassassin&sortby=name

I believe someone has updated this for SA 3.  You might want to do a search in the experienced user forum.  I recall seeing something there.

Quote from: "william_syd"

Oh and Mailfront. I definitly need more information about this.


http://untroubled.org/mailfront/mailrules.html

Greg
----
Greg J. Zartman
LEI Engineering & Surveying

SME user and community member since 2000.

Offline Knuddi

  • *
  • 540
  • +0/-0
    • http://www.scanmailx.com
Mail Rules Before Spam Rules.
« Reply #7 on: January 26, 2005, 09:48:40 AM »
The Spamfilter does do the actuall scan of the messages before they hit the users but there is no way to filter spam marked emails before inside the queue system. The filtering takes place a the user level by use of procmail.

I anyone knows how to get rid of spam marked messages in the queue system I will be very happy to know. I have a delegate mail server in the DMZ that does virus scan and spam tagging and would love to get rid of spam out there.

Offline gzartman

  • *
  • 306
  • +0/-0
    • LEI Engineering & Surveying
Mail Rules Before Spam Rules.
« Reply #8 on: January 26, 2005, 04:45:43 PM »
Quote from: "Knuddi"

I anyone knows how to get rid of spam marked messages in the queue system I will be very happy to know. I have a delegate mail server in the DMZ that does virus scan and spam tagging and would love to get rid of spam out there.


Sure, you could do it with qmail-scanner or something similar:

http://qmail-scanner.sourceforge.net/

Greg
----
Greg J. Zartman
LEI Engineering & Surveying

SME user and community member since 2000.

Offline Knuddi

  • *
  • 540
  • +0/-0
    • http://www.scanmailx.com
Mail Rules Before Spam Rules.
« Reply #9 on: January 26, 2005, 09:32:35 PM »
I actually tried a while ago (maybe not 100% serious :-) but the qmail version running on the SME does not have the QMAILQUEUE patch

From the site you referred.

Qmail 1.03 (there's a patched src RPM for Linux users available that contains the QMAILQUEUE patch amongst other things - just "rpm --rebuild" as root to build your own i386.rpm. NOTE: I cannot vouch for it - I do not use it. Please ensure you know how it works before installing Qmail-Scanner.)

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Mail Rules Before Spam Rules.
« Reply #10 on: January 31, 2005, 03:57:37 PM »
Quote from: "Knuddi"
I actually tried a while ago (maybe not 100% serious :-) but the qmail version running on the SME does not have the QMAILQUEUE patch


qmail running on SME does not need the QMAILQUEUE patch! That's because the QMAILQUEUE patch only affects qmail-smtpd, and qmail-smtpd *is not used* in SME. SME uses Bruce Guenter's smtpfront-qmail in place of qmail-smtpd, and it already has the QMAILQUEUE feature.