Senin, 14 Januari 2013

Membuat Email Server Dengan Qmail Di Fedora 7


Membuat Email Server Dengan Qmail Di Fedora 7
Untuk paket Qmail pada tutorial kali ini Insya Allah akan saya siapkan untuk di download Petama buatlah directory /downloads dan letakan seluruh file installer di directory tersebut # mkdir /downloads

Kemudian jalankan scripts yang ada di directory /downloads/qmailrocks/scripts/install/ # cd /downloads/qmailrocks/scripts/install/ # sh ./qmr_install_linux-s1.script
Jalankan juga scripts yang ada di /downloads/qmailrocks/scripts/utils # cd /downloads/qmailrocks/scripts/utils # sh ./qmail_big_patches.script
Install Paket Qmail # cd /usr/src/qmail/qmail-1.03/ # make man && make setup check # ./config-fast fedoramailserver.infopratama.com
# cd /usr/src/qmail/qmail-1.03/ # make cert
# cd /var/qmail/control/ # chown -R vpopmail:qmail clientcert.pem # chown -R vpopmail:qmail servercert.pem
Install Paket Uscpi # cd /usr/src/qmail/ucspi-tcp-0.88/ # patch < /downloads/qmailrocks/patches/ucspi-tcp-0.88.errno.patch [root@fedoramailserver ~]# make && make setup check
Install Paket Daemontools # cd /package/admin/daemontools-0.76/src/ # patch < /downloads/qmailrocks/patches/daemontools-0.76.errno.patch # package/install
# ps ax | grep svscan 2058 ? Ss 0:00 /bin/sh /command/svscanboot 2087 ? S 0:00 svscan /service 2800 pts/2 R+ 0:00 grep svscan
Install Paket Ezmlm # cd /downloads/qmailrocks/ # tar zxvf ezmlm-0.53-idx-0.41.tar.gz # cd ezmlm-0.53-idx-0.41 # make && make setup
Install Paket Autorespondend # cd /downloads/qmailrocks/ # tar zxvf autorespond-2.0.5.tar.gz # cd autorespond-2.0.5 # make && make install
Pastikan paket Mysql yang terinstall, cek dengan perintah # rpm -qa | grep mysql libdbi-dbd-mysql-0.8.1a-2.fc7 mod_auth_mysql-3.0.0-3.1 mysql-server-5.0.37-2.fc7 mysql-libs-5.0.37-2.fc7 mysql-connector-odbc-3.51.12-2.2 php-mysql-5.2.2-3 mysql-5.0.37-2.fc7
Jalankan mysql dan akan muncul pesan seperti di bawah ini # /etc/init.d/mysqld start Initializing MySQL database: Installing all prepared tables Fill help tables
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password ‘new-password’ /usr/bin/mysqladmin -u root -h fedoramailserver.infopratama.com password ‘new-password’ See the manual for more instructions.
You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the ’sql-bench’ directory: cd sql-bench ; perl run-all-tests
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at http://www.mysql.com/ Support MySQL by buying support/licenses at http://shop.mysql.com/ [ OK ] Starting MySQL: [ OK ]
Buatlah password untuk mysql # /usr/bin/mysqladmin -u root password ‘777777′ # /usr/bin/mysqladmin -u root -h fedoramailserver.infopratama.com password ‘777777′
Kemudian login ke mysql dengan password yang baru kita buat # mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.0.37 Source distribution
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
Buatlah data base vpopmail dengan perintah mysql> CREATE DATABASE vpopmail; Query OK, 1 row affected (0.00 sec)
mysql> GRANT select,insert,update,delete,create,drop ON vpopmail.* TO vpopmailuser@localhost IDENTIFIED BY ‘777777′; Query OK, 0 rows affected (0.00 sec)
Lakukan pengecekan database mysql> show databases; +——————–+ | Database | +——————–+ | information_schema | | mysql | | test | | vpopmail | +——————–+ 4 rows in set (0.00 sec)
mysql> quit Bye
# mkdir /home/vpopmail/etc # chown vpopmail:vchkpw /home/vpopmail/etc/ # echo “localhost|0|vpopmailuser|777777|vpopmail” > /home/vpopmail/etc/vpopmail.mysql # chown vpopmail:vchkpw /home/vpopmail/etc/vpopmail.mysql
Login ke mysql sebagai vpopmailuser # mysql -u vpopmailuser -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.0.37 Source distribution
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> \q Bye
Jika anda berhasil login berarti anda sukses
Install paket Vpopmail # cd /downloads/qmailrocks/ # tar zxvf vpopmail-5.4.9.tar.gz # cd vpopmail-5.4.9 # ./configure –enable-logging=p –disable-passwd –enable-clear-passwd –disable-many-domains –enable-auth-logging –enable-valias –disable-mysql-limits
Proses configurenya cukup lama tergantung dari speck hardware setelah selesai akan muncul pesan seperti di bawah ini:
vpopmail 5.4.9 Current settings —————————————
vpopmail directory = /home/vpopmail uid = 508 gid = 503 roaming users = OFF –disable-roaming-users (default) password learning = OFF –disable-learn-passwords (default) md5 passwords = ON –enable-md5-passwords (default) file locking = ON –enable-file-locking (default) vdelivermail fsync = OFF –disable-file-sync (default) make seekable = ON –enable-make-seekable (default) clear passwd = ON –enable-clear-passwd (default) user dir hashing = ON –enable-users-big-dir (default) address extensions = OFF –disable-qmail-ext (default) ip alias = OFF –disable-ip-alias-domains (default) domain quotas = OFF –disable-domainquotas (default) auth module = cdb –enable-auth-module=cdb (default) auth inc = -Icdb auth lib = system passwords = OFF –disable-passwd (default) pop syslog = show failed attempts with clear text password –enable-logging=p auth logging = ON –enable-auth-logging (default)
Lakukan proses install # make && make install-strip
Kemudian Install Paket Qmailrock # cd /downloads/qmailrocks/ # tar zxvf vqadmin-2.3.6.tar.gz # cd vqadmin-2.3.6 # ./configure –enable-cgibindir=/var/www/cgi-bin/ –enable-htmldir=/var/www/html/
Proses ini juga seru setelah selesai akan muncul pesan seperti di bawah ini
Current settings ————————————— vpopmail directory = /home/vpopmail uid = 508 gid = 503 cgi-bin dir = /var/www/cgi-bin/ vqadmin dir = /var/www/cgi-bin//vqadmin mysql features = disabled
Lakukan proses Install juga # make && make install-strip
Install Paket Maildrop # cd /downloads/qmailrocks/ # tar zxvf maildrop-1.6.3.tar.gz # cd maildrop-1.6.3 # ./configure -prefix=/usr/local/ -exec-prefix=/usr/local/ -enable-maildrop-uid=root -enable-maildrop-gid=vchkpw -enable-maildirquota # make && make install-strip && make install-man
Install Apache Webserver # rpm -qa | grep http httpd-2.2.4-4 system-config-httpd-1.4.3-1.fc7
# cd /etc/httpd/conf # vi httpd.conf …….. AllowOverride None Options None Order allow,deny Allow from all
#tepat dibawahnya, tambahkan scrip ini
deny from all Options ExecCGI AllowOverride AuthConfig Order deny,allow
Konfigurasi Password Vqadmin
# cd /var/www/cgi-bin/vqadmin/ # vi .htaccess AuthType Basic AuthUserFile /usr/local/apache/conf/vqadmin.passwd AuthName vQadmin require valid-user satisfy any
Ubah menjadi
AuthType Basic AuthUserFile /usr/local/vqadmin-passwd/.htpasswd AuthName vQadmin require valid-user satisfy any
# chown apache .htaccess # chmod 644 .htaccess # mkdir /usr/local/vqadmin-passwd # cd /var/www/cgi-bin/vqadmin/ # htpasswd -bc /usr/local/vqadmin-passwd/.htpasswd admin 777777 # chmod 644 /usr/local/vqadmin-passwd/.htpasswd # /etc/init.d/httpd start
Lakukan Akses Vqadmin melalui Web Browser http://192.168.0.2/cgi-bin/vqadmin/vqadmin.cgi masukan user “admin” password “777777″
Konfigurasi Qmail # cd /downloads/qmailrocks/scripts/finalize/linux/ # sh ./finalize_linux.script This scripts will perform 3 functions:\n 1. Copy all supervise scripts to their proper locations.\n
2. Copy the qmail rc and qmailctl scripts to their proper locations and create needed symlinks.\n
3. Set all needed permisions on all supervise scripts.\n
Press ENTER to proceeed
Copying supervise scripts to their correct locations…
Done!
Copying rc and qmailctl scripts to proper locations…
Done!
Setting needed permisions…
Done!
Script Complete
# qmailctl stop Stopping qmail…
qmail-smtpd qmail-send qmail-pop3d
# vi /var/qmail/supervise/qmail-pop3d/run #!/bin/sh PATH=/var/qmail/bin:/usr/local/bin:/usr/bin:/bin export PATH exec tcpserver -H -R -v -c100 0 110 qmail-popup mail.example.com \ /home/vpopmail/bin/vchkpw qmail-pop3d Maildir 2>&1
ganti mail.example.com menjadi fedoramailserver.infopratama.com
# vi /var/qmail/supervise/qmail-smtpd/run #!/bin/sh QMAILDUID=`id -u vpopmail` NOFILESGID=`id -g vpopmail` MAXSMTPD=`cat /var/qmail/control/concurrencyincoming` LOCAL=`head -1 /var/qmail/control/me` if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ]; then echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in echo /var/qmail/supervise/qmail-smtpd/run exit 1 fi if [ ! -f /var/qmail/control/rcpthosts ]; then echo “No /var/qmail/control/rcpthosts!” echo “Refusing to start SMTP listener because it’ll create an open relay” exit 1 fi exec /usr/local/bin/softlimit -m 30000000 \ /usr/local/bin/tcpserver -v -R -l “$LOCAL” -x /etc/tcp.smtp.cdb -c “$MAXSMTPD” \ -u “$QMAILDUID” -g “$NOFILESGID” 0 smtp \ /var/qmail/bin/qmail-smtpd mail.example.com \ /home/vpopmail/bin/vchkpw /usr/bin/true 2>&1
ganti mail.example.com menjadi fedoramailserver.infopratama.com
# echo ‘127.:allow,RELAYCLIENT=”"‘ >> /etc/tcp.smtp # qmailctl cdb Reloaded /etc/tcp.smtp.
Setting Alias
# echo postmaster@infopratama.com > /var/qmail/alias/.qmail-root # echo postmaster@infopratama.com > /var/qmail/alias/.qmail-postmaster # echo postmaster@infopratama.com > /var/qmail/alias/.qmail-mailer-daemon # ln -s /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-anonymous # chmod 644 /var/qmail/alias/.qmail*
Menghapus Aplikasi SendMail
# rpm -qa | grep sendmail sendmail-8.14.1-2 # /etc/init.d/sendmail stop Shutting down sm-client: [ OK ] Shutting down sendmail: [ OK ] # rpm -e –nodeps sendmail-8.14.1-2 warning: /var/log/mail/statistics saved as /var/log/mail/statistics.rpmsave # ln -s /var/qmail/bin/sendmail /usr/lib/sendmail # ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
Install Courrier-Imap/Imaps # cd /downloads/qmailrocks/ # tar jxvf courier-authlib-0.55.tar.bz2 # cd courier-authlib-0.55 # ./configure -prefix=/usr/local/ -exec-prefix=/usr/local/ -with-authvchkpw -without-authldap -without-authmysql -disable-root-check -with-ssl -with-authchangepwdir=/usr/local/libexec/authlib -with-redhat # make && make check # make install-strip && make install-configure
# cd /downloads/qmailrocks/ # tar jxvf courier-imap-4.0.2.tar.bz2 # chown -R thenuno:wheel courier-imap-4.0.2 # su thenuno $ cd /downloads/qmailrocks/courier-imap-4.0.2 $ ./configure -prefix=/usr/local/ -exec-prefix=/usr/local/ -with-authvchkpw -without-authldap -without-authmysql -disable-root-check -with-ssl -with-authchangepwdir=/usr/local/libexec/authlib -with-redhat $ make && make check $ exit # cd /downloads/qmailrocks/courier-imap-4.0.2 # make install-strip && make install-configure
# /usr/local/sbin/mkimapdcert Generating a 1024 bit RSA private key …………………….++++++ …………………++++++ writing new private key to ‘/usr/local//share/imapd.pem’ —– 1024 semi-random bytes loaded Generating DH parameters, 512 bit long safe prime, generator 2 This is going to take a long time …………………………………………….+.+…………………+..+………..+….+……………+…….+………………….+.++*++*++*++*++*++* subject= /C=US/ST=NY/L=New York/O=Courier Mail Server/OU=Automatically-generated IMAP SSL key/CN=localhost/emailAddress=postmaster@example.com notBefore=Jan 18 17:06:37 2009 GMT notAfter=Jan 18 17:06:37 2010 GMT SHA1 Fingerprint=1A:3C:AF:6A:86:81:86:3F:E5:AC:0B:81:22:10:16:14:2A:4E:B9:1C
# vi /usr/local/etc/imapd.cnf ganti emailAddress=postmaster@example.com menjadi emailAddress=postmaster@infopratama.com
# vi /usr/local/etc/imapd ganti IMAPDSTART=NO menjadi IMAPDSTART=YES
# vi /usr/local/etc/imapd-ssl ganti IMAPDSSLSTART=NO menjadi IMAPDSSLSTART=YES
# vi /usr/local/etc/authlib/authdaemonrc ganti authmodulelist=”authuserdb authpam authcustom authvchkpw” menjadi authmodulelist=”authvchkpw”
# cp /usr/local/libexec/imapd.rc /etc/rc.d/init.d/imap # cp /usr/local/libexec/imapd-ssl.rc /etc/rc.d/init.d/imaps # qmailctl stop Stopping qmail…
qmail-smtpd qmail-send qmail-pop3d [root@fedoramailserver ~]# qmailctl start Starting qmail…
Starting qmail-send Starting qmail-smtpd Starting qmail-pop3d
# /usr/local/sbin/authdaemond stop # /usr/local/sbin/authdaemond start # /etc/init.d/imap stop # /etc/init.d/imaps stop # /etc/init.d/imap start # /etc/init.d/imaps start
# vi /etc/rc.local /usr/local/sbin/authdaemond start /etc/init.d/imap start /etc/init.d/imaps start /etc/init.d/httpd start /etc/init.d/mysqld start
# nmap 192.168.0.2
Starting Nmap 4.20 ( http://insecure.org/ ) at 2009-01-19 00:36 WIT Interesting ports on fedoramailserver.infopratama.com (192.168.0.2): Not shown: 1689 closed ports PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp 53/tcp open domain 110/tcp open pop3 111/tcp open rpcbind 143/tcp open imap 820/tcp open unknown 993/tcp open imaps
Nmap finished: 1 IP address (1 host up) scanned in 0.216 seconds
# telnet 192.168.0.2 143 Trying 192.168.0.2… Connected to 192.168.0.2. 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-2005 Double Precision, Inc. See COPYING for distribution information. Connection closed by foreign host.
# cd /downloads/qmailrocks/ # tar zxvf courierpassd-1.1.0-RC1.tar.gz # cd courierpassd-1.1.0-RC1 # ./configure # make && make install
# cd /etc/xinetd.d/ # vi courierpassd service courierpassd { port = 106 socket_type = stream protocol = tcp user = root server = /usr/local/sbin/courierpassd server_args = -s imap wait = no only_from = 192.168.0.2 instances = 4 disable = no }
# vi /etc/services courierpassd 106/tcp # for /etc/xinetd.d/courierpassd
# /etc/init.d/xinetd start Starting xinetd: [ OK ]
# nmap 192.168.0.2
Starting Nmap 4.20 ( http://insecure.org/ ) at 2009-01-19 01:04 WIT Interesting ports on fedoramailserver.infopratama.com (192.168.0.2): Not shown: 1688 closed ports PORT STATE SERVICE 22/tcp open ssh 25/tcp open smtp 53/tcp open domain 106/tcp open pop3pw 110/tcp open pop3 111/tcp open rpcbind 143/tcp open imap 820/tcp open unknown 993/tcp open imaps
Nmap finished: 1 IP address (1 host up) scanned in 0.144 seconds
# telnet 192.168.0.2 106 Trying 192.168.0.2… Connected to 192.168.0.2. Escape character is ‘^]’. 200 courierpassd v1.1.0-RC1 hello, who are you? a logout 500 Username required. Connection closed by foreign host.
# rpm -qa | grep squirrelmail # cd /var/www/html/ # cp /downloads/squirrelmail/squirrelmail-1.4.4.tar.gz . # tar zxvf squirrelmail-1.4.4.tar.gz # mv squirrelmail-1.4.4 webmail # mkdir /var/sqattachements # chown -R apache:apache /var/sqattachements/ # cd /var/www/html/webmail/ # chown -R apache:apache data/ # cd config # ./conf.pl
SquirrelMail Configuration : Read: config_default.php (1.4.0) ——————————————————— Main Menu – 1. Organization Preferences 2. Server Settings 3. Folder Defaults 4. General Options 5. Themes 6. Address Books 7. Message of the Day (MOTD) 8. Plugins 9. Database 10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color on S Save data Q Quit
Command >> 2
SquirrelMail Configuration : Read: config_default.php (1.4.0) ——————————————————— Server Settings
General ——- 1. Domain : example.com 2. Invert Time : false 3. Sendmail or SMTP : SMTP
A. Update IMAP Settings : localhost:143 (other) B. Update SMTP Settings : localhost:25
R Return to Main Menu C Turn color on S Save data Q Quit
Command >> 1
The domain name is the suffix at the end of all email addresses. If for example, your email address is jdoe@example.com, then your domain would be example.com.
[example.com]: 202.202.202.202
SquirrelMail Configuration : Read: config_default.php (1.4.0) ——————————————————— Server Settings
General ——- 1. Domain : 202.202.202.202 2. Invert Time : false 3. Sendmail or SMTP : SMTP
A. Update IMAP Settings : localhost:143 (other) B. Update SMTP Settings : localhost:25
R Return to Main Menu C Turn color on S Save data Q Quit
Command >> A
SquirrelMail Configuration : Read: config_default.php (1.4.0) ——————————————————— Server Settings
General ——- 1. Domain : 202.202.202.202 2. Invert Time : false 3. Sendmail or SMTP : SMTP
IMAP Settings ————– 4. IMAP Server : localhost 5. IMAP Port : 143 6. Authentication type : login 7. Secure IMAP (TLS) : false 8. Server software : other 9. Delimiter : detect
B. Update SMTP Settings : localhost:25 H. Hide IMAP Server Settings
R Return to Main Menu C Turn color on S Save data Q Quit
Command >> 4
This is the hostname where your IMAP server can be contacted. [localhost]: 192.168.0.2
SquirrelMail Configuration : Read: config_default.php (1.4.0) ——————————————————— Server Settings
General ——- 1. Domain : 202.202.202.202 2. Invert Time : false 3. Sendmail or SMTP : SMTP
IMAP Settings ————– 4. IMAP Server : 192.168.0.2 5. IMAP Port : 143 6. Authentication type : login 7. Secure IMAP (TLS) : false 8. Server software : other 9. Delimiter : detect
B. Update SMTP Settings : localhost:25 H. Hide IMAP Server Settings
R Return to Main Menu C Turn color on S Save data Q Quit
Command >> B
SquirrelMail Configuration : Read: config_default.php (1.4.0) ——————————————————— Server Settings
General ——- 1. Domain : 202.202.202.202 2. Invert Time : false 3. Sendmail or SMTP : SMTP
SMTP Settings ————- 4. SMTP Server : localhost 5. SMTP Port : 25 6. POP before SMTP : false 7. SMTP Authentication : none 8. Secure SMTP (TLS) : false
A. Update IMAP Settings : 192.168.0.2:143 (other) H. Hide SMTP Settings
R Return to Main Menu C Turn color on S Save data Q Quit
Command >> 4
This is the hostname of your SMTP server. [localhost]: 192.168.0.2
SquirrelMail Configuration : Read: config_default.php (1.4.0) ——————————————————— Server Settings
General ——- 1. Domain : 202.202.202.202 2. Invert Time : false 3. Sendmail or SMTP : SMTP
SMTP Settings ————- 4. SMTP Server : 192.168.0.2 5. SMTP Port : 25 6. POP before SMTP : false 7. SMTP Authentication : none 8. Secure SMTP (TLS) : false
A. Update IMAP Settings : 192.168.0.2:143 (other) H. Hide SMTP Settings
R Return to Main Menu C Turn color on S Save data Q Quit
Command >> S
Data saved in config.php Press enter to continue…
SquirrelMail Configuration : Read: config_default.php (1.4.0) ——————————————————— Server Settings
General ——- 1. Domain : 202.202.202.202 2. Invert Time : false 3. Sendmail or SMTP : SMTP
SMTP Settings ————- 4. SMTP Server : 192.168.0.2 5. SMTP Port : 25 6. POP before SMTP : false 7. SMTP Authentication : none 8. Secure SMTP (TLS) : false
A. Update IMAP Settings : 192.168.0.2:143 (other)
H. Hide SMTP Settings
R Return to Main Menu C Turn color on S Save data Q Quit
Command >> Q

Tidak ada komentar:

Posting Komentar

Profesi dan Kewirausahaan

  Materi Dasar TJKT- Profesi dan Kewirausahaan (job-profile dan technopreneur) di bidang teknik jaringan komputer dan telekomunikasi   A.   ...