Chinaunix首页 | 论坛 | 博客
  • 博客访问: 438003
  • 博文数量: 96
  • 博客积分: 4594
  • 博客等级: 上校
  • 技术积分: 1130
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-30 19:56
文章分类
文章存档

2012年(8)

2011年(49)

2010年(18)

2009年(21)

分类: LINUX

2009-08-12 13:12:22

今天主要的内容是sendmail邮件服务器

首先理解电子邮件传送的基本过程

MUA:电子邮件用户代理 eg:outlook

MTA:邮件传输代理 eg:sendmail   postfix

MDA:投送代理  eg:pop3协议

MRA:邮件目录  eg:Dovecot

1.       SMTP(简单邮件传输协议)

端口: tcp 25     ESMTP:增强扩展的SMTP

Eg:echo hello,I am station6 | mail –s hello

**运用Telnet发送邮件可以用来SMTP故障排除

Eg: telnet station5 25

…..

HELO station6.example.com

….

Mail from:

….

Rcpt to:root@station5.example.com

Data

….

This is a test

.

Quit

2.       sendmail

软件包:sendmail   sendmail-cf

端口:25 (smtp)

配置文件:/etc/mail/sendmail.mc  (.cfm4宏语言编写的配置文件)

#chkconfig sendmail on

#service sendmail start

***接收配置***

#vim /etc/mail/sendmail.mc

查找127.0.0.1  改为 0.0.0.0

当网内无DNS解析时  /etc/mail/local-host-names中添加主机名 可接受对应主机名邮件

 

***发送配置(域伪装)***

#vim /etc/mail/sendmail-mc

 取消以下行的注释

 EXPOSED_USER(root)dnl 除了根不伪装

 FEATURE(masquerade_envelope)dnl  特性

 MASQUERADE_AS(sina.com)dnl 伪装成sina.com

 FEATURE(masquerade_entire_domain)dnl 伪装所有域

#service sendmail restart

 

***入站别名***

本地别名:/etc/aliases

#vim /etc/aliases

 admin: root.,student

#newaliases  更新别名

虚拟别名:/etc/mail/virtusertable

  shopper

@station5.examplecom  %1@station6.examplecom

Eg: station1#echo hello | mail –s hello

   收到邮件的应该是 station6root

 

***重新编写出站地址(完全伪装)***

#vim /etc/mail/sendmail.mc

  FEATURE(genericstable)dnl   :需要添加到MALLER(smtp)上面

  FEATURE(always_add_domain)

  GENERICS_DOMAIN_FILE(/etc/mail/local-host-names)dnl 接收本地hostname

#touch genericstable

#vim genericstable

    

Root发送邮件将会以langdao的身份发出

 
***Sendmail SMTP限制***
#vim /etc/mail/sendmail.mc
  FEATURE(blacklist_recipients)dnl
#vim /etc/mail/access
 From:root@station5.example.com   REJECT
 To:student@    ERROR:550  bad name
#service sendmail restart
 
2.Dovecot
#yum isntall dovecot
端口:110(pop)  995(pop3s)  143(imap)  993(imaps)
配置文件:/etc/dovecot.conf
链接Dovecot   mutt -f pop://student@station6.example.com:993
阅读(1817) | 评论(0) | 转发(0) |
0

上一篇:CE-apache.squid

下一篇:CE-postfix

给主人留下些什么吧!~~