邮件服务系列之编译安装Postfix2.9.15
2016-08-07 13:20
274 查看
Mail Server:
SMTP:简单邮件服务器
ESMTP:扩展的简单邮件服务器
POP3:邮局协议
IMAP4:互联网邮件访问协议
UUCP:Unix主机复制文件的协议
SMTP监听tcp协议的25端口
Open Relay: 开放式中继
SASL:简单认证安全层
WebMail
LDAP:轻量级目录访问协议
MySQL:
虚拟用户:仅用于访问某服务的数字表示:
用户:字符串,凭证
MTA:邮件传输代理,SMTP服务器
sendmail,UUCP
单体机构,SUID,配置文件语法(m4编写)
qmail
postfix:模块化设计,安全,跟sendmmail兼容,效率高
exim:MTA
Exchange (Windows,异步消息协作平台)
SASL:v2
cyrus-sasl
courier-authlib
MDA:邮件投递代理
promail
maildrop
MRA: pop3,imap4
cyrus-imap
dovecot
MUA:邮件用户代理
Outlook Express,Outlook
Foxmail
Thunderbird
Evolution
mutt(文本界面)
WebMail:
Openwebmail
squirrelmail
Extmail(Extman)
Postfix+SASL (courier-authlib) + RySQL
Docecot+MySQL
Extmail+Extman+httpd
[root@www ~]# yum list all |grep sendmail 查看系统是否安装了rpm包的sendmail,如果安装了就卸载掉
[root@www ~]# rpm -e sendmail -nodeps
首先安装MySQL http://www.postfix.org/ 下载postfix源码包
[root@www postfix-2.9.15]# tar -xf postfix-2.9.15.tar.gz
[root@www postfix-2.9.15]# groupadd -g 2525 postfix
[root@www postfix-2.9.15]# useradd -g 2525 -u 2525 -s /sbin/nologin -M postfix
[root@www postfix-2.9.15]# groupadd -g 2526 postdrop
[root@www postfix-2.9.15]# useradd -g 2526 -u 2526 -s /sbin/nologin -M postdrop
[root@www usr]# yum -y install cyrus-sasl-devel.i686
[root@www lib64]# rpm -ql cyrus-sasl-devel 根据sasl的lib和include路径来进行安装
[root@www postfix-2.10.10]# make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/include/sasl -DUSE_TLS' 'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2 -lssl -lcrypto'
CCARGS 编译的时候链接到什么地方,主要是找哪个系统的头文件
AUXLIBS 到哪里去找mysql库文件
instal_root: [/] /
tempdir: [/root/postfix-2.9.3] /tmp/postfix
config_directory: [/etc/postfix] /etc/postfix
daemon_directory: [/usr/libexec/postfix]
command_directory: [/usr/sbin]
queue_directory: [/var/spool/postfix]
sendmail_path: [/usr/sbin/sendmail]
newaliases_path: [/usr/bin/newaliases]
mailq_path: [/usr/bin/mailq]
mail_owner: [postdrop]postfix
setgid_group: [postdrop]
html_directory: [no] /var/www/html/postfix
manpages: [/usr/local/man]
readme_dirctory: [no]
-------------------
postfix start
[root@localhost ~]# tail /var/log/maillog
Aug 6 09:49:21 localhost postfix/master[8115]: fatal: open lock file /var/lib/postfix/master.lock: cannot open file: Permission denied
Aug 6 09:49:22 localhost postfix/master[8114]: fatal: daemon initialization failure
Aug 6 09:49:23 localhost postfix/postfix-script[8116]: fatal: mail system startup failed
Aug 6 09:56:00 localhost postfix/postfix-script[8206]: starting the Postfix mail system
Aug 6 09:56:00 localhost postfix/master[8208]: daemon started -- version 2.10.10, configuration /etc/postfix
Aug 6 15:53:43 localhost postfix/postfix-script[1658]: starting the Postfix mail system
Aug 6 15:53:43 localhost postfix/master[1660]: daemon started -- version 2.10.10, configuration /etc/postfix
Aug 6 16:01:17 localhost postfix/postfix-script[1691]: starting the Postfix mail system
Aug 6 16:01:17 localhost postfix/master[1693]: daemon started -- version 2.10.10, configuration /etc/postfix
Aug 6 16:01:54 localhost postfix/postfix-script[1803]: fatal: the Postfix mail system is already running
postfix的配置文件
postfix模块化:
master:/etc/postfix/master.cf 主进程,用于控制启动的其他进程
mail: /etc/postfix/main.cf 整个邮件服务器的配置文件
参数 = 值:参数必须写在行的绝对行首,以空白开头的行被认为是上一行的延续
[root@localhost ~]# vim /etc/postfix/master.cf
pickup fifo n - n 60 1 pickup 分拣进程
cleanup unix n - n - 0 cleanup 清理进程
qmgr fifo n - n 300 1 qmgr 队列管理器
此配置文件记录进程信息。而每个进程的配置都在/etc/postfix/main.cf里
命令postconf 用于配置postfix
-d 显示默认配置
-n 修改了的配置
-m 显示支持的所有查找表的类型
-A 显示当前主机支持的SASL的类型
-e 参数=某个值。更改某参数的配置信息,并保存至main.cf文件中
[root@localhost ~]# vim /etc/postfix/main.cf
[root@localhost ~]# telnet localhost 25
helo localhost
ehlo localhost
SMTP状态码:
1xx:纯信息
2xx:正确信息
3xx:上一步操作尚未完成,需要继续补充
4xx:暂时性错误
5xx:永久性错误
SMTP协议命令:
hello (smtp协议)|| ehlo (esmtp协议)
mail from :root@mylinux.com 发件人
rcpt to: admin@mylinux.com 收件人
data 正文
. 表示发送
quit退出
alias邮件别名:
abc@mylinux.com : qwe@mylinux.com
所有发给abc的邮件都直接转给qwe
通过编辑/etc/aliases来配置
/etc/aliases-->hash-->aliases.db
#newaliases
[root@localhost ~]# newaliases
[root@localhost ~]# ls /etc/ |grep aliases
aliases
aliases.db
postfix stop
postfix start
postfix默认本机所在网段的地址中继
SMTP:简单邮件服务器
ESMTP:扩展的简单邮件服务器
POP3:邮局协议
IMAP4:互联网邮件访问协议
UUCP:Unix主机复制文件的协议
SMTP监听tcp协议的25端口
Open Relay: 开放式中继
SASL:简单认证安全层
WebMail
LDAP:轻量级目录访问协议
MySQL:
虚拟用户:仅用于访问某服务的数字表示:
用户:字符串,凭证
MTA:邮件传输代理,SMTP服务器
sendmail,UUCP
单体机构,SUID,配置文件语法(m4编写)
qmail
postfix:模块化设计,安全,跟sendmmail兼容,效率高
exim:MTA
Exchange (Windows,异步消息协作平台)
SASL:v2
cyrus-sasl
courier-authlib
MDA:邮件投递代理
promail
maildrop
MRA: pop3,imap4
cyrus-imap
dovecot
MUA:邮件用户代理
Outlook Express,Outlook
Foxmail
Thunderbird
Evolution
mutt(文本界面)
WebMail:
Openwebmail
squirrelmail
Extmail(Extman)
Postfix+SASL (courier-authlib) + RySQL
Docecot+MySQL
Extmail+Extman+httpd
[root@www ~]# yum list all |grep sendmail 查看系统是否安装了rpm包的sendmail,如果安装了就卸载掉
[root@www ~]# rpm -e sendmail -nodeps
首先安装MySQL http://www.postfix.org/ 下载postfix源码包
[root@www postfix-2.9.15]# tar -xf postfix-2.9.15.tar.gz
[root@www postfix-2.9.15]# groupadd -g 2525 postfix
[root@www postfix-2.9.15]# useradd -g 2525 -u 2525 -s /sbin/nologin -M postfix
[root@www postfix-2.9.15]# groupadd -g 2526 postdrop
[root@www postfix-2.9.15]# useradd -g 2526 -u 2526 -s /sbin/nologin -M postdrop
[root@www usr]# yum -y install cyrus-sasl-devel.i686
[root@www lib64]# rpm -ql cyrus-sasl-devel 根据sasl的lib和include路径来进行安装
[root@www postfix-2.10.10]# make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/include/sasl -DUSE_TLS' 'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2 -lssl -lcrypto'
CCARGS 编译的时候链接到什么地方,主要是找哪个系统的头文件
AUXLIBS 到哪里去找mysql库文件
instal_root: [/] /
tempdir: [/root/postfix-2.9.3] /tmp/postfix
config_directory: [/etc/postfix] /etc/postfix
daemon_directory: [/usr/libexec/postfix]
command_directory: [/usr/sbin]
queue_directory: [/var/spool/postfix]
sendmail_path: [/usr/sbin/sendmail]
newaliases_path: [/usr/bin/newaliases]
mailq_path: [/usr/bin/mailq]
mail_owner: [postdrop]postfix
setgid_group: [postdrop]
html_directory: [no] /var/www/html/postfix
manpages: [/usr/local/man]
readme_dirctory: [no]
-------------------
postfix start
[root@localhost ~]# tail /var/log/maillog
Aug 6 09:49:21 localhost postfix/master[8115]: fatal: open lock file /var/lib/postfix/master.lock: cannot open file: Permission denied
Aug 6 09:49:22 localhost postfix/master[8114]: fatal: daemon initialization failure
Aug 6 09:49:23 localhost postfix/postfix-script[8116]: fatal: mail system startup failed
Aug 6 09:56:00 localhost postfix/postfix-script[8206]: starting the Postfix mail system
Aug 6 09:56:00 localhost postfix/master[8208]: daemon started -- version 2.10.10, configuration /etc/postfix
Aug 6 15:53:43 localhost postfix/postfix-script[1658]: starting the Postfix mail system
Aug 6 15:53:43 localhost postfix/master[1660]: daemon started -- version 2.10.10, configuration /etc/postfix
Aug 6 16:01:17 localhost postfix/postfix-script[1691]: starting the Postfix mail system
Aug 6 16:01:17 localhost postfix/master[1693]: daemon started -- version 2.10.10, configuration /etc/postfix
Aug 6 16:01:54 localhost postfix/postfix-script[1803]: fatal: the Postfix mail system is already running
postfix的配置文件
postfix模块化:
master:/etc/postfix/master.cf 主进程,用于控制启动的其他进程
mail: /etc/postfix/main.cf 整个邮件服务器的配置文件
参数 = 值:参数必须写在行的绝对行首,以空白开头的行被认为是上一行的延续
[root@localhost ~]# vim /etc/postfix/master.cf
pickup fifo n - n 60 1 pickup 分拣进程
cleanup unix n - n - 0 cleanup 清理进程
qmgr fifo n - n 300 1 qmgr 队列管理器
此配置文件记录进程信息。而每个进程的配置都在/etc/postfix/main.cf里
命令postconf 用于配置postfix
-d 显示默认配置
-n 修改了的配置
-m 显示支持的所有查找表的类型
-A 显示当前主机支持的SASL的类型
-e 参数=某个值。更改某参数的配置信息,并保存至main.cf文件中
[root@localhost ~]# vim /etc/postfix/main.cf
[root@localhost ~]# telnet localhost 25
helo localhost
ehlo localhost
SMTP状态码:
1xx:纯信息
2xx:正确信息
3xx:上一步操作尚未完成,需要继续补充
4xx:暂时性错误
5xx:永久性错误
SMTP协议命令:
hello (smtp协议)|| ehlo (esmtp协议)
mail from :root@mylinux.com 发件人
rcpt to: admin@mylinux.com 收件人
data 正文
. 表示发送
quit退出
alias邮件别名:
abc@mylinux.com : qwe@mylinux.com
所有发给abc的邮件都直接转给qwe
通过编辑/etc/aliases来配置
/etc/aliases-->hash-->aliases.db
#newaliases
[root@localhost ~]# newaliases
[root@localhost ~]# ls /etc/ |grep aliases
aliases
aliases.db
postfix stop
postfix start
postfix默认本机所在网段的地址中继
相关文章推荐
- 邮件服务系列之二各代理组件及postfix的安装 推荐
- 编译安装postfix邮件服务
- Linux 邮件服务器原理介绍,编译安装Postfix实现本地的邮件服务。
- Linux上邮件服务postfix 2.9.3编译安装
- linux命令:编译安装postfix邮件服务
- Linux系列-Red Hat5平台下的Postfix邮件服务搭建(二)
- linux下Postfix邮件服务安装和基本配置
- 在Linux中安装配置Postfix来搭建邮件发送服务
- Linux系列-Red Hat5平台下的Postfix邮件服务搭建(一)
- 【系列3】使用Dockerfile创建带编译安装nginx服务的Centos Docker镜像
- DNS系列- 2.dns服务搭建(bind编译安装)
- 过Postfix构建Exchange Server 2010邮件网关部署系列三:安装Exchange 2010先决性条件
- 基于LAMP基础上安装Postfix邮件服务
- LAMP系列之-Apache服务生产实战应用指南之安装后基本配置编译版
- Linux系列-Red Hat5平台下的Postfix邮件服务搭建(一
- 构建基于系统用户的Postfix邮件系统(编译安装)
- CentOS 6.x 下Postfix和dovecot邮件服务安装和基本配置
- Postfix系列一:基本配置和别名配置(编译安装)
- 邮件服务系列之三实现postfix+dovecot+sasl
- 编译安装postfix+sasl+mysql+dovecot+extmail构建完成的邮件系统(二)