# Mail filtering gateway / mail server

## aim nano

I currently have mail accounts through my web hosting package and want to setup my gentoo box to pull mail from that pop server and filter it for spam/viruses, but also function as a mail server so that I can point my mail client at the gentoo box to retrieve the cleaned mail.

Most guides I see are for a mail filtering gateway that will relay to what i'm assuming is an in-house email server (which I don't have).  So do I simply need to set up a mail server on it?  I don't want to point my domain's MX records at the gentoo box though.  I want the mail to continue being delivered to the hosted email...and I want my gentoo box to retrieve it, clean it, then accept pop/imap connections from the client.

What is the best way to accomplish this (short-hand version is fine)?  And/or are there any guides out there for doing something like this?

----------

## nativemad

Hi, 

I would do it like this for incoming:

MX -> ISP -> fetchmail -> postfix -> amavis -> clamav -> spamassassin -> dovecot

Postfix should relay outgoing mails back to the ISP.

It's basicly a normal mailserver setup with the exception of fetchmail and the relay....

Was that enough? 

Cheers

----------

## aim nano

Yes, that's what I was looking for.  Fetchmail was the key part I wasn't really sure about.  That's enough to get me started for sure!

----------

