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

Install C Compiler and Dependencies

zypper in gcc gcc-c++ ncurses-devel pam-devel automake gettext-tools db1 db43 db43-devel libdb-* libopenssl-devel*

Edit ld.so.conf and add 1 lines below

#vi /etc/ld.so.conf

## add few lines below in the end of file ##
/usr/local/include
/usr/local/ssl/lib/
/usr/local/mysql/lib/mysql
/usr/local/mysql/include
/usr/local/ssl/include/openssl
/usr/local/ssl/include
/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
#./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

Note :
if you have any problem with cyrus-sasl you can export 2 lines below and try to configure again.
#export CPPFLAGS="-I/usr/local/mysql/include/mysql"
#export LDFLAGS="-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm"

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

#cd /usr/local/etc/authlib/
#cp authdaemonrc.dist authdaemonrc
#vi 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

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

Create Symlink OPENSSL

#cd /usr/include/sasl
#ln -s /usr/local/ssl/include/openssl openssl

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.postfixrocks.org
mynetworks = 208.99.198.180, 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

Starting Up Postfix

#postfix start

Starting Up Courier-Authlib
#/usr/local/sbin/authdaemond start

Create user using Yast.

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

Installing Courier-Imap

Su with normal user 
ex : sentono

#su sentono
#cd /home/sentono
#wget http://superb-sea2.dl.sourceforge.net/project/courier/imap/4.7.0/courier...
#tar -jxvf courier-imap-4.7.0.tar.bz2
#cd courier-imap-4.7.0
#./configure

Exit su testing and make with root
#
exit
#make && make install
#make install-configure

Edit imapd

#cd /usr/lib/courier-imap/etc
#vi imapd
#### modify few lines below ###
#### Change it from 1 to 0
IMAP_MAILBOX_SANITY_CHECK=0

### change it from no to yes ###
IMAPDSTART=YES

Starting up Courier-Imap

#/usr/lib/courier-imap/libexec/imapd.rc start

Create Maildir to Home User [ Not necessary because if you set your mailserver up and running. Maildir should be automatically created in your home dir /home/sentono/Maildir ]

Example :
user : sentono
Homedir : /home/sentono

#/usr/lib/courier-imap/bin/maildirmake /home/sentono/Maildir

View Log for Troubleshooting Purpose

#tail -f /var/log/mail
#tail -f /var/log/mail.err
#tail -f /var/log/messages

Add postfix, courier-authlib and courier-imap to boot.local

#vi /etc/init.d/boot.local

## add these line into boot.local
/usr/sbin/postfix start
/usr/local/sbin/authdaemond start
/usr/lib/courier-imap/libexec/imapd.rc start

 


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.

Sponsors

Chat Box

Poll

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

Alexa Rank

Counter

  • Site Counter: 43,136
  • Unique Visitor: 8,535
  • Registered Users: 69
  • Unregistered Users: 62
  • Blocked Users: 3
  • Your IP: 90.203.164.4
  • Visitors:
  • Today: 17
    This week: 2704
    This month: 5529
    This year: 16037

Donate Me

Does this site make your life easier?
Help me keep it online.

Who's online

There are currently 0 users and 9 guests online.