smtp简单邮件传输

时间:2021-01-29 18:08:33

smtp简单邮件传输

1.建立dns(mail.mail.com和liunx.linux.com)

/etc/named.rfc1912.zones

/var/named/liunx.com.zone

/var/named/mail.com.zone

2.vim  /etc/postfix/main.cf

默认设定:

myhostname = linux.linux.com

mydomain = linux.com (域名)

myorigin = $mydomain (邮件地址后缀名)

mydestination = $myhostname,$mydomain, localhost

3.mail root@mail.mail.com(向其他机器的用户发送)

postsuper -d mail-id/*清除未发出去的邮件

postqueue -f/*刷新收邮件箱

vi /etc/aliases:(系统级别)

admin   root

postalias /etc/aliases

mail admin (实际收信人为root)

more::include:/etc/moreusers

vi /etc/postfix/generic:(配置文件级别)/*隐藏实际域名

root@linux.com rensiyuan@qq.com

postmap generic/*通用加密

postconf -e "smtp_generic_maps = hash:/etc/postfix/generic"

systemctl restart postfix.service

telnet ip/*远程控制电脑发邮件

mail from:root@westos.com

rcpt to:root@linux.com