Postfix

1.创建运行用户和组

1)yum -y install cyrus-sasl-devel* cyrus-sasl-plain* cyrus-sasl-lib* cyrus-sasl-2.1*        //安装SASL加密软件包

2)/etc/init.d/postfix stop && chkconfig --level 35 postfix off                    //将系统自带服务停止并开机禁用

3)gpasswd -a postfix postfix                                    //将postfix用户加入到Postfix组

4)gpasswd -a postfix postdrop                                    //将postfix用户加入到postdrop组


2.解压并安装postfix

1)tar -zxvf postfix-3.2.2.tar.gz -C /usr/src/

2)cd /usr/src/postfix-3.2.2/

3)make makefiles 'CCARGS=-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I /usr/include/sasl' 'AUXLIBS=-L/usr/lib64/sasl2 -lsasl2'

//生成Mailfile配置文件,并启动sasl认证、指定依赖库文件位置

//CCARGS:启用SASL认证,并指定SASL头文件存储位置

//AUXLIBS:指定额外的函数库文件位置


4)make && make install


3.编辑配置文件    

1)postconf -n >/tmp/hehe.conf                    //将有效的配置文件导出

2)mv /tmp/hehe.conf /etc/postfix/main.cf

3)vim /etc/postfix/main.cf


  9 inet_interfaces = 192.168.1.10                //指定监听IP
 10 myhostname = mail.xueluo.org                //新增,指定当前主机名
 11 mydomain = xueluo.org                    //新增,指定邮件域
 12 myorigin = $mydomain                    //新增,外发邮件时发送中邮件域
 13 home_mailbox = Maildir/                    //新增,邮件的存储位置(存储到用户的家目录)

 19 mydestination = $myhostname,$mydomain            //允许投递的目标邮件域


4)postfix start                            //启动postfix服务

SMTP邮件测试

1)groupadd mailusers                        //新建用户组

2)useradd -s /sbin/nologin -g mailusers hehe

3)useradd -s /sbin/nologin -g mailusers haha

4)echo "123" | passwd --stdin hehe

5)echo "123" | passwd --stdin haha

6)yum -y install telnet                        //安装远程连接工具

7)telnet mail.xueluo.org 25                    //连接到邮件服务器的25端口

HELO mail.xueluo.org                //宣告客户端地址

MAIL FROM:hehe@xueluo.org            //告知发件人地址

RCPT TO:haha@xueluo.org                //告知收件人地址

DATA                        //告知要发送的邮件数据

Subject: He is he                //指定邮件标题

heh is hehe ~~~~!!!                //撰写邮件正文


.quit                        //邮件编写完毕并退出

quit                        //退出连接


8)ls /home/haha/Maildir/new/            //查看是否有新邮件

 

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值