Build Mail Server with Postfix without MySQL DB on Slackware Systems April 1, 2010
Posted by Devriza Wilmanura Imanta in Linux, Server, Slackware.Tags: Linux, noDB, noMySQL, Postfix, Postfixrocks, Slackware
trackback
Download and install this packages below if you dont wanna see any error in your installation :
- a/gettext*.tgz
- ap/diff*.tgz
- d/auto*.tgz
- d/binutils*.tgz
- d/gcc*.tgz
- d/gettext*.tgz
- d/libtool*.tgz
- d/m4*.tgz
- d/make*.tgz
- d/perl*.tgz
- l/db4*.tgz
- l/glibc*.tgz
- l/ncurses*.tgz
You can find that packages on your favourite mirror and justify with your slackware version.
Starting
Packages required :
* Postfix
* Cyrus-SASL
* Courier-Authlib
* Courier-IMAP
Downloading and extracting :
#mkdir /opt/postfixrocks
#cd /opt/postfixrocks
#wget ftp.reverse.net/pub/postfix/official/postfix-2.7.0.tar.gz
#wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.23.tar.gz
#wget http://nchc.dl.sourceforge.net/project/courier/authlib/0.63.0/courier-authlib-0.63.0.tar.bz2
#wget http://superb-sea2.dl.sourceforge.net/project/courier/imap/4.7.0/courier-imap-4.7.0.tar.bz2
#tar zxvf postfix-2.7.0.tar.gz
#tar zxvf cyrus-sasl-2.1.23.tar.gz
#tar jxvf courier-authlib-0.63.0.tar.bz2
#tar jxvf courier-imap-4.7.0.tar.bz2
Compiling Cyrus-SASL
#cd /opt/postfixrocks/cyrus-sasl-2.1.23
#./configure --enable-anon --enable-plain --enable-login --enable-sql --disable-krb4 --disable-otp --disable-cram --disable-digest --with-mysql --without-pam --without-saslauthd --without-pwcheck --prefix=/usr --with-plugindir=/usr/lib/sasl2
#make && make install
Compiling Courier-authlib
#cd /opt/postfixrocks/courier-authlib-0.63.0
#./configure --with-authshadow
#make && make install
Create smptd.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
Compiling Postfix
#cd /opt/postfixrocks/postfix-2.7.0
#groupadd -g 1001 postfix
#groupadd -g 1002 postdrop
#useradd -u 1001 -G postdrop -d /home/postfix -s /usr/sbin/nologin postfix
#ln -s /usr/lib/libssl.so.0.9.8 /usr/lib/libssl.so
#ln -s /usr/lib/libcrypto.so.0.9.8 /usr/lib/libcrypto.so
#ln -s /usr/lib/libsasl2.so.2.0.23 /usr/lib/libsasl2.so
#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
Edit main.cf
#cd /etc/postfix
#vi main.cf
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter =
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
default_privs = nobody
defer_transports =
disable_dns_lookups = no
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailbox_command =
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions = root
message_size_limit = 10240000
mydestination = $myhostname, localhost.$mydomain
myhostname = mail.unix-shell.org
mynetworks = 208.99.198.183, 127.0.0.1
mynetworks_style = subnet
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
relayhost =
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_sasl_auth_enable = no
smtp_use_tls = no
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_use_tls = no
soft_bounce = no
strict_rfc821_envelopes = no
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 450
virtual_alias_maps = hash:/etc/postfix/virtual
Edit Postfix Virtual Files
#vi virtual
postfixrocks.org virtual
postmaster@postfixrocks.org postmaster
Postmap All Postfix Config
#postmap virtual
#postmap access
#postmap canonical
#postmap relocated
#postmap sender_canonical
#postmap transport
Fixed Postfix Permission
#postfix set-permissions
Compiling Courier-IMAP
#cd /opt/postfixrocks/courier-imap-4.7.0
#./configure
#make && make install
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 all service
#postfix start
#authdaemond start
##/usr/lib/courier-imap/libexec/imapd.rc start
Add all service to rc.local
#echo "/usr/sbin/postfix start" >> /etc/rc.d/rc.local
#echo "/usr/local/sbin/authdaemond start" >> /etc/rc.d/rc.local
#echo "/usr/lib/courier-imap/libexec/imapd.rc start" >> /etc/rc.d/rc.local
Testing
SMTP
#telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.postfixrocks.org ESMTP Postfix
ehlo mail.unix-shell.org
250-mail.unix-shell.org
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
IMAP
#telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2008 Double Precision, Inc. See COPYING for distribution information.
a login postmaster password
a OK LOGIN Ok.
If you see output like above, the installation has done perfectly.
Dedicated to POSTFIXROCKS.org


=========================


Link-nya dibetulin donk…
Banyak yg salah tuh.
hehe
Ty om
wtf
heh kapan lanjut?