Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Postfix + Greylisting, SPF, Amavisd-new and friends
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
hairyfeet
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jan 2003
Posts: 118
Location: Århus, Denmark

PostPosted: Thu Jul 08, 2004 7:55 am    Post subject: Postfix + Greylisting, SPF, Amavisd-new and friends Reply with quote

This guide explains how to setup greylisting and SPF with Postfix using the build in policy server and postgrey. The guide is written using GuideXML so I only provide a link http://www.coming.dk/amavis.html

It also explains how to integrate some other spam fighting technologies like:

    Amavisd-new (with MySQL backend)
    Spamassassin
    RBLs
    Razor
    DCC
    ClamAV
    Redelivering of false positives
    Grelisting
    SPF (Sender Policy Framework)


Comments and/or suggestions are most welcome.
Back to top
View user's profile Send private message
Alrua
n00b
n00b


Joined: 01 Feb 2004
Posts: 45

PostPosted: Fri Jul 23, 2004 10:54 pm    Post subject: Reply with quote

Very handy guide (though i only used the SPF part). :)

It turns out I can't use SPF after all, though, since all mail I receive has been passed through my ISP's relay server (they're blocking port 25 incoming (but not outgoing somehow)). This means that all mail I receive looks like it comes from my ISP, which kinda defeats the whole SPF thing...

Or did I miss something?
Back to top
View user's profile Send private message
hairyfeet
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jan 2003
Posts: 118
Location: Århus, Denmark

PostPosted: Fri Jul 23, 2004 11:45 pm    Post subject: Reply with quote

SPF only works when any of the mail servers specified in the SPF records connect directly to your mail server. So in your setup (and mine that is similar) SPF is useless.

I added a note saying so for greylisting and SPF.
Back to top
View user's profile Send private message
Alrua
n00b
n00b


Joined: 01 Feb 2004
Posts: 45

PostPosted: Sat Jul 24, 2004 2:52 am    Post subject: Reply with quote

Tough luck, I guess... :|
Maybe I'll be able to convince them to open it up for me... (riiiiight) :P
Back to top
View user's profile Send private message
GeoffOs
n00b
n00b


Joined: 13 Dec 2003
Posts: 56
Location: Cheshire

PostPosted: Thu Jul 29, 2004 9:38 pm    Post subject: DSPAM Reply with quote

Have you looked at DSPAM ?
The package is still masked at the moment, but I wondered if you had any thoughts?
Dspam home page:
http://www.nuclearelephant.com/projects/dspam/index.html
_________________
Beyond a critical point within a finite space, freedom diminishes as numbers increase. ...
The human question is not how many can possibly survive within the system, but what kind of existence is possible for those who do survive."
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Sat Jul 31, 2004 2:10 am    Post subject: Reply with quote

just a question which seems to be unanswered anywhere i searched before:
how much about SPF coverage by ISPS? i mean, spf is really honoured over the internet or is still too early ?
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
hairyfeet
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jan 2003
Posts: 118
Location: Århus, Denmark

PostPosted: Sun Aug 01, 2004 5:39 pm    Post subject: Reply with quote

GeoffOs:

I have not tried dspam just yet. But as it is possible to integrate amavisd-new and dspam now I will probably experiment with that combination soon.

FonderiaDigitale:

SPF is not widely used at the moment. Furthermore it will not prevent spammers from sending emails form their own domains.

Some of the hype about SPF right now is due to organizations trying to protect their domains from being abused by spammers.
Back to top
View user's profile Send private message
langthang
Retired Dev
Retired Dev


Joined: 27 Nov 2003
Posts: 620

PostPosted: Mon Aug 09, 2004 10:21 pm    Post subject: Reply with quote

hairyfeet, great document. Is it possible that you merge/update with http://www.gentoo.org/doc/en/virt-mail-howto.xml then file a bug at bugs.gentoo.org so we can have a Gentoo official document.

OTH, I'll update the postfix so all the examples directory will copy to /usr/share/doc/postfix_version/
_________________
Gentoo users' map
Back to top
View user's profile Send private message
langthang
Retired Dev
Retired Dev


Joined: 27 Nov 2003
Posts: 620

PostPosted: Tue Aug 10, 2004 3:13 am    Post subject: Reply with quote

Am I missing something here?

Quote:

Code listing 5.3: Create the necessary mailfolders
Code:

# maildirmake -S /var/amavis/.maildir/Bayes
# maildirmake -s write -f spam /var/amavis/.maildir/Bayes
# maildirmake -s write -f ham /var/amavis/.maildir/Bayes
# maildirmake -s write -f redeliver /var/amavis/.maildir/Bayes



I get
Code:

maildirmake -S /var/amavis/.maildir/Bayes
maildirmake: No such file or directory

_________________
Gentoo users' map
Back to top
View user's profile Send private message
hairyfeet
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jan 2003
Posts: 118
Location: Århus, Denmark

PostPosted: Tue Aug 10, 2004 4:31 am    Post subject: Reply with quote

@langthan

Yeah you look over this note that has recently been relocated to the Introduction:

"Note: The IMAP folders will be using the maildir format. Having each mail in a separate file makes handling much simpler. If you're using mbox I propose to give maildir a try. If you're not already use maildir emerge the necessary tools with emerge courier-imap. "

I might have to put a note with the first maildirmake again..

Wrt official documentation I have been talking with Swift about it before he started on his exams and I will try to get hold on him to discuss a merger of the two. I might have to go read something up on the virtual mail part before a merger but its already on my todo. Thanks for suggesting.

If you have more problems (with the guide) just report them and I will fix them.
Back to top
View user's profile Send private message
langthang
Retired Dev
Retired Dev


Joined: 27 Nov 2003
Posts: 620

PostPosted: Tue Aug 10, 2004 4:36 am    Post subject: Reply with quote

hairyfeet

I do use maildir. It's just up to that point /var/amavis/.maildir/ doesn't exist/create yet, unless maildirmake create it.
Back to top
View user's profile Send private message
hairyfeet
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jan 2003
Posts: 118
Location: Århus, Denmark

PostPosted: Tue Aug 10, 2004 7:31 am    Post subject: Reply with quote

@langthang

That makes much more sense:) Fixed in Code listing 5.3: Create the necessary mailfolders.
Back to top
View user's profile Send private message
langthang
Retired Dev
Retired Dev


Joined: 27 Nov 2003
Posts: 620

PostPosted: Thu Aug 12, 2004 8:20 pm    Post subject: Reply with quote

I followed your guide as a newbie and below is what I've gathered:

1. in chapter 5 you have a code listing for procmailrc but didn't mention emerge procmail and mailbox_command = /usr/bin/procmail in /etc/postfix/main.cf.

2. There is a bug with shared folder and courier-imap (51540). Should mention it until we get it fixed. I've spent serveral hours on the shared folders and don't know what I did rwong until I hit the bug :(

3. In code listing 5.5, I get a permission denied. Need to add 'spamtrap' user to 'amavis' group? my default perms for /var/amavis is 750 and amavis own by amavis:amavis.

4. If I setup my mail server exactly as the Gentoo's Virtual Mailhosting Guide, all my domains are virtual and 'spamtrap' is a local user, I have to change:
Code:

$spam_quarantine_to = "spamtrap\@$myhostname";


5. Code listing 6.3. You didn't mention `merge mailx`. And net-mail/mailutils provide 'mail' as an alternative.

6. Code listing 6.3. Can't get 'nosack-spamreport.pl' to work.
here is my email report.
Quote:

Use of uninitialized value in numeric lt (<) at /usr/local/bin/nosack-spamreport.pl line 89, <> line 2444.
Use of uninitialized value in numeric lt (<) at /usr/local/bin/nosack-spamreport.pl line 89, <> line 2444.
Illegal division by zero at /usr/local/bin/nosack-spamreport.pl line 110, <> line 2444.

-----------------------------------------------------------------------
SPAM Blocking Report
-----------------------------------------------------------------------

All Spam Score Distribution
Range Count
-------------------------------------------------------------------
0 - 1 0


7. Chapter 7. Make a note that if one choose "improved greylist" which is recommended should skip the "simple greylisting"

8. Have you try mail-filter/gld as an alternative?

My setup stop here until I have some more time. Please forgive me if I've missed something obvious :). Thanks.
Back to top
View user's profile Send private message
hairyfeet
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jan 2003
Posts: 118
Location: Århus, Denmark

PostPosted: Fri Aug 13, 2004 4:49 pm    Post subject: Reply with quote

@langthang

Thanks for the 'newbie' testing :D

Fixed everyting apart from:

Quote:
3. In code listing 5.5, I get a permission denied. Need to add 'spamtrap' user to 'amavis' group? my default perms for /var/amavis is 750 and amavis own by amavis:amavis.


spamtrap should only be member of mailusers but others need to be able to enter /var/amavis. So either you should chmod o+x /var/amavis or change group on /var/amavis to mailusers. Perhaps I should just move the shared maildir folder out of /var/amavis.

Quote:

Can't get 'nosack-spamreport.pl' to work.

Are you using one of the newer amavisd-new releases? I actually have the same problem now. Running amavisd-new-2.1.0_rc4.

Quote:

Have you try mail-filter/gld as an alternative?

No. Postgrey have been working fine. This week greylisted 34k+ mails. The greylist.pl script killed the server in a matter of days. Do you have any experiences with it?
Back to top
View user's profile Send private message
ahoogerhuis
n00b
n00b


Joined: 06 Jan 2003
Posts: 31

PostPosted: Wed Sep 29, 2004 5:21 am    Post subject: Reply with quote

Just as a minor plug, someone had a few issues with the greylisting daemon that came with postfix and did another implementation: http://isg.ee.ethz.ch/tools/postgrey/

Which I also turned into an ebuild: http://portage.boxed.no (and for gensync'ers: http://portage.boxed.no/boxed-main.syncsource).

Runs like a charm :)
Back to top
View user's profile Send private message
hairyfeet
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jan 2003
Posts: 118
Location: Århus, Denmark

PostPosted: Wed Sep 29, 2004 8:50 am    Post subject: Reply with quote

@ahoogerhuis

This is already noted in the guide. I made the same experiences. In Chapter 7. Greylisting:

"Warning: I tried this on one box handling thousands of mails daily and the results were almost a complete disaster. After four days the box was bogged down with hundreds of old greylist.pl processes. "

And after that I provide instructions and a link to download a postgrey ebuild. Inspired by your ebuild I've slightly updated mine.
Back to top
View user's profile Send private message
meulie
l33t
l33t


Joined: 17 Jun 2003
Posts: 845
Location: a Dutchman living in Norway

PostPosted: Mon Oct 11, 2004 8:48 pm    Post subject: Reply with quote

ahoogerhuis wrote:
Just as a minor plug, someone had a few issues with the greylisting daemon that came with postfix and did another implementation: http://isg.ee.ethz.ch/tools/postgrey/

Which I also turned into an ebuild: http://portage.boxed.no (and for gensync'ers: http://portage.boxed.no/boxed-main.syncsource).

Runs like a charm :)


When will this one pop up when I issue a simple 'emerge -s postgrey' ? 8)
_________________
Greetz,
Evert Meulie
Back to top
View user's profile Send private message
hairyfeet
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jan 2003
Posts: 118
Location: Århus, Denmark

PostPosted: Tue Oct 26, 2004 8:43 am    Post subject: Reply with quote

When someone submits it to https://bugs.gentoo.org and it is accepted. So go for it :D

For instructions see: http://www.gentoo.org/doc/en/ebuild-submit.xml

Or you cheat and place it in your portage overlay :twisted:

Just returned from a long vacation :P
Back to top
View user's profile Send private message
meulie
l33t
l33t


Joined: 17 Jun 2003
Posts: 845
Location: a Dutchman living in Norway

PostPosted: Tue Jun 06, 2006 9:39 am    Post subject: Reply with quote

hairyfeet wrote:
@langthang


Quote:

Can't get 'nosack-spamreport.pl' to work.

Are you using one of the newer amavisd-new releases? I actually have the same problem now. Running amavisd-new-2.1.0_rc4.


Did the problem with nosack-spamreport ever get fixed? I have this as well, with amavisd-new-2.3.3-r2
_________________
Greetz,
Evert Meulie
Back to top
View user's profile Send private message
meulie
l33t
l33t


Joined: 17 Jun 2003
Posts: 845
Location: a Dutchman living in Norway

PostPosted: Tue Jun 06, 2006 9:45 am    Post subject: Reply with quote

Found it! It looks like the version on http://flakshack.com/anti-spam/wiki/index.php?page=Spam+Report+ala+Kris does not have this problem... :-)
_________________
Greetz,
Evert Meulie
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum