Search

User login

Poll

What is your favorite DB Server ?:
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
6 + 14 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

My YM

Author Information

sentono
Offline
Last seen: 6 days 18 hours ago
Joined: 09/21/2007

Alexa Rank

Who's online

There are currently 0 users and 7 guests online.
Home
  • warning: Invalid argument supplied for foreach() in /usr/home/wowtutorial/public_html/sites/all/modules/adsense_injector/adsense_injector.module on line 352.
  • warning: Invalid argument supplied for foreach() in /usr/home/wowtutorial/public_html/sites/all/modules/adsense_injector/adsense_injector.module on line 35.

Install And Configure Postfix, Courier-Authlib, Dovecot and MailScanner X86_64 O/S

This is a short tutorial to install Postfix, Courier-authlib Dovecot and MailScanner in Opensuse 11.1 x86_64 O/s
This tutorial also working for other x86_64 o/s or 64 bit O/s

What is Dovecot ?

Dovecot is an open source IMAP and POP3 server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory.

What is MailScanner ?

MailScanner is an e-mail security and anti-spam package for e-mail gateway systems. It is not designed to be run on Microsoft Windows desktop PCs. Instead, it is designed to be run on mail servers operated by companies and internet service providers (ISPs) so that all their users and customers can be protected from one place. This avoids the need for any software to be installed on individual desktop PCs at all.

Edit ld.so.conf and add few line below

#vi /etc/ld.so.conf

## add few lines below in the end of file ##
/usr/local/mysql/lib/mysql
/usr/local/mysql/include
/usr/local/ssl/include/openssl
/usr/include
/usr/include/openssl

Reload with ldconfig

#ldconfig

Install Cyrus-SASL

#wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.23.tar.gz
#tar -zxvf cyrus-sasl-2.1.23.tar.gz
#cd cyrus-sasl-2.1.23
#export CPPFLAGS="-I/usr/local/mysql/include/mysql"
#export LDFLAGS="-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm"
#./configure --enable-anon --enable-plain --enable-login --enable-sql \
--disable-krb4 --disable-otp --disable-cram --disable-digest \
--with-mysql=/usr/local/mysql/lib/mysql --without-pam --without-saslauthd \
--without-pwcheck --prefix=/usr --with-plugindir=/usr/lib/sasl2
#make -j2; make install

Install Courier-Authlib

#wget http://nchc.dl.sourceforge.net/project/courier/authlib/0.63.0/courier-au...
#tar -jxvf courier-authlib-0.63.0.tar.bz2
#cd courier-authlib-0.63.0
#./configure --with-authshadow
#make && make install

Edit authdaemonrc

#vi /etc/authlib/authdaemonrc

#### Modify 2 lines below ####
authmodulelist="authuserdb authpam authpgsql authldap authmysql authcustom authpipe"
authmodulelistorig="authuserdb authpam authpgsql authldap authmysql authcustom authpipe"

### To ###
authmodulelist="authshadow"
authmodulelistorig="authshadow"

Create smtpd.conf

#cd /usr/lib/sasl2
#vi smtpd.conf
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/usr/local/var/spool/authdaemon/socket

Create Symlink to /usr/lib64/sasl2

#ln -s /usr/lib/sasl2/smtpd.conf smtpd.conf

Installing Postfix

#tar -zxvf postfix-2.7.0.tar.gz
#cd postfix-2.7.0
#groupadd -g 1001 postfix
#groupadd -g 1002 postdrop
#useradd -u 1001 -g 1001 -G postdrop -d /home/postfix -s /usr/sbin/nologin postfix
#make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH -DUSE_TLS -DUSE_CYRUS_SASL -I/usr/include/sasl' 'AUXLIBS=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm -L/usr/lib -lssl -lcrypto -lsasl2'
#make && make install

Change Owner and Group To Postfix

#cd /usr/local/var/spool
#chown -R postfix:postfix authdaemon

Edit Postfix main.cf

#cd /etc/postfix
#vi main.cf

soft_bounce = no
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
#daemon_directory = /usr/lib/postfix
mail_owner = postfix
default_privs = nobody
inet_interfaces = all
unknown_local_recipient_reject_code = 450
debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
#setgid_group = maildrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/packages/postfix/samples
readme_directory = /usr/share/doc/packages/postfix/README_FILES
mail_spool_directory = /var/mail
canonical_maps = hash:/etc/postfix/canonical
virtual_maps = hash:/etc/postfix/virtual
relocated_maps = hash:/etc/postfix/relocated
transport_maps = hash:/etc/postfix/transport
sender_canonical_maps = hash:/etc/postfix/sender_canonical
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
#program_directory = /usr/lib/postfix
masquerade_domains =
mydestination = $myhostname, localhost.$mydomain
defer_transports =
disable_dns_lookups = no
relayhost =
content_filter =
mailbox_command =
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
strict_rfc821_envelopes = no
mynetworks_style = subnet
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
#smtpd_recipient_restrictions = permit_sasl_authenticated,reject_unauth_destination
smtp_sasl_auth_enable = no
smtpd_sasl_auth_enable = yes
smtpd_use_tls = no
smtp_use_tls = no
alias_maps = hash:/etc/aliases
mailbox_size_limit = 0
message_size_limit = 10240000
myhostname = mail.wowtutorial.org
mynetworks = 10.10.10.10, 127.0.0.1
html_directory = no
setgid_group = postdrop
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
home_mailbox = Maildir/

Edit Postfix Virtual File

#cd /etc/postfix
#vi virtual
postfixrocks.org                      virtual
sentono@postfixrocks.org        sentono
<enter>
<enter>
wowtutorial.org                    virtual
testing@wowtutorial.org        testing

Postmap All Postfix Config


#cd /etc/postfix
#postmap virtual
#postmap access
#postmap canonical
#postmap relocated
#postmap sender_canonical
#postmap transport

Fixed Postfix Permission

#postfix set-permissions

Create user using Yast for user Dovecot, ClamAV and also User For Mapping Email

#yast
- security and users
- edit and create users
- add
- create the users
Example : sentono, testing

User sentono will used to map into email sentono@postfixrocks.org
see postfix Virtual file above.

Note :


Make sure you add user and group for dovecot and clamav like below

#id clamav
uid=88(clamav) gid=88(clamav) groups=88(clamav)
#id dovecot
uid=1006(dovecot) gid=1004(dovecot) groups=1004(dovecot)

You just need to create a user and create a group like above
and assign the user into the same group.

Install Dovecot

#cd /root
#wget http://www.dovecot.org/releases/1.2/dovecot-1.2.12.tar.gz
#tar -zxvf dovecot-1.2.12.tar.gz
#cd dovecot-1.2.12
#./configure
#make && make install

Edit dovecot.conf

#cp /usr/local/etc/dovecot-example.conf dovecot.conf
#vi dovecot.conf

protocols = imap pop3
disable_plaintext_auth = no
ssl = no
auth_debug = yes
auth default {
     mechanisms = plain login
     passdb pam {
     }
     passdb shadow {
     }
     userdb passwd {
     }

socket listen {   
    client {
    path = /var/spool/postfix/private/auth
      mode = 0660
        user = postfix
        group = postfix
   }
  }
}

Install MailScanner

#cd /root
#wget http://mailscanner.info/files/4/suse/MailScanner-4.79.11-1.suse.tar.gz
#tar -zxvf MailScanner-4.79.11-1.suse.tar.gz
#cd MailScanner-4.79.11-1
#./install.sh

Edit MailScanner.conf

#vi /etc/MailScanner/MailScanner.conf
%org-name% = Wowtutorial
%org-long-name% = Wowtutorial
%web-site% = www.wowtutorial.org
Max Children = 5
Run As User = postfix
Run As Group = postfix
Queue Scan Interval = 6
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
Incoming Work Dir = /var/spool/MailScanner/incoming
Quarantine Dir = /var/spool/MailScanner/quarantine
MTA = postfix
Scan Messages = yes
Expand TNEF = yes
Virus Scanning = yes
Virus Scanners = auto
Silent Viruses = HTML-IFrame All-Viruses
Dangerous Content Scanning = yes
Find Phishing Fraud = yes
Also Find Numeric Phishing = yes
Use Stricter Phishing Net = yes
Highlight Phishing Fraud = yes
Quarantine Infections = yes
Mail Header = X-%org-name%-MailScanner:
Spam Header = X-%org-name%-MailScanner-SpamCheck:
Spam Score Header = X-%org-name%-MailScanner-SpamScore:
Information Header = X-%org-name%-MailScanner-Information:
Add Envelope From Header = yes
Envelope From Header = X-%org-name%-MailScanner-From:
Envelope To Header = X-%org-name%-MailScanner-To:
Minimum Stars If On Spam List = 5
Clean Header Value       = Found to be clean
Infected Header Value    = Found to be infected
Disinfected Header Value = Disinfected
Information Header Value = Wowtutorial.org Virus & Spam Prevention Systems
Detailed Spam Report = yes
Include Scores In SpamAssassin Report = yes
Always Include SpamAssassin Report = yes
Deliver Cleaned Messages = yes
Notify Senders = yes
Spam Checks = yes
Use SpamAssassin = yes
Spam Actions = deliver header "X-Spam-Status: Yes"

### leave the others options default ###

Add Mailscanner Header Checks in Postfix Configuration

#vi /etc/postfix/main.cf

### add 1 line below in the end of main.cf ###
#add Mailscanner to Work With Postfix
header_checks = regexp:/etc/postfix/header_checks

Edit header_checks

#vi /etc/postfix/header_checks
/^Received:/ HOLD

Change Permission for incoming and quarantine folder

You will need to ensure that the user "postfix" can write to /var/spool/MailScanner/incoming and /var/spool/MailScanner/quarantine:

#chown postfix.postfix /var/spool/MailScanner/incoming
#chown postfix.postfix /var/spool/MailScanner/quarantine

Download ClamAV & SpamAssassin

#cd /root
#wget http://downloads.sourceforge.net/clamav/clamav-0.96.1.tar.gz
#wget http://www.apache.org/dist/spamassassin/source/Mail-SpamAssassin-3.3.1.t...

Extract ClamAV & SpamAssassin

#tar -zxvf clamav-0.96.1.tar.gz
#tar -zxvf Mail-SpamAssassin-3.3.1.tar.gz

Install ClamAV & SpamAssassin

#cd clamav-0.96.1
#./configure --prefix=/usr/local/clamav --with-dbdir=/usr/local/share/clamav --disable-zlib-vcheck --sysconfdir=/etc/clamav
#make && make install

#cd ..
#cd Mail-SpamAssassin-3.3.1
#Perl Makefile.PL
#make && make install

Note :
We don't need to setup cronjob for clamav, Mailcleaner will automatically get an clamav db and stored it in /usr/local/share/clamav

Set Permission for ClamAV DB directory

#chown -R clamav:clamav /usr/local/share/clamav

Install Webmail / Squirellmail

#cd /root
#wget http://squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fprdownloads.sou...
#tar -zxvf squirrelmail-1.4.20.tar.gz
#mv squirrelmail-1.4.20 /usr/local/apache2/htdocs/webmail

Configure Webmail

#cd /usr/local/apache2/htdocs/webmail/config
#./conf.pl

Go to Option :
2. Server Setting
   ----> 1. Domain : wowtutorial.org
   ----> A. IMAP Setting : localhost:143 (dovecot)
Then S then Q

Starting Up Postfix, Courier-Authlib, Dovecot & MailScanner

NOTE:
When you are starting up Mailscanner it will automatically start Postfix

#/usr/local/sbin/dovecot
#/etc/init.d/MailScanner start
#/usr/local/sbin/authdaemond start

Added into boot.local for init system startup

#vi /etc/init.d/boot.local
/usr/local/sbin/dovecot
/etc/init.d/MailScanner start
/usr/local/sbin/authdaemond start

Open Webmail from Browser

Click IE / Mozilla Firefox
Input this URL to access webmail : http://<your server ip>>/webmail
Input user : ex :sentono
Input pass : ex : your password

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Recent comments

Facebook Fans

Sponsors

Online Store

Tag Cloud