#1  
Old 8th November 2006, 19:26
herbie herbie is offline
Member
 
Join Date: Sep 2006
Posts: 66
Thanks: 3
Thanked 0 Times in 0 Posts
Default Reject Spam?

I'm running the Perfect Setup Postfix, Courier, etc Sarge verson. A bunch of users are snivelling that its just too hard to set their e-mail program to toss out messages marked ***SPAM*** and insisting I look into configuring the server to toss out messages marked as spam for them.
Is there a way to do this, and can it be done without quarantining it so it eats up the server's hard drive over time? As the bulk of spams are from fake senders, bouncing it also seems like a waste.
Reply With Quote
Sponsored Links
  #2  
Old 8th November 2006, 23:03
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,138
Thanks: 4
Thanked 53 Times in 49 Posts
Default

You could create a .procmailrc file for each user that wants all emails marked as spam to forward to /dev/null (deleting...)

The content of the .procmailrc file should be like:

Code:
:0:
* ^X-Spam-Flag: Yes
/dev/null
Put this into a .procmailrc file in the homedire of the user e.g. /home/Maildir/USER/.procmailrc
Reply With Quote
  #3  
Old 8th November 2006, 23:23
herbie herbie is offline
Member
 
Join Date: Sep 2006
Posts: 66
Thanks: 3
Thanked 0 Times in 0 Posts
Default

I'm using virtual domains so the structure is /home/vmail/domain/user and no Maildir, would a .procmailrc work?
I was more interested in a server-wide setting that would just maybe send all spam-marked mail for all users away.
EDIT: so I tried adding the .procmailrc file into the user directory, chown'd to vmail:vmail and it doesn't work. Shoot!

Last edited by herbie; 9th November 2006 at 00:57.
Reply With Quote
  #4  
Old 9th November 2006, 10:02
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,248 Times in 4,113 Posts
Default

The perfect setups use system users and not virtual users, thats why sjau recommended a .procmailrc solution. I guess you used the virtual postfix setup howto? Then you may e.g. use the amavisd configuration file to forward the spam mails to /dev/null.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 9th November 2006, 19:24
herbie herbie is offline
Member
 
Join Date: Sep 2006
Posts: 66
Thanks: 3
Thanked 0 Times in 0 Posts
Default

I think so. I'm trying to decode the amavis.conf to figure out how it works.
Quote:
$final_virus_destiny = D_REJECT; # (defaults to D_BOUNCE)
$final_banned_destiny = D_REJECT; # (defaults to D_BOUNCE)
$final_spam_destiny = D_PASS; # (defaults to D_REJECT)
$final_bad_header_destiny = D_PASS; # (defaults to D_PASS), D_BOUNCE suggested
I will try changing $final_spam_destiny = D_PASS; # (defaults to D_REJECT) to $final_spam_destiny = D_REJECT; # (defaults to D_REJECT) and see what happens.
The per user solution or direction to a spam folder would have been a nice option.
Reply With Quote
  #6  
Old 10th November 2006, 16:41
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,732 Times in 2,569 Posts
Default

This tutorial might be interesting for you: http://www.howtoforge.com/postfix_mailfilter
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 10th November 2006, 19:36
herbie herbie is offline
Member
 
Join Date: Sep 2006
Posts: 66
Thanks: 3
Thanked 0 Times in 0 Posts
Default

The test I did above was very effective on a server-wide basis, the two working e-mail I had on it normally get about 200 spams per day (domain and users in use over 10 years now). One had 4 spams, one had 3 overnight that made it past spamassassin.
I'm going to try the tutorial over the weekend and I'm presuming that the user's filter is saved as user@domain.com in /home/vmail/.mailfilter and that the
Quote:
{
log "------------------------------------------------------------- Spam general. "
to "/home/vmail/example.com/user/.spam" # Make this "cc" for copy or "to" to not send it to Inbox.
}
else
{
to "/home/vmail/example.com/user/."
}
to
Quote:
f ( /^Subject: SPAM/)
{
log "------------------------------------------------------------- Spam general. "
to "/dev/null" # Make this "cc" for copy or "to" to not send it to Inbox.
}
else
{
to "/home/vmail/example.com/user/."
}
It will offer a user choice of a spam box to check or discarding it altogether, and if the mailfilter-log.txt is an empty file, the spam will simply be marked as spam and delivered with the rest?

Last edited by herbie; 11th November 2006 at 02:37.
Reply With Quote
  #8  
Old 10th November 2006, 21:59
herbie herbie is offline
Member
 
Join Date: Sep 2006
Posts: 66
Thanks: 3
Thanked 0 Times in 0 Posts
Default

in the process of undoing/redoing it killed the mailserver. Only thing I can find was a mail.err entry:
Nov 10 12:10:54 picard postfix/master[4233]: fatal: /etc/postfix/master.cf: line 112: bad transport type: user=vmail

I presumed as it is in /vmail I needed to chown vmail:vmail -R .maildir?

Last edited by herbie; 11th November 2006 at 02:57.
Reply With Quote
  #9  
Old 11th November 2006, 17:25
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,732 Times in 2,569 Posts
Default

What's in /etc/postfix/master.cf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 11th November 2006, 20:01
herbie herbie is offline
Member
 
Join Date: Sep 2006
Posts: 66
Thanks: 3
Thanked 0 Times in 0 Posts
 
Default

relevant lines 110-143, 112 is #'d out at the moment
Quote:
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
# flags=DRhu user=vmail argv=/usr/local/maildrop/bin/maildrop -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop} ${sender}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
I'm also curious as to this log entry. I set the maildrop up on a domain with a single user, then set a forwarding from an account that gets a lot of spam to it:
Quote:
Nov 11 11:38:19 picard postfix/pipe[30554]: 0F83BBF4015: to=<test@beyondhope.ca>, orig_to=<rickm@qlynx.com>, relay=maildrop, delay=1, status=bounced (Command died with status 1: "/usr/local/bin/maildrop")
Where does the forwarding feature call maildrop? The only maildrop related line in postfix/master.cf is #'d out.

Last edited by herbie; 11th November 2006 at 20:56.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Slicker spam handling with Maildirs IntnsRed Feature Requests 9 30th March 2008 06:02
How to kill spam when spamassassin marks it spam kpimichael Suggest HOWTO 15 6th August 2007 16:44
Filtering SPAM MvincM Installation/Configuration 28 3rd October 2006 17:33
complete spam protection with postfix - howto alexnz Server Operation 1 22nd June 2006 14:06
Spam vpns2000 Installation/Configuration 7 3rd May 2006 18:07


All times are GMT +2. The time now is 17:17.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.