Monday 28 June 2010

mysql, sendmail, postfix, dovecot

LAMP: L-Linux, A-Apache, M-Mysql, P-PHP

simple mysql command
#yum -y install mysql-server mysql php-mysql
#mysql -u root
#mysqladmin -u root password 'mypassword'

3/6 (Thur) Send mail, postfix, dovecot
Setup sendmail
yum -y install m4 sendmail-cf
vi /var/named/zone.file //add MX record into domain zone file
www A 10.1.1.1
@ A 10.1.1.1
mail CNAME www
MX 10 10.1.1.1
/etc/init.d/named restart
vi /etc/mail/sendmail.mc
DAEMON_OPTIONS('Port=smtp,Addr=0.0.0.0,Name=MTA')dnl //change Addr from 127.0.0.1 to 0.0.0.0
m4 sendmail.mc >sendmail.cf
service sendmail restart
vi /etc/mail/local-host-names
in234.lpi //add hostname to in234.lpi
//test sendmail
mail -u owner
less /var/mail/owner

Setting Postfix
yum -y install postfix
vi /etc/postfix/main.cf
myhostname=in234.lpi
inet_interfaces=all
mydestination=$myhostname,localhost.$mydomain,$mydomain
mynetworks=10.1.1.0/24,127.0.0.0/8
/etc/init.d/postfix restart
//test postfix
mail -s test owner@in234.lpi
less /var/mail/owner
//view mail queue
postqueue -p
postqueue -s //flush all queue mails

Setup a pop3 server - dovecot
#yum -y install dovecot
#service dovecot start
Use X server email client Evolution Mail to test to receive email.

No comments:

Post a Comment