#rpm -q sendmail
配置dns
vi /etc/named.conf
zone "a.net" IN {
type master;
file "a.net.zone";
};
zone "4.168.192.in-addr.arpa" IN {
type master;
file "1.rev";
};
vi /var/named/a.net.zone
$ttl 38400
a.net. IN SOA dns.a.net.
root.a.net. (
1
1
1
1
1
)
a.net. IN NS dns.a.net.
dns IN A 192.168.4.123
------>linux主机的ip地址
mail.a.net. IN CNAME dns.a.net
a.net. IN MX 3 mail.a.net
vi /var/named/1.rev
$ttl 38400
4.168.192.in-addr.arpa. IN SOA dns.a.net.
root.a.net. (
2
2
2
2
2
)
4.168.192.in-addr.arpa. IN NS dns.a.net.
123.4.168.192.in-addr.arpa. IN PTR dns.a.net.
123 IN PTR mail.a.net
#service named start
#service named reload
rhel4 imap config:
#vi /etc/dovecot.conf
protocols = imap pop3
ipmap_listen = [*]
pop3_listen = [*]
#service dovecot start
#netstat -a | grep tcp
2. sendmail configure
#vi /etc/xinetd.d/ipop3
disable=no
#vi /etc/xinetd.d/imap
disable=no
#service xinetd restart
#netstat -a | grep tcp
tcp pop3(110)
tcp imap(143)
#cp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.bak
#cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.bak
#vi /etc/mail/sendmail.mc
DAEMON_OPTIONS('Port=smtp,Addr=192.168.4.123,Name=MTA')dnl
#m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
#vi local-host-names
a.net
mail.a.net user@a.net user@mail.a.net
#vi access
a.net RELAY
mail.a.net RELAY
192.168.4.0/24 RELAY
#makemap hash access.db < access
linux:
#vi /etc/hosts
192.168.4.123 mail.a.net a.net
#ping mail.a.net
#ping a.net
windows:
star ---> run ----> notepad.exe
c:windowssystem32driversetchosts
192.168.4.123 a.net
192.168.4.123 mail.a.net
saved
star ---> run ----> cmd
ping a.net
ping mail.a.net
#useradd maila
#passwd maila
#useradd mailb
#passwd mailb
#vi /etc/aliases
mailc: maila mailc@a.net=maild@a.net=maila@a.net
maild: maila
#newaliases
#service sendmail start
#netstat -a | grep tcp
tcp smtp(25)
#cat /etc/resolv.conf
nameserver 192.168.4.123
以用户root身份 发送 邮件
#mail maila@a.net
Subject:添加邮件主题
添加内容
Ctrl+d 保存内容
Cc:添加抄送
#mail mailb@a.net
#mail mailc@a.net
#mail maild@a.net
以用户maila身份收取邮件
#su maila
#mail
1 alsdlaskdfj a@mail.net
2 qweqweqwe user@a.net
&1
&quit
看过的邮件保存于
/home/username/mailbox
配置dns
#vi /etc/named.conf
zone "a.net" IN {
type master;
file "a.net.zone";
};
zone "4.168.192.in-addr.arpa" IN {
type master;
file "1.rev";
};
zone "s.s" IN {
type master;
file "s.s.zone";
};
#vi /var/named/a.net.zone
$ttl 38400
a.net. IN SOA dns.a.net.
root.a.net. (
1
1
1
1
1
)
a.net. IN NS dns.a.net.
dns IN A 192.168.4.123
------>linux主机的ip地址
mail.a.net. IN CNAME dns.a.net
a.net. IN MX 3 mail.a.net
#vi /var/named/1.rev
$ttl 38400
4.168.192.in-addr.arpa. IN SOA dns.a.net.
root.a.net. (
2
2
2
2
2
)
4.168.192.in-addr.arpa. IN NS dns.a.net.
123.4.168.192.in-addr.arpa. IN PTR dns.a.net.
123 IN PTR mail.a.net
#vi /var/named/s.s.zone
$ttl 38400
s.s. IN SOA dns.a.net. root.a.net.
(
1
1
1
1
1
)
s.s. IN NS dns.a.net.
s.s. IN MX 4 mail.a.net.
#service named start
#service named reload
#nslookup
>mail.a.net
>set type=mx
>s.s
#vi /etc/mail/local-host-name
s.s
#vi /etc/mail/virtusertable
a@s.s. a
配置postfix
#service sendmail stop
#nmap -a ip
smtp停止
#rpm -q postfix
#vi /etc/postfix/main.cf
myhostname = mail.a.net
mydomain = a.net
myorigin = $myhostname
myorigin = $mydomain
inet_interfaces = mail.a.net
mydestination = $myhostname,$mydomain
#service postfix start
#nmap -a 1.2.3.5
openwebmail configure
#vi /var/www/cgi-bin/openwebmail/etc/openwebmail.conf
smtpserver 1.2.3.5
#vi /var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf
dbmopen_ext .db
#/var/www/cgi-bin/openwebmail/openwebmail-tool.pl --init
#service httpd start
使用浏览器
地址:http://mail.a.net/cgi-bin/openwebmail/openwebmail.pl