Koozali.org: home of the SME Server

Spam redirect to mailbox

SEA2006

Spam redirect to mailbox
« on: October 15, 2006, 12:32:35 AM »
I am looking to replace a customers netpilot box with sme server as the licences for the netpilot are extortionete.
There are a couple of things I need help with so that I can emulate the functionality (or as near as!) of the netpilot.

1.) Can Spam be directed to another mailbox such as Admin rather than going to junkmail folder.
2.) Does squidguard install/work ok on SME 7 final?
3.) If squidguard does work is there a guide on how to white/blacklist sites manually.

Thanks
Steve

Offline stephen noble

  • *
  • 607
  • +1/-0
    • Dungog
Spam redirect to mailbox
« Reply #1 on: October 15, 2006, 08:53:11 AM »
http://www.dungog.net/sme/panels/Email%20-%20Admin%20help.html#system

Forward all mail tagged as spam to a single user for checking

1.
mkdir /etc/e-smith/templates-user-custom/.qmail
copy /etc/e-smith/templates-user-custom/.qmail/15sortspam /etc/e-smith/templates-user-custom/.qmail/15sortspam
pico -w /etc/e-smith/templates-user-custom/.qmail/15sortspam
add the line, just before the similar line
return qq(| condredirect spamboss-junkmail /bin/grep -q -i "X-Spam-Status: Yes") if $db->get("spamboss");

2.
make a new user spamboss

3.
run action to expand all users .qmail
 /etc/e-smith/events/actions/qmail-update-user

if user spamboss exists, they get all the spam in their junkfolder

CAUTION,
if you remove the user spamboss remove the custom template
and/or run
/etc/e-smith/events/actions/qmail-update-user


I'm sure squidguard would work but most people use dansguardian
search mitchell howto dansguardian

SEA2006

problem with commands
« Reply #2 on: October 17, 2006, 11:22:03 PM »
the copy command does not exist ! also looked for 15sortspam and that file does not exist.
Am I being daft!!! :?

Thanks

Offline byte

  • *
  • 2,183
  • +2/-0
Spam redirect to mailbox
« Reply #3 on: October 18, 2006, 12:06:26 AM »
Quote from: "snoble"

copy /etc/e-smith/templates-user-custom/.qmail/15sortspam /etc/e-smith/templates-user-custom/.qmail/15sortspam


SEA2006

change copy to cp which is the unix command for copy

Also not sure as I haven't tried but could be the 15sortspam is in Stephen smeserver-mailsorting rpm but don't quote me on that as I haven't installed that rpm on any of my boxes before
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline cjensen

  • *
  • 133
  • +0/-0
    • http://acenet-tech.org
Re: problem with commands
« Reply #4 on: October 18, 2006, 01:44:50 AM »
Quote from: "SEA2006"
..looked for 15sortspam and that file does not exist.


http://www.dungog.net/sme/panels/Email%20-%20Admin%20help.html#system

Offline stephen noble

  • *
  • 607
  • +1/-0
    • Dungog
Spam redirect to mailbox
« Reply #5 on: October 18, 2006, 03:12:40 AM »
lets try again

there were 2 errors
copy /etc/e-smith/templates-user-custom

Code: [Select]
cp /etc/e-smith/templates-user/.qmail/15sortspam /etc/e-smith/templates-user-custom/.qmail/15sortspam

15 sortspam is a system file

we cp it to a -custom template directory and modify it

no other contrib is needed

--
you could sent to the inbox of the user spammboss with
 
Code: [Select]
return qq(| condredirect spamboss /bin/grep -q -i "X-Spam-Status: Yes") if $db->get("spamboss");

provided you disable SA for this user
there was a thread about this recently

SEA2006

question
« Reply #6 on: October 18, 2006, 08:58:35 AM »
If I disable Spamassassin for a user what does the spam filtering / checking??

Thanks

Offline chris burnat

  • *****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Spam redirect to mailbox
« Reply #7 on: October 18, 2006, 09:56:26 AM »
"If I disable Spamassassin for a user what does the spam filtering / checking?? "

This is not a problem, you will use a special user (say spamboss) for this purpose.  You can sacrify this user.  Besides, no-one needs to know about this user, it will never be exposed to the net, so chances are he will not receive spams in its own right anyway.   Only spams addressed to other users on the system.
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

Offline chris burnat

  • *****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Spam redirect to mailbox
« Reply #8 on: October 18, 2006, 10:04:28 AM »
Quote
provided you disable SA for this user
there was a thread about this recently


Hello Stephen, Could you poitn me in the direcftion of this thread?  Cannot find it.javascript:emoticon(':cry:')
Thanks.
chris
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

Offline stephen noble

  • *
  • 607
  • +1/-0
    • Dungog
Spam redirect to mailbox
« Reply #9 on: October 18, 2006, 10:27:51 AM »
I can't find it either

15sortspam says

    my $do_sortspam = $user->prop('SortSpam')
                        || $spamassassin{SortSpam}
                        || "enabled";

    return "# sortspam disabled" unless ($do_sortspam eq "enabled");

so we set the db prop SortSpam to anything but enabled

[root@kiwi ~]# db accounts setprop spamboss  SortSpam disabled
[root@kiwi ~]# db accounts show spamboss
spamboss=user
    ForwardAddress=
    LastName=Collection
    MailFilter=bypass
    PasswordSet=yes
    Phone=612 444856
    Shell=/usr/bin/rssh
    SortSpam=disabled


 /etc/e-smith/events/actions/qmail-update-user

Offline chris burnat

  • *****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Spam redirect to mailbox
« Reply #10 on: October 18, 2006, 11:27:26 AM »
Many thanks Stephen.
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

SEA2006

thanks. works like a charm.
« Reply #11 on: October 22, 2006, 10:48:18 PM »
:D

th

Spam redirect to mailbox
« Reply #12 on: November 28, 2006, 04:14:51 PM »
Hello, sorry for my late post at this topic but a have the following problem.

I've already got mail in my junkmail folders for several users.

I've created a user spamboss and succesfully execute the above commands.

but my question is, how can I push the junkmail wich I got now to the user spamboss?

Can someone help me?

Thanks

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Spam redirect to mailbox
« Reply #13 on: November 28, 2006, 04:25:45 PM »
Quote from: "SEA2006"

1.) Can Spam be directed to another mailbox such as Admin rather than going to junkmail folder.


Yes. You just need a file /etc/e-smith/templates-user-custom/.qmail-junkmail file containing "&admin", and then do "signal-event email-update".

peertopeer

Spam redirect to mailbox
« Reply #14 on: March 13, 2007, 02:01:52 PM »
delete because double