(Note: I have written this tutorial for FreeBSD server)
First Install Apache in your server.
Apache22
make install
echo ‘apache22_enable=”YES”‘ >> /etc/rc.conf
Install Postfix on FreeBSD
Installing Postfix mail server on FreeBSD server from ports is easy. Just type two commands, you will be ready to go
# make install clean
Installation ask you few questions, just enter y for yes. After installation is finished, you need to disable sendmail and enable postfix, this can be done by modifying /etc/rc.conf
Add following line to end of /etc/rc.conf file
sendmail_submit_enable=”NO”
sendmail_outbound_enable=”NO”
sendmail_msp_queue_enable=”NO”
postfix_enable=”YES”
Now reboot the server, on booting up, you will be using postfix as your mail server.
# /usr/local/etc/rc.d/postfix.sh start
/usr/local/etc/rc.d/postfix.sh stop
You can also set a symlink from /etc/postfix to /usr/local/etc/postfix
# cd /etc # ln -s /usr/local/etc/postfix
Now, Test your postfix server either working or not.
# telnet localhost 25
You will get following message
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
220
pc1f018.wakhok.ac.jp ESMTP Postfix
If you input
helo pc1f018.wakhok.ac.jp
Output is like this
250
pc1f018.wakhok.ac.jp
Send a test email in your mailbox
mail from: <root@pc1f018.wakhok.ac.jp>
250 2.1.0 Ok
rcpt to: <dambarrajpaudel@gmail.com>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: Hello This mail is Coming from Postfix Server
Hello,
I just wanted to send some test mail to you 🙂
Good bye !
.
250 2.0.0 Ok: queued as B95C8110064
quit
You are done Check your mailbox either it is arriving or not. If arrived !!!
Cheers !!