# help....Install Mail Server



## cheoac (Oct 2, 2009)

any body have a tutorial about how install a mail server???? i have install:
OS: FreeBSD 7.1
web: apache
db: mysql
lang: php5
so i think so that i need a MTA MDA MUA thanks


----------



## vivek (Oct 2, 2009)

http://www.purplehat.org/?page_id=4


----------



## dennylin93 (Oct 3, 2009)

Try searching the forums as well. There are many threads that have useful information.


----------



## Lego (Oct 3, 2009)

well I've just resently picked DutchDaemon's brain dry over the last few months setting up my mail server, so If you have any Questions at all you can contact me and I'll do my very best to help ya, if not Im sure some of the real experts will be able to help you! cheers! good luck!

my mail server is also running sendmail/procmail/imap/spamassassin/clamav & roundcube as the web interface, and believe it or not but I gave a friend an email account on my server, and he connects to it perfectly fine with windows live mail. oh and roundcubes connection is ssl.


----------



## xy16644 (Oct 3, 2009)

Can I ask how you configured your ClamAV with your setup? I have almost the same setup as you except I run Postfix instead of Sendmail. I just installed ClamAV and used Procmail to scan incoming email and if an email is infected it gets moved to the users Junk folder. Ultimately I would like all virus infected  email to go to another dedicated AV mailbox that an admin can review occassionally.

Am just curious to compare how you implemented it!


----------



## Lego (Oct 3, 2009)

Um well. LOL! ok So I just sent a test virus message to myself

blurr-ink# cat clam.cab | uuencode clam2.cab | mail root -s "lego"

I made the quarantine line Bold.


```
Oct  3 10:29:49 blurr-ink sendmail[56208]: n93ETnqI056208: from=lego, size=892, class=0, nrcpts=2, msgid=<200910031429.n93ETnqI056208@blurr-ink.com>, relay=r
Oct  3 10:29:59 blurr-ink sm-mta[56209]: n93ETnpl056209: from=<lego@blurr-ink.com>, size=1189, class=0, nrcpts=1, msgid=<200910031429.n93ETnqI056208@blurr-in
[B]Oct  3 10:29:59 blurr-ink sm-mta[56209]: n93ETnpl056209: milter=clmilter, quarantine=quarantined by clamav-milter[/B]
Oct  3 10:29:59 blurr-ink spamd[18153]: spamd: connection from localhost [127.0.0.1] at port 59633
Oct  3 10:29:59 blurr-ink spamd[18153]: spamd: setuid to root succeeded
Oct  3 10:29:59 blurr-ink spamd[18153]: spamd: still running as root: user not specified with -u, not found, or set to root, falling back to nobody
Oct  3 10:29:59 blurr-ink spamd[18153]: spamd: processing message <200910031429.n93ETnqI056208@blurr-ink.com> for root:65534
Oct  3 10:29:59 blurr-ink spamd[18153]: auto-whitelist: open of auto-whitelist file failed: locker: safe_lock: cannot create tmp lockfile /nonexistent/.spama
Oct  3 10:29:59 blurr-ink spamd[18153]: spamd: clean message (3.2/5.0) for root:65534 in 0.1 seconds, 1513 bytes.
Oct  3 10:29:59 blurr-ink spamd[18153]: spamd: result: . 3 - ALL_TRUSTED,MISSING_SUBJECT,TVD_SPACE_RATIO,UPPERCASE_50_75 scantime=0.1,size=1513,user=root,uid
Oct  3 10:30:00 blurr-ink sm-mta[56209]: n93ETnpl056209: Milter add: header: X-Spam-Status: No, score=3.2 required=5.0 tests=ALL_TRUSTED,MISSING_SUBJECT,\n\t
Oct  3 10:30:00 blurr-ink spamd[18148]: prefork: child states: II
Oct  3 10:30:00 blurr-ink sm-mta[56209]: n93ETnpl056209: Milter add: header: X-Spam-Level: ***
Oct  3 10:30:00 blurr-ink sm-mta[56209]: n93ETnpl056209: Milter add: header: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on blurr-ink.com
Oct  3 10:30:00 blurr-ink sendmail[56208]: n93ETnqI056208: to=root,lego, ctladdr=lego (1000/0), delay=00:00:11, xdelay=00:00:11, mailer=relay, pri=60892, rel
```

and in my sendmail.cf :

```
INPUT_MAIL_FILTER(`spamassassin',`S=local:/var/run/spamass-milter.sock, F=, T=C:15m;S:4m;R:4m;E:10m')dnl
INPUT_MAIL_FILTER(`clmilter', `S=local:/var/run/clamav/clmilter.sock, F=, T=S:4m;R:4m')dnl
define(`confINPUT_MAIL_FILTERS', `clmilter,spamassassin')dnl
```

So the mail didn't get delivered to my mail box and I do see the quarantine line, so It must be working  lol but ya that's all I've done.... Now I just need to figure out where the quarantined message is LOL cuz I've sent a couple now, I would Also Like to add to my .procmailrc file to have the virus message flaged and sent to junk for verification.....

my .procmailrc:

```
#########################################################################
#                                                                       #
#               STANDARD .PROCMAILRC TO FILTER SPAM                     #
#                                                                       #
#               COMPUTER SCIENCE DEPARTMENT                             #
#                   COLUMBIA UNIVERSITY                                 #
#                                                                       #
#########################################################################

#### Customize the configuration to fit your need. *********
#
## Make sure that this file is only writable by the owner, otherwise
## procmail will not use it (considered "Suspicious" by procmail)
## and complain (silently to you) in the mail log file of the delivering
## machine.
#

# All folders (spam, log, procmailbackup) are in $MAILDIR/mail
MAILDIR=$HOME/

# Please empty the mail log ($MAILDIR/log) frequently because it gets very
# big quickly. This file is a good place to check your filtered email to
# make sure they are all spam.
LOGFILE=$MAILDIR/procmail.log
VERBOSE=yes


##### uncomment below to keep backups of all incoming mail
#
# Uncomment the following 3 lines if you want to backup your mail
# BEFORE filtering, please empty the folder frequently because it gets very
# big, very quickly.

#BACKUPSPOOL=$MAILDIR/procmailbackup
#:0 c:
#$BACKUPSPOOL

# If email is marked with 90% or higher probability of being spam, filter it.
:0:
* ^X-Spam-Status: Yes

# Put the spam in $MAILDIR/spam.
# Please empty the spam folder frequently.
Junk

##### or you can delete it
#/dev/null

############################## E N D ######################################
```


----------



## Ruler2112 (Oct 6, 2009)

I use amavisd instead of procmail to filter, but have the same setup as you want - any virus-laden messages are dumped to a separate mailbox.  With amavisd, I just added this to /usr/local/etc/amavisd.conf:


```
$mailfrom_notify_admin     = "virusalert\@$mydomain";
$mailfrom_notify_recip     = "virusalert\@$mydomain";
```



I used a PDF version of this document when setting up my own mail server on FreeBSD 7.1/postfix.  It's somewhat old, but very good and focuses on security.


----------



## frustphil (Oct 8, 2009)

Ruler2112 said:
			
		

> I used a PDF version of this document when setting up my own mail server on FreeBSD 7.1/postfix.  It's somewhat old, but very good and focuses on security.



I can't view/download this file? It says my IP address has been banned?


----------



## dennylin93 (Oct 9, 2009)

frustphil said:
			
		

> I can't view/download this file? It says my IP address has been banned?



I also got this message when I tried the link.


----------



## Lego (Oct 10, 2009)

I was able to load the link.... its not a pdf.... its a forum page.. would you like me to save the page and upload it as a txt doc??


----------



## Lego (Oct 10, 2009)

http://blurr-ink.com/odds/Install_Doc.txt

I take no credit what so ever, all i did was save the txt from the forum page and put it on my server so others can download the page.....


----------

