
8th November 2006, 19:26
|
|
Member
|
|
Join Date: Sep 2006
Posts: 65
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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.
|

8th November 2006, 23:03
|
|
Local Meanie
|
|
Join Date: Apr 2006
Location: Switzerland
Posts: 1,046
Thanks: 4
Thanked 33 Times in 31 Posts
|
|
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
|

8th November 2006, 23:23
|
|
Member
|
|
Join Date: Sep 2006
Posts: 65
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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.
|

9th November 2006, 10:02
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,894
Thanks: 693
Thanked 4,191 Times in 3,208 Posts
|
|
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.
|

9th November 2006, 19:24
|
|
Member
|
|
Join Date: Sep 2006
Posts: 65
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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.
|

10th November 2006, 16:41
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,592 Times in 2,443 Posts
|
|
This tutorial might be interesting for you: http://www.howtoforge.com/postfix_mailfilter
|

10th November 2006, 19:36
|
|
Member
|
|
Join Date: Sep 2006
Posts: 65
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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.
|

10th November 2006, 21:59
|
|
Member
|
|
Join Date: Sep 2006
Posts: 65
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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.
|

11th November 2006, 17:25
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,592 Times in 2,443 Posts
|
|
What's in /etc/postfix/master.cf?
|

11th November 2006, 20:01
|
|
Member
|
|
Join Date: Sep 2006
Posts: 65
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 14:25.
|
|
Recent comments
5 hours 13 min ago
14 hours 41 min ago
15 hours 31 min ago
19 hours 4 min ago
23 hours 28 min ago
23 hours 50 min ago
1 day 1 hour ago
1 day 12 hours ago
1 day 17 hours ago
1 day 18 hours ago