RE: setting up a mail server.

From: Robert Boucneau (
Date: 04/08/04

  • Next message: duncan brown: "Re: problems with gmplayer"
    To: <>
    Date: Thu, 8 Apr 2004 12:02:16 -0600

    Hi Paul,

    You've been given some pretty good suggestions -- get fetchmail set up and
    it will drag you messages down from the ISP to the local computer. The
    explanations seemed a bit on the short side, so I'm expanding...

    You'll have set up five "accounts" (one for each mail recipient.)

    Fetchmail sits on your local machine and every once and a while (3 minutes?,
    5? configure) it will log onto the ISP's mail server, get the for
    each user mail, and deliver it to (something like) /var/spool/mail/(account

    When it delivers the mail, it will actually use "procmail" as the Local
    Delivery Agent (LDA) -- this means it will hand the mail over to the
    procmail program to put into the /var/spool/mail/(account name) file. The
    "beauty" of this is that while procmail is holding the mail on the way to
    the inbox, we can look at it and make some changes...this is where you'd
    scan for viruses and spam, for instance...or lots of other things (see for some more stuff on what
    procmail can do...)

    To scan for viruses and for spam, you'll need two packages (spamassassin and
    clamav) -- I'm sure there are many other options, but it seems these two are
    the general favorites. Get those installed (and make sure you have the most
    up-to-date versions by going to their home pages and checking.) Set up
    spamassassin's "spamd" daemon to run in the background (see the man page,
    but basically you just need to tell Fedora to run the "spamassassin" daemon
    during startup.)

    Then go to the user's home on you "mail server." This is probably in
    /home/(account name). Make a mail directory (mkdir mail). Back in the home
    directory (/home/(account name) ) edit a file called ".procmailrc" . This
    file will be blank, but can have instructions that tell procmail what to do
    with your mail while it is getting ready to deliver it.

    The tips page I referenced above will give you more info, but the part that
    is important for your purposes will need to look something like this: (watch
    out that procmail.log doesn't grow too big, because it can...)


    MAILDIR=/home/(account name)/mail
    LOGFILE=/home/(account name)/procmail.log

    # If this is not a "big" message (bigger than 256K), then...
    # Lets run it through spamassassin for a quick idea of content
    # We use spamc to client <-> server it through the spamd
    # spamassassin daemon
    :0 fw
    * !> 256000
    | /usr/bin/spamc
    # This says, "Here's a recipe (:0), it's a filter (f), wait for it to
    complete (w)
    # Check (*) and see how big the message is. If it is not (!) bigger (>)
    than 256000 bytes
    # run it through (|) spamc

    # If it is spam, then chuck it onto the floor
    * ^X-Spam-Level: \*\*\*\*\*\*\*
    { HOST = }
    # This says, "Here's a recipe (:0) (and, since that's all it says, it means
    that this could be a
    # final delivery option for the message...) Check (*) if there is a header
    (by default) that
    # was added by SpamAssassin that indicates spam (^, means "line begins
    with") (5 stars means
    # "Most likely spam", for this recipe we check for 7 or more -- ) then
    change the "HOST" (the
    # name of the system that will handle the message) to "" --
    which very quickly
    # just makes the message disappear...

    * ^X-Spam-Status: Yes
    # This says, "Here's a recipe (:0), please use a copy of the message (C),
    and lock the destination
    # file is we deliver (:). If (*) the messages has a header that says
    SpamAssassin think this is SPAM
    # then drop the copy into the passedspam file (this, combined with the
    previous message throws away
    # obvious spam (more than 7 *'s) while saving a copy of 5-star or 6-star
    spam so the administrator can
    # continue to educate himself and train SpamAssassin by looking at the
    contents of passedspam.

    # Okay...not spam (or not *bad* spam), so lets check for virii
    :0 HB :
    * !? clamscan --mbox -r --quiet -
    # This says, "Here's a recipe (:0), please work on both the headers (H) and
    the body (B), please
    # lock the destination file (:) if we deliver. If (*), not (!) a return
    value from calling (?)
    # clamscan on a mbox style file, recursively (-r), and without lots of text
    output (--quiet) on
    # a data stream (-), then there is a virus in the file -- deliver it to the
    viruses file (and
    # not to the recipient...

    # And then, assuming we haven't thrown it away as spam, filed it as a virus,
    or otherwise gotten rid
    # of it, we're done with instructions -- procmail can go ahead and deliver
    the message....


    I hope this helps...


    -----Original Message-----
    []On Behalf Of paul
    Sent: Wednesday, April 07, 2004 5:06 PM
    To: For users of Fedora Core releases
    Subject: setting up a mail server.

      I'm a newbie and need some help in setting up a mail server for my
    local network. i have 5 machines on local network all linked together by
    a hardwire router and connected to the Internet by cable modem
    (telewest). i would like to download all messages to one machine scan
    for virus and spam then forward to others on my network, the messages
    are currently stored by telewest in 5 pop3 mailboxes.
    can someone please help or point me in the right direction. i've tried
    googling but got confused.
    p.s. 3 of the machines are windows the others are linux fedora.

    Registered Linux user #349975

    Cheap Inkjet Cartridges

    fedora-list mailing list
    To unsubscribe:
    fedora-list mailing list
    To unsubscribe:

  • Next message: duncan brown: "Re: problems with gmplayer"