Saturday, March 29, 2008

Instalasi Postfix

1. Persiapan Sebelum Instalasi Postfix

Sebelum melakukan instalasi mail server Postfix, ada beberapa aplikasi pendukung yang harus didownload dan diinstalasi dengan baik dan benar. Aplikasi tersebut adalah:

  1. MySQL
  2. OpenSSL
  3. Cyrus-SASL

Cara instalasi dua aplikasi pertama, MySQL dan OpenSSL sudah saya sampaikan pada artikel sebelumnya. Silakan dilihat kembali pada artikel tersebut. Jadi, di sini hanya akan menginstall Cyrus-SASL.

Cyrus SASL adalah paket yang berisi sebuah Simple Authentication and Security Layer dan merupakan metode yang dipergunakan untuk menambahkan dukungan autentikasi ke connection-based protocol. Untuk menggunakan SASL, sebuah protocol menyertakan sebuah perintah agar mengidentifikasi dan menerima autentikasi user pada suatu server atau dengan kata lain, menegosiasikan interaksi proteksi protocol secara berurutan, sehingga sebuah layer security akan disisipkan antara protocol dan koneksinya.

Cyrus-SASL dapat didownload di:

HTTP Server :
http://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.22.tar.gz
FTP Server :
ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.22.tar.gz

Setelah mendownload source di atas, langkah berikutnya adalah menginstalasinya. Instalasi Cyrus-SASL akan disupport oleh MySQL untuk authentikasinya. Saya asumsikan hasil download source disimpan di direktori /home/users.

Langkah-langkah instalasinya adalah:

Download dan decompress source.

$ wget http://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.22.tar.gz
$ tar -zxf cyrus-sasl-2.1.22.tar.gz
$ cd cyrus-sasl-2.1.22

Konfigurasi dan instalasi.

$ CPPFLAGS=”-I/usr/local/include/mysql” \
./configure \
–enable-anon \
–enable-plain \
–enable-login \
–disable-krb4 \
–enable-otp \
–enable-cram \
–enable-digest \
–enable-sql \
–with-mysql=/usr/local/lib/mysql \
–with-pam \
–with-saslauthd=/var/run/saslauthd \
–with-dblib=berkeley \
–with-bdb-libdir=/usr/local/lib \
–with-bdb-incdir=/usr/local/include \
–with-openssl=/usr/local \
–with-plugindir=/usr/local/lib/sasl2

$ make
$ sudo make install

Sampai langkah ini, langkah pra instalasi Postfix sudah selesai. Saya tidak akan mengikutsertakan penjelasan mengenai opsi-opsi instalasi di atas, karena pembahasan artikel ini cukup panjang.

2. Instalasi dan Konfigurasi Postfix

Release versi stable Postfix saat artikel ini ditulis adalah Postfix versi 2.3.4. Source terakhir dapat didownload di http://www.postfix.org. Postfix akan kita install dengan dukungan MySQL dan SSL/TLS. Jadi, pastikan aplikasi-aplikasi pendukungnya sudah terinstall dengan baik.

2.1. Install Postfix

Download dan decompress Postfix.

$ wget ftp://mirror.cbn.net.id/pub/postfix-release/official/postfix-2.3.4.tar.gz
$ tar -zxf postfix-2.3.4.tar.gz
$ cd postfix-2.3.4

Konfigurasi dan instalasi.

$ make tidy
$ make makefiles ‘CCARGS=-DHAS_MYSQL \
-I/usr/local/include/mysql -DUSE_SASL_AUTH \ -DUSE_CYRUS_SASL \
-I/usr/local/include/sasl -I/usr/local/include/db44 \
-DUSE_TLS -I/usr/local/include/openssl’ \
‘AUXLIBS=-L/usr/local/lib/mysql -lmysqlclient \
-lz -lm -L/usr/local/lib -lsasl2 -L/usr/local/lib/db44 -ldb \
-L/usr/local/lib/openssl -lssl -lcrypto -lpthread’

$ sudo make install

Catatan: Untuk postfix 2.3.x ke atas bila menggunakan autentikasi SASL harus menyertakan opsi -DUSE_CYRUS_SASL

Kemudian cek library yang disupport oleh Postfix, apakah sudah sesuai dengan kebutuhan kita.

$ ldd /usr/libexec/postfix/smtpd

Output berikut ini dihasilkan dari kompilasi di atas.

libmysqlclient.so.15 => /usr/local/lib/mysql/libmysqlclient.so.15 (0×28097000)
libz.so.3 => /lib/libz.so.3 (0×280f0000)
libm.so.4 => /lib/libm.so.4 (0×28100000)
libsasl2.so.2 => /usr/local/lib/libsasl2.so.2 (0×28119000)
libdb-4.4.so.0 => /usr/local/lib/libdb-4.4.so.0 (0×2812e000)
libssl.so.5 => /usr/local/lib/libssl.so.5 (0×2820f000)
libcrypto.so.5 => /usr/local/lib/libcrypto.so.5 (0×28249000)
libpthread.so.2 => /usr/lib/libpthread.so.2 (0×2835f000)
libc.so.6 => /lib/libc.so.6 (0×28383000)
libcrypt.so.3 => /lib/libcrypt.so.3 (0×2846c000)

2.2. Install Courier-Authlib

a. Install program expect dari ports, ini berfungsi untuk mengubah password via web.
b. Download source file di http://www.courier-mta.org/?download.php~authlib
c. Ekstrak source, tar -jxf courier-authlib-0.58.tar.bz2
d. cd courier-authlib-8.58
d. Compile:

$ ./configure \
–with-mysql-libs=/usr/local/lib/mysql \
–with-mysql-includes=/usr/local/include/mysql \
–with-authmysql \
–with-authmysql=yes \
–with-mailuser=vmail \
–with-mailgroup=postfix
$ make
$ sudo make install

2.3. Install Courier-IMAP

a. Download source terbaru di http://www.courier-mta.org/?download.php~imap
b. Ekstrak source, tar -jxf courier-imap-4.1.1.tar.bz2
c. cd courier-imap-4.1.1
d. Compile:

$ CPPFLAGS=”-I/usr/local/include” \
./configure \
–prefix=/usr/local/courier-imap \
–enable-workarounds-for-imap-client-bugs \
–with-authchangepwdir \
–enable-unicode \
–with-trashquota \
–with-ssl=/usr/local

$ make
$ sudo make install

Sampai langkah di atas, SSL belum terkompilasi dengan Courier IMAP. Agar Courier IMAP support SSL maka lakukan langkah-langkah berikut:

$ cd /tcpd
$ make distclean
$ export LD_RUN_PATH=${LD_RUN_PATH}:/usr/local/lib
$ export C_INCLUDE_PATH=${C_INCLUDE_PATH}:/usr/local/lib
$ export LDFLAGS=”${LDFLAGS} -L/usr/local/lib -Wl,–rpath=/usr/local/lib”
$ export CC=”gcc -L/usr/local/lib -Wl,–rpath=/usr/lib”
$ ./configure
$ make couriertls
$ sudo cp ./couriertls /usr/local/courier/bin

Perintah-perintah di atas akan menginstalasi TLS interface courier dengan support SSL. Kemudian buatlah SSL certificate dengan menjalankan:

$ /usr/local/courier/share/mkimapdcert

2.4. Install Maildrop

a. Download source terbaru di http://www.courier-mta.org/?download.php~maildrop.
b. Ekstrak.
c. cd maildrop-x.x
d. Compile:

$ groupadd vmail -g 1004 (as root)
$ useradd vmail -u 1004 -g 1004 (as root)
$ export CPPFLAGS=”-I/usr/local/include/mysql”
$ export LDFLAGS=”-L/usr/local/lib/mysql”
$ ./configure \
–enable-maildirquota \
–enable-maildropmysql \
–with-mysqlconfig=/etc/postfix/maildropmysql.config \
–enable-trusted-users=’root postfix vmail’ \
–enable-maildrop-uid=root \
–enable-maildrop-gid=postfix \
–with-trashquota

$ make
$ sudo make instal

2.5. Install SpamAssassin

Sebelum menginstalasi SpamAssassin terlebih dahulu install beberapa perl module yang diperlukan berikut.

$ sudo perl -MCPAN -e shell

cpan> o conf prerequisites_policy follow
cpan> install LWP MD5
cpan> install Digest::SHA1 HTML::Parser
cpan> install MIME::Base64 DB_File Net::DNS Net::SMTP Mail::SPF::Query IP::Country::Fast Time::HiRes IO::Zlib Archive::Tar
cpan> install Net::Ident IO::Socket::INET6 IO::Socket::SSL DBI
cpan> quit

Install Razor-agents dari ports (BSD family)

$ cd /usr/ports/mail/razor-agents
$ sudo make install

Install source SpamAssassin

Download dan unpack source

$ cd ~/
$ wget http://apache.mirror.pacific.net.au/spamassassin/source/Mail-SpamAssassin-3.1.3.tar.gz

$ tar xzf Mail-SpamAssassin-3.1.3.tar.gz
$ cd Mail-SpamAssassin-3.1.3

Compile dan install

$ perl Makefile.PL
#[pertanyaan, silakan dijawab sesuai keperluan]

Pada saat proses di atas mungkin ada beberapa perl module opsional yang diperlukan, install bila belum tersedia (ingat module-module tersebut hanya opsional saja). Setelah selesai lakukan:

$ make
$ sudo make install

Cara lain install dari ports

$ cd /usr/ports/mail/p5-Mail-SpamAssassin
$ sudo make install

Akan muncul windows baru untuk memilih opsi-opsi yang diinginkan. Karena saya mensupport SPF dan dan DomainKeys saya aktifkan dua opsi tersebut.

Untuk mengaktifkan spamassassin saat booting ketikkan command berikut:

$ sudo echo “spamd_enable=”YES”" >> /etc/rc.conf

Edit file konfigurasi SpamAssassin.

$ sudo ee /etc/mail/spamassassin/local.cf atau kalau menginstall dari port di direktori /usr/local/etc/mail/spamassassin/local.cf

## Enable auto-whitelisting
use_auto_whitelist 1

####
# WILL HAVE NO EFFECT. THE EQUIVALENT SETTINGS IN AMAVISD ARE THE ONES YOU NEED TO SET
#
# ## Required point score before considered spam
# required_score 5
#
#
# ## What to tag the subject line with
# rewrite_header Subject [SPAM]
#
# ## Put the report in the headers. Dont touch the body of the message at all
# report_safe 0

# Enable the Bayes system
use_bayes 1
bayes_auto_learn 1
bayes_auto_learn_threshold_spam 10

## Set headers which may provide inappropriate cues to the Bayesian
## classifier
bayes_ignore_header X-Bogosity
bayes_ignore_header X-Spam-Flag
bayes_ignore_header X-Spam-Status

## Enable or disable network checks
skip_rbl_checks 0

## File locking method. We dont need to worry about being NFS-safe
lock_method flock

## Give spamassassin some hints as to what IPs are under our control.
## Generally this will be a similar list to what you have put in the postfix mynetworks file
trusted_networks 127.0.0.1 # needed so amavisd headers don’t trip up spamassassin
trusted_networks 192.168.1.0/24 # you need to include all the IPs your mail server, and local LAN workstation

Thursday, March 13, 2008

Like and Dislike

I like reading newspaper because newspaper give me so much knowledge and information. From newspaper I can get information about politics, education, social, business especially in Indonesia. It’s interesting for me because I know what is going on in this world today. Newspaper contains of many collums such as politics, education, social, business collums. But I like politics collum because politics give me lesson about how to speak in front of public, teach me how to make a decision and how to organize a team work.

However, in Indonesia there are some kinds of newspaper are published every day. For example, Media Indonesia, Kompas, Republik and so on. I like Kompas very much because Kompas gives me detail events on each news. I like to read newspaper but I

never buy them. I always read newspaper in the library in my college. Sometimes, I read Kompas online on www.kompas.com.

Heart Disease in Western Societies.

Based on a research, heart disease have caused more than 60 million deaths in America. According to health experts, heart disease can be caused by many factors such as cigarettes, diabetes, obesity, cholesterol, gender and genetics. But, the major factor is bad lifestyle especially related to eating and working habit.

Western societies are hard workers, discipline and workaholics. They really appreciate professionalism. Their work habit is ignoring their health. Sometimes, to fulfill work target, they often forget having lunch, rest and are under pressure. They always eat same lunch which is containing high cholesterol. Because of this life style, they have high risk to get heart disease.

The best solution to prevent heart disease in western societies is changing their lifestyle. First is changing eating habit. They must have breakfast, lunch and dinner on time and the menus should be different each time, containing enough macro and micronutrient and less cholesterol. They also have to avoid cigarettes and alcohol. Then to prevent overweight they should have regular physical exercises, minimum twice a week.

In conclusion, we must be care about our health even though we are very busy and have so many jobs. Eat on time with health menu, don’t be stress, do physical exercise regularly, far away from smoking and alcohol are the solution to prevent heart disease in Western society.

Tuesday, March 4, 2008

My Opinion about Space Exploration

Space exploration is the use of astronomy and space technology to explore outer space. Physical exploration of space is conducted both by human spaceflights and by robotic spacecraft.

The research that is done by space exploration agencies such as NASA and RKA is one of the reasons supporters justify government expenses. Some even claim that space exploration is a necessity to mankind and that staying in our home planet will lead us to oblivion. Some of the reasons are lack of natural resources, comets, nuclear war, worldwide epidemic etc. Stephen Hawking renowned British theoretical physicist said that "I don't think the human race will survive the next thousand years, unless we spread into space. There are too many accidents that can befall life on a single planet. But I'm an optimist. We will reach out to the stars."

NASA has produced a series of Public Service Announcement videos supporting the concept of space exploration.Overall, the public remains largely supportive of both manned and unmanned space exploration. According to an Associated Press Poll conducted in July 2003, 71% of U.S. citizens agreed with the statement that the space program is "a good investment", compared to 21% who did not.

This is not to say that space exploration advocates do not criticize existing programs. Some supporters of space explorations, such as Robert Zubrin, have criticized on-orbit assembly of spacecraft as unnecessary and expensive, and argue for a direct approach for human exploration, such as Mars Direct.

Many criticisms of space exploration are particularly critical of exploration carried out by means of human spaceflight. It is more expensive to perform certain tasks in space with humans rather than by robots or machines. Humans need a large spacecraft that contains provisions such as a hermetic and temperature controlled cabin, production of breathable air, food and drink storage, waste disposal, voice- and other communication systems, and safety features such as crew escape systems, medical facilities, etc. There is also the question of the security of the spacecraft as whole losing a robot is nowhere near as dramatic as human loss, so overall safety of non-human missions is not as much of an issue. All of these extra expenses have to be weighed against the value of having humans aboard. Some critics argue that those few instances where human intervention is essential do not justify the enormous extra costs of having humans aboard. However, others argue, with some reason, that many tasks can be more effectively accomplished by human beings.

Some people also have moral objections to the huge costs of space travel, and say that even a fraction of the space travel budget would make a huge difference in fighting disease and hunger in the world. However, compared to much more costly endeavors, like military actions, space exploration itself receives a very small percentage of total government spending (nearly always under 0.5%), and it is also frequently pointed out by pro-space advocates that the long term benefits could outweigh the short-term costs. In addition, the successful launches of Space Ship One, a privately constructed, reusable space plane developed for only $25 million dollars, has further diminished the impact of cost-based criticisms

According to advantages and disadvantanges, I conclude that space exploration is important because it gives us so many information about our space eventhough it is very expensive. We can search money with in a short time but we can’t search information and knowledge in a short time. Knowledge is a such an important in this life.