CentOS 5.3安装Postfix+Extmail邮件服务器
CentOS5.3安装postfix+extmail邮件系统

CentOS5.3安装postfix+extmail邮件系统作者:哈密瓜bbs:Blog:系统所有环境都是采用yum安装改变系统语言关闭selinuxvi/etc/selinux/config去除IPV6修改网关vi/etc/sysconfig/network设IPvi/etc/sysconfig/network-scripts/ifcfg-eth0定义yum的非官方库关闭不需要的服务chkconfig mcstrans offchkconfig restorecond offchkconfig ip6tables offchkconfig iptables offchkconfig netfs off安装必需软件yum-y install ntsysv ntp telnet wget rsync vixie-cron logwatch perl-Unix-Syslog perl-Net-Daemon perl-PlRPC perl-DBI perl-DBD-MySQL freetype-demos freetype-devel libart_lgpl-devel libpng libpng-devel perl-Time-HiRes perl-Time-HiRes-Value perl-File-Tail perl-libwww-perl perl-HTML-Parser perl-HTML-Tagset perl-IO-stringy perl-IO-Multiplex perl-MailTools perl-TimeDate perl-Convert-ASN1perl-Convert-BinHex perl-MIME-tools perl-FCGI perl-GD rrdtool rrdtool-perl apr-devel apr-docs apr-util-devel apr-util-docs giflib libgdiplus mono-core dbus-sharp dbus-sharp-devel dbus-glib-devel dbh dbh-devel pcre pcre-devel httpd httpd-devel httpd-manual mysql mysql-devel mysql-server cyrus-sasl cyrus-sasl-plain bind bind-chroot amavisd-new clamd clamav clamav-db spamassassin bison bzip2-devel expect fam-devel flex freetype-devel gcc gcc-c++gdbm-devel libc-client-devel libjpeg-devel libmcrypt libmcrypt-devel libpng-devel libxslt-devel make rpm-build mod_ssl php php-gd php-mysql php-mbstring php-mcrypt phpmyadmin perl-Mon perl-Authen-PAM perl-Filter perl-Net_SSLeay.pm perl-Convert-BER perl-URI perl-XML-SAX perl-Crypt-Blowfish perl-Crypt-CBC perl-Date-Calc ncurses-devel net-snmp-devel libtool openssl openssl-devel openssl-perl pam-devel pkgconfig postgresql-devel zlib-devel启动mysql和apahcechkconfig httpd onchkconfig mysqld on升级包yum-y update重启系统reboot重新生成rpm包安装postfixcd/usr/local/srcwget /centos/5/os/SRPMS/postfix-2.3.3-2.src.rpmrpm-ivh postfix-2.3.3-2.src.rpmcd/usr/src/redhat/SPECSrpm-Uvh/usr/src/redhat/RPMS/i386/postfix-2.3.*新建邮件用户、组/usr/sbin/groupadd-g1000vgroup/usr/sbin/useradd-g1000-u1000-M-s/bin/false vuser安装courier-authlibcd/usr/local/srcwget /courier/courier-authlib-0.61.0.tar.bz2tar jxvf courier-authlib-0.61.0.tar.bz2ldconfigldconfig-vcp courier-authlib.sysvinit/etc/rc.d/init.d/courier-authlibchmod755/etc/rc.d/init.d/courier-authlibchkconfig--add courier-authlibchkconfig courier-authlib onchmod755/usr/local/courier-authlib/var/spool/authdaemonmv/usr/local/courier-authlib/etc/authlib/authmysqlrc/usr/local/courier-authlib/etc/authlib/authmysqlrc.bak设置smtpdservice courier-authlib startln-s/usr/local/courier-authlib/bin/courierauthconfig/usr/bin/courierauthconfig 安装maildorpcd/usr/local/srcwget /courier/maildrop-2.0.4.tar.bz2tar jvxf maildrop-2.0.4.tar.bz2安装courier-imapcd/usr/local/srcwget /courier/courier-imap-4.4.1.tar.bz2tar jvxf courier-imap-4.4.1.tar.bz2cp/usr/local/courier-imap/etc/imapd.dist/usr/local/courier-imap/etc/imapdcp/usr/local/courier-imap/etc/imapd-ssl.dist/usr/local/courier-imap/etc/imapd-ssl cp/usr/local/courier-imap/etc/pop3d.dist/usr/local/courier-imap/etc/pop3dcp/usr/local/courier-imap/etc/pop3d-ssl.dist/usr/local/courier-imap/etc/pop3d-ssl cp courier-imap.sysvinit/etc/rc.d/init.d/courier-imapdchmod755/etc/rc.d/init.d/courier-imapdchkconfig--add courier-imapd配置pop将extmail,extman,slock安装包上传安装extmailcd/usr/local/srcmkdir/var/www/extsuitetar-zxvf extmail-1.0.5.tar.gzcp-r extmail-1.0.5/var/www/extsuite/extmailcd/var/www/extsuite/extmailcp webmail.cf.default webmail.cfchown-R vuser:vgroup/var/www/extsuite/extmail/cgi/安装extmancd/usr/local/srctar-zxvf extman-0.2.5.tar.gzcp-r extman-0.2.5/var/www/extsuite/extman/chown-R vuser:vgroup/var/www/extsuite/extman/cgi/mkdir/var/www/extsuite/extman/tmpchown-R vuser:vgroup/var/www/extsuite/extman/tmpvi/var/www/extsuite/extman/docs/init.sql将改为你的域名比如导入数据库mysql-u root-p</var/www/extsuite/extman/docs/extmail.sqlmysql-u root-p</var/www/extsuite/extman/docs/init.sql生成extmail系统管理员的用户目录cd/var/www/extsuite/extman/tools./maildirmake.pl/home/domains//postmaster/Maildirchown-R vuser:vgroup/home/domainscp-r/var/www/extsuite/extman/addon/mailgraph_ext//usr/local/mailgraph_ext/ echo"/usr/local/mailgraph_ext/mailgraph-init start">>/etc/rc.d/rc.local echo"/usr/local/mailgraph_ext/qmonitor-init start">>/etc/rc.d/rc.local安装slockdcd/usr/local/srctar-zxvf slockd-0.2.tar.gzcp-r slockd-0.2/usr/local/slockdecho"/usr/local/slockd/slockd-init start">>/etc/rc.d/rc.local配置apache安装fastcgi模块cd/usr/local/srcwget /dist/mod_fastcgi-2.4.6.tar.gztar xfz mod_fastcgi-2.4.6.tar.gzcd mod_fastcgi-2.4.6ln-s../../usr/lib/httpd/build/etc/httpd/buildcp Makefile.AP2Makefilemake top_dir=/etc/httpd installecho"/var/www/extsuite/extmail/dispatch-init start">>/etc/rc.d/rc.local/var/www/extsuite/extmail/dispatch-init start配置phpmyadminln-s/usr/share/phpmyadmin/var/www/extsuite/phpmyadmin注:初始安装账户extmail,extman密码可能有点问题登陆不进去,这个可以用phpmyadmin来设置密码,默认phpmyadmin root密码为空$1$ITIH4eKD$s9C2wHpLQXOLkzY5U1jYL.=extmail而后再从extman后台去修改密码就可以了。
CentOS上安装配置Postfix + Extmail 邮件服务系统

RHEL/CentOS上安装配置Postfix + Extmail 邮件服务系统一、文档简介:本文以最简单方便的方法在centos 5.2 上安装全功能邮件系统,此文适合REDHAT所有系列,在文中,能用RPM 安装的,我们将采用rpm 安装,如果rpm没有的,我们将创建自己的rpm。
部分软件简介:1、AMP ---apache(web服务) 、mysql(数据库)、php(非必需) 的简称2、postfix --mta 邮件系统核心3、courier-authlib--一个为courier-imap,maildrop,sasl2 提供用户信息的后台进程序4、courier-imap --提供pop3,pop3s,imap,imaps 服务的程序5、amavisd-new --提供内容过滤6、clamav -- 著名的杀毒软件7、extmail --一个著名的webmail程序8、extman --与extmail集成的后台管理程序9、slockd --一个基于smtp阶段的反垃圾邮件程序10、vhmgr --由本文作者编写,用于管理apache,ftp,mysql 的虚拟主机管理程序。
安装环境:centos 5.2域名机器名:域名:二、安装系统安装系统时,选择“customize software selection”(自定义安装),在package group selection 对话框里选择:[*]base[*]devlopment libraries[*]development tools[*]editors[*]text-base internet其它不选择。
在setup agnet(或进入系统后运行setup) 里选择firewall configuration 将security level 与SELinux 改为disabled,目的是为了避免在安装调试时产生不必要的麻烦,在系统安装完成后,可以自己去调试安全部分,在这里将不作详细介绍。
构建postfix邮件服务器(五)extmail和extman的安装,实现web使用和管理邮件系统

构建postfix邮件服务器(五)extmail和extman的安装,实现web使用和管理邮件系统2010年3月17日稀饭发表评论阅读评论一、准备1.在 中下载extmail-1.2.tar.gz 和extman1.1Extmail 用于从浏览器中登入、使用邮件系统Extman 用于从浏览器中管邮件系统2.由于安装extmail要用到以下三个包(到 中搜索)1)Unix-Syslog /~mharnisch/Unix-Syslog-1.1/Syslog.pm2)DBI /~timb/DBI-1.609/3)DBD-mysql /~capttofu/DBD-mysql-4.013/lib/DBD/mysql.pm3.安装Extman web管理要用到以下四个软件包1)GD /~lds/GD-2.44/ 解决验证码2)File-Tail /~mgrabnar/File-Tail-0.99.3/ 支持图形日志3)rrdtool-1.2.23-3..el5.i386.rpm 支持图形日志4)rrdtool-perl-1.2.23-3.el5.i386.rpm 支持图形日志二、按先后顺序安装以下软件1.安装Unix-Syslog1)解压tar zxvf Unix-Syslog-1.1.tar.gz2)进入目录cd Unix-syslog-1.13)预配置perl Makefile.PL4)编译,安装make ; make install2.安装DBI1)解压tar zxvf DBI-1.609.tar.gz2)进入目录cd DBI-1.6093)预配置perl Makefile.PL4)编译,安装make ; make install3.安装DBI1)export PATH=$PATH:/usr/local/mysql/bin/ (这一步必须)2)解压tar DBD-mysql-4.013.tar.gz3)进入目录cd DBD-mysql-4.013.tar.gz4)预配置perl Makefile.PL5)编译,安装make ; make install4.安装GD1)解压tar zxvf GD-2.44.tar.gz2)进入目录cd DBI-1.6093)预配置perl Makefile.PL4)编译,安装make ; make install5.安装File-Tail1)解压tar zxvf File-Tail-0.99.3.tar.gz2)进入目录cd File-Tail-0.99.33)预配置perl Makefile.PL4)编译,安装make ; make install6.安装rrdtoolrpm -ivh rrdtool-1.2.23-3.el5.wrl.i386.rpmrpm -ivh rrdtool-perl-1.2.23-3.el5.wrl.i386.rpm三、安装Extmail套件1.解压extmail1.2到apache服务器的WEB文档根目录中去tar zxvf extmail-1.2.tar.gz -C /usr/local/apache2/htdocs/2.进入WEB文档目录修改extmai-1.2目录的名字cd /usr/local/apache2/htdocs/mv extmail-1.2 extmail3.调整cgi子目录的属主和属组,以便Apache服务器有权限执行suexec操作cd extmail/chown -R postfix:postfix cgi4.建立webmail.cf 配置文件,并修改cp webmail.cf.default webmail.cfvi /usr/local/apache2/htdocs/extmail/webmail.cfSYS_CONFIG = /usr/local/apache2/htdocs/extmail/ \\程序根目录SYS_LANGDIR = /usr/local/apache2/htdocs/extmail/lang \\ 语言包文件目录SYS_TEMPLDIR = /usr/local/apache2/htdocs/extmail/html \\系统模板目录SYS_MAILDIR_BASE = /mailbox \\邮件存储目录SYS_MYSQL_USER = extmail \\访问myslq数据库的用户名SYS_MYSQL_PASS = extmail \\访问msyql数据用户的面貌SYS_MYSQL_DB = extmail \\使用的数据库名称SYS_MYSQL_HOST = localhost \\msyql服务器的地址SYS_MYSQL_SOCKET = /tmp/mysql.sock \\mysql套接字文件位置5.调整apache的httpd.conf配置文件,并添加一个虚拟主机,重启httpd服务1)调整httpd.conf 开启虚拟主机(配置文件是/usr/local /apache2/conf/httpd.con)①vi /usr/local/apache2/conf/httpd.conf②查找vhost,找到#Include conf/extra/httpd-vhosts.conf 去掉前面的#号2)添加一个虚拟机(配置文件在/usr/local/apache2/conf/extra/httpd-vhosts.conf)vim /usr/local/apache2/conf/extra/httpd-vhosts.conf修改成以下内容NameVirtualHost 192.168.18.138:80<VirtualHost 192.168.18.138:80>ServerName DocumentRoot /usr/local/apache2/htdocs/extmail/html/ScriptAlias /extmail/cgi/ /usr/local/apache2/htdocs/extmail/cgi/Alias /extmail /usr/local/apache2/htdocs/extmail/html/SuexecUserGroup postfix postfix</VirtualHost>6.在游览器中输入 ,进入下图界面表示成功四、安装Extman web 管理界面1.解压extman1.1到apache服务器的WEB文档根目录中去tar zxvf extman-1.1 -C /usr/local/apache2/htdocs/2.进入WEB文档目录修改extman1.1目录的名字cd /usr/local/apache2/htdocs/mv extman-1.1 extman3.调整cgi子目录的属主和属组,以便Apache服务器有权限执行suexec操作chown -R postfix:postfix /usr/local/apache2/htdocs/extman/cgi/4.创建系统链式会话保存目录,将属主和属组设置为postfixmkdir /tmp/extmanchown -R postfix:postfix /tmp/extman/5.建立webmail.cf 配置文件,并修改cd /usr/local/apache2/htdocs/extman/cp webmail.cf.default webmail.cfvi /usr/local/apache2/htdocs/extman/webman.cfSYS_CONFIG = /usr/local/apache2/htdocs/extman/ \\程序根目录SYS_LANGDIR = /usr/local/apache2/htdocs/extman/lang \\ 语言包文件目录SYS_TEMPLDIR = /usr/local/apache2/htdocs/extman/html \\系统模板目录SYS_MAILDIR_BASE = /mailbox \\邮件存储目录SYS_MYSQL_USER = webman \\访问myslq数据库的用户名SYS_MYSQL_PASS = webman \\访问msyql数据用户的面貌SYS_MYSQL_DB = extmail \\使用的数据库名称SYS_MYSQL_HOST = localhost \\msyql服务器的地址SYS_MYSQL_SOCKET = /tmp/mysql.sock \\mysql套接字文件位置6.调整apache虚拟机的配置(配置文件在/usr/local/apache2/conf/extra/httpd-vhosts.conf)1)在原来对应Extmail套件的虚拟主机配置中,添加extman相关目录的别名设置即可,无需重新建立虚拟主机①vi /usr/local/apache2/conf/extra/httpd-vhosts.conf②添加如下两行ScriptAlias /extman/cgi/ /usr/local/apache2/htdocs/extman/cgi/Alias /extman /usr/local/apache2/htdocs/extman/html/2)重启apache/usr/local/apache2/bin/apachectl restart7.测试1)在浏览器中输入/extman进入下图表示成功2)默认用户为root@ 密码为extmail*123*8.启用图形化日志信息1)进入mailgraph_ext目录cd /usr/local/apache2/htdocs/extman/addon/mailgraph_ext/2)新建mailgraph_ext目录mkdir /usr/local/mailgraph_ext3)复制脚本mailgraph_ext.pl和qmonitor.pl到新建的目录Cp mailgraph_ext.pl qmonitor.pl /usr/local/mailgraph_ext/4)启动/usr/local/apache2/htdocs/extman/addon/mailgraph_ext/mailgraph-init start /usr/local/apache2/htdocs/extman/addon/mailgraph_ext/qmonitor.pl start &5)当在extman中点击图形日志时出现下图表示成功。
安装及配置Postfix邮件服务器

安装、配置Postfix邮件服务器一、编译、安装注:只要按照此安装及配置步骤进行,均可成功实现安装、配置postfix。
文中“』”表示空格1、关闭sendmailservice』sendmail』stop2、添加用户组和用户groupadd』–g』1200』postdropgroupadd』–g』1000』postfixuseradd』–M』–u』1000』–g』postfix』–G』postdrop –s/sbin/nologin』postfix3、编译安装1)进入源码包所在目录如:cd』/home/hello/2)列补丁(可省略)l(小写的“L”)3)解压补丁包(可省略)gunzip』postfix----vda-ng.patch.gz4)解压源码包tar』zxvf』postfix-2.6.2.tar.gz』–C』/usr/src/cd』/usr/src/』postfix-2.6.2注:–C』/usr/src/ 是指把解压后当然源码包存放在/usr/src/目录下;cd』/usr/src/』postfix-2.6.2 是指进入源码包目录。
5)打补丁(可省略)Patch』–p1』<』/home/hello/----补丁存放当然位置6)编译make如果此时出現缺少db*-devel错误:install the appropriate db*-devel package firstmake: ***[makefiles] error解决办法:到光盘下去把db*-devel文件查找出来或把整个linux包,拷贝到相应位置,然后用如下命令进行安装rpm』–ivh』-force-debian』–nodeps』/home/hello/db*-devel.rpm7)安装make』install到此postfix安装完成,postfix在/usr/src/postfix-2.6.2中二、配置postfix1、postfix必须有DNS支撑启动dnsservice named restart测试DNS是否正确nslook退出用exit2、进入postfix工作目录cd』/etc/postfix/3、得到有效的配置项postconf』–n >』main.cf-把主配置文件改名mv』main.cf』main.cf.bak为得到的配置文件改名mv』main.cf-』main.cf查看一下vi main.cf4、添加如下行:Inet_interfaces=127.0.0.1,192.168.1.1myhostname=mydomain=myorigin=$mydomainmydestination=$mydomain,$myhostnamhome_mailbox=Maildir/ //邮件存放位置5、启动服务postfix start查看是否服务启动netstat –anltp | grep 256、添加邮件用户并测groupadd mailusersuseradd–g mailusers–s/sbin/nologin xxx useradd–g mailusers–s/sbin/nologin yyy passwd xxxpasswd yyy测发送邮件telnet 192.168.0.100 25helo localhost //可省略mail from:xxx@rcpt to:yyy@datasubject:A test mailhello!. //邮件编辑结束quit //退出界面7、停止postfix stop8、验证邮件是否发送成功cd /home/llcd yyy/llcd Maildir/llcd new/llvi 邮件名。
Cent OS 5.5下postfix+extmail+mysql邮件服务器

Cent OS 5.5 下Postfix + extmail + mysql邮件系统安装与配置一.安装mysql数据库首先卸载系统自带的mysql# rpm -e mysql --nodeps# tar zxvf BAK/mysql-5.1.43.tar.gz# cd mysql-5.1.43/# ./configure --prefix=/usr/local/mysql --enable-thread-safe-client --enable-shared --enable-stati c --enable-local-infile --with-extra-charsets=all --with-pthread --with-unix-socket-path=/tmp/my sql.socket --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-big-tables --wit h-embedded-server --with-embedded-privilege-control --enable-assembler# make -j 4# make install# useradd mysql -s /sbin/nologin -d /dev/null# cp support-files/f /etc/f# vi /etc/f在[mysqld]添加: bind-address = localhost# cp support-files/mysql.server /etc/init.d/mysqld# chkconfig --add mysqld# chkconfig --level 2345 mysqld on# chmod 755 /etc/init.d/mysqld# chown -R mysql.mysql /usr/local/mysql/# /usr/local/mysql/bin/mysql_install_db --user=mysql# service mysqld start# /usr/local/mysql/bin/mysqladmin -u root password 'izptecmail'# mysql -uroot -p# echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf# ldconfig# ldconfig -v二.安装apache web服务(需要编译suexec)# tar zxvf BAK/httpd-2.2.14.tar.gz# cd httpd-2.2.14/# ./configure --prefix=/usr/local/apache --enable-modules=all --enable-mods-shared=all --enabl e-cache --enable-disk-cache --enable-mem-cache --enable-substitute --enable-expires --enable-headers --enable-proxy --enable-proxy-http --enable-ssl --with-ssl=/usr/local/ssl --enable-http --enable-vhost-alias --with-zlib --enable-suexec --with-suexec-caller=vmail --with-suexec-docroot =/var/www/html/ --enable-rewrite --enable-so --with-mpm=worker# mkdir -p /var/www/html/# groupadd -g 1000 vmail# useradd -g vmail -u 1000 -s /sbin/nologin -M vmail# make# make install# echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.local# vi /usr/local/apache/conf/httpd.conf修改apache配置文件;# /usr/local/apache/bin/apachectl start三.安装php首先安装php程序所需要的依赖包# yum install freetype* glib* jpegsrc* libart_lgpl* libpng* libxml* libjpeg* zlib* libmcrypt* gd*# tar zxvf BAK/php-5.2.6.tar.gz# cd php-5.2.6/# ./configure --prefix=/usr/local/php --enable-exif --with-gd --enable-gd-native-ttf --enable-gd-ji s-conv --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-mbstring --with-m ysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.socket --enable-embedded-mysqli --enabl e-shmop --enable-soap --enable-sockets --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvse m --enable-sysvshm --enable-wddx --enable-zip --with-pcre-dir --enable-maintainer-zts --enable-zend-multibyte --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php/et c/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-gettext --with-mcrypt# make# make install# cp php.ini-dist /usr/local/php/etc/php.ini# vi /usr/local/php/etc/php.ini---------------------------------------;include_path = ".:/php/includes" 改为include_path = ".:/usr/local/php/lib/php"---------------------------------------四.安装courier-authlib库(验证登陆)# tar jxvf BAK/courier-authlib-0.63.0.tar.bz2# cd courier-authlib-0.63.0/# CFLAGS="-march=i686 -O2 -fexpensive-optimizations" CXXFLAGS="-march=i686 -O2 -fexpe nsive-optimizations"# ./configure --prefix=/usr/local/courier-authlib --sysconfdir=/etc --without-authpam --without-a uthldap --without-authpwd --without-authshadow --without-authvchkpw --without-authpgsql --wi th-authmysql --with-mysql-libs=/usr/local/mysql/lib/mysql --with-mysql-includes=/usr/local/mys ql/include/mysql --with-redhat --with-authmysqlrc=/etc/authmysqlrc --with-authdaemonrc=/etc/ authdaemonrc# make# make install# chmod 755 /usr/local/courier-authlib/var/spool/authdaemon# cp /etc/authdaemonrc.dist /etc/authdaemonrc# vi /etc/authdaemonrc修改为以下配置:authmodulelist="authmysql"authmodulelistorig="authmysql"daemons=15authdaemonvar=/usr/local/courier-authlib/var/spool/authdaemonDEBUG_LOGIN=0DEFAULTOPTIONS=""LOGGEROPTS=""--------------------------------------------------------------# cp /etc/authmysqlrc.dist /etc/authmysqlrc# vi /etc/authmysqlrc修改为以下配置:MYSQL_SERVER localhostMYSQL_USERNAME rootMYSQL_PASSWORD izptecmailMYSQL_SOCKET /tmp/mysql.socketMYSQL_PORT 3306MYSQL_OPT 0MYSQL_DATABASE extmailMYSQL_USER_TABLE mailboxMYSQL_CRYPT_PWFIELD passwordMYSQL_UID_FIELD 1000MYSQL_GID_FIELD 1000MYSQL_LOGIN_FIELD usernameMYSQL_HOME_FIELD homedirMYSQL_NAME_FIELD nameMYSQL_MAILDIR_FIELD maildirMYSQL_QUOTA_FIELD quotaMYSQL_SELECT_CLAUSE SELECT username,password,"",uidnumber,gidnumber,\CONCAT('/home/domains/',homedir), \CONCAT('/home/domains/',maildir), \quota, \name \FROM mailbox \WHERE username = '$(local_part)@$(domain)'--------------------------------------------------------------# cp courier-authlib.sysvinit /etc/init.d/courier-authlib# chmod 755 /etc/init.d/courier-authlib# chkconfig --add courier-authlib# chkconfig --level 2345 courier-authlib on# pstree | grep authdaemond显示init-+-courierlogger---authdaemond---15*[authdaemond] 表示安装成功;五.安装courier-imap (提供pop3服务)# tar jxvf BAK/courier-imap-4.0.3.tar.bz2# cd courier-imap-4.0.3/# ./configure --prefix=/usr/local/courier-imap --with-redhat --enable-unicode --disable-root-chec k --with-trashquota --without-ipv6 CPPFLAGS='-I/usr/include/openssl -I/usr/local/courier-authlib/i nclude' LDFLAGS='-L/usr/local/courier-authlib/lib/courier-authlib' COURIERAUTHCONFIG='/usr/lo cal/courier-authlib/bin/courierauthconfig'# make# make install# cp /usr/local/courier-imap/etc/imapd.dist /usr/local/courier-imap/etc/imapd# cp /usr/local/courier-imap/etc/imapd-ssl.dist /usr/local/courier-imap/etc/imapd-ssl# cp /usr/local/courier-imap/etc/pop3d.dist /usr/local/courier-imap/etc/pop3d# cp /usr/local/courier-imap/etc/pop3d-ssl.dist /usr/local/courier-imap/etc/pop3d-ssl# vi /usr/local/courier-imap/etc/pop3d修改POP3DSTART字段,改为YES;如果需要提供imapd服务,编译/usr/local/courier-imap/etc/imoa pd的IMAPDSTART字段;# mkdir -p /home/domains/# chown -R vmail.vmail /home/domains/# chmod 755 /etc/init.d/courier-imapd# chkconfig --add courier-imapd# chkconfig --level 2345 courier-imapd on# netstat -tupln查看110端口是否开启,如开启则pop3服务正常;六.安装Cyrus-sasl (认证)# tar jxvf BAK/cyrus-sasl-2.1.22.tar.bz2# cd cyrus-sasl-2.1.22/# ./configure --prefix=/usr/local/sasl2 --disable-gssapi --disable-anon --disable-sample --disable-digest --enable-plain --enable-login --enable-sql --with-mysql=/usr/local/mysql --with-mysql-incl udes=/usr/local/mysql/include/mysql --with-mysql-libs=/usr/local/mysql/lib/mysql--with-authdae mond=/usr/local/courier-authlib/var/spool/authdaemon/socket# make# make install# chkconfig --level 2345 saslauthd off# cd /usr/lib******# mv libsasl2.a libsasl2.a.OFF# mv libsasl2.so.2.0.22 libsasl2.so.2.0.22.OFF# mv sasl2 sasl2.OFF# rm libsasl2.so libsasl2.so.2# ln -sv /usr/local/sasl2/lib/* .******进入/usr/lib64 同上修改sasl库链接关系;进入/usr/local/lib/库链接关系;同时链接头文件到/usr/loca/include;# ln -sv /usr/local/sasl2/include/sasl /usr/local/include/sasl# mkdir -pv /var/state/saslauthd# /usr/local/sasl2/sbin/saslauthd -a shadow pam -d输出:saslauthd[20634] :main : num_procs : 5saslauthd[20634] :main : mech_option: NULLsaslauthd[20634] :main : run_path : /var/state/saslauthdsaslauthd[20634] :main : auth_mech : shadowsaslauthd[20634] :ipc_init : using accept lock file: /var/state/saslauthd/mux.accept saslauthd[20634] :detach_tty : master pid is: 0saslauthd[20634] :ipc_init : listening on socket: /var/state/saslauthd/muxsaslauthd[20634] :main : using process modelsaslauthd[20635] :get_accept_lock : acquired accept locksaslauthd[20634] :have_baby : forked child: 20635saslauthd[20634] :have_baby : forked child: 20636saslauthd[20634] :have_baby : forked child: 20637saslauthd[20634] :have_baby : forked child: 20638表示正常,Ctrl+c 结束;# /usr/local/sasl2/sbin/saslauthd -a shadow pam# pstree | grep saslauthd显示|-saslauthd---4*[saslauthd],表示程序启动;# /usr/local/sasl2/sbin/testsaslauthd -u root -p (root 用户密码)显示0: OK "Success." 测试成功# echo “/usr/local/sasl2/lib” >> /etc/ld.so.conf# echo “/usr/local/sasl2/lib/sasl2” >> /etc/ld.so.conf# ldconfig -v# echo “/usr/local/sasl2/sbin/saslauthd -a shadow pam” >> /etc/rc.local# vi /usr/local/sasl2/lib/sasl2/smtpd.conf------------------------------------------------------------pwcheck_method: authdaemondlog_level: 3mech_list: PLAIN LOGINauthdaemond_path: /usr/local/courier-authlib/var/spool/authdaemon/socket------------------------------------------------------------# vi /etc/init.d/saslauthd------------------------------------------------------------修改为:SOCKETDIR=/var/state/saslauthdMECH="shadow pam"注释:#if test -x ${path}.${MECH} ; then# path=/usr/sbin/saslauthd.$MECH#fi------------------------------------------------------------# vi /etc/sysconfig/saslauthd------------------------------------------------------------SOCKETDIR=/var/state/saslauthdMECH="shadow pam"------------------------------------------------------------# chkconfig --level 2345 saslauthd on七.安装配置postfix# rpm -e sendmail --nodeps# tar zxvf BAK/postfix-2.6.5.tar.gz# cd postfix-2.6.5/# groupadd postdrop# useradd -M -s /sbin/nologin postfix# make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/local/sasl2/include/sasl -DUSE_TLS -I/usr/include/openssl' 'AUXLIBS=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm -L/usr/local/sasl2/lib -lsasl2 -L/usr/local/ssl/lib -lss l -lcrypto'# make# make install# /usr/bin/newaliases# vi /etc/postfix/main.cf------------------------------------------------------------#####################BASE#########################queue_directory = /var/spool/postfixcommand_directory = /usr/sbindaemon_directory = /usr/libexec/postfixdata_directory = /var/lib/postfixmail_owner = postfixunknown_local_recipient_reject_code = 550debug_peer_level = 2debugger_command =PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/binddd $daemon_directory/$process_name $process_id & sleep 5sendmail_path = /usr/sbin/sendmailnewaliases_path = /usr/bin/newaliasesmailq_path = /usr/bin/mailqsetgid_group = postdrophtml_directory = nomanpage_directory = /usr/local/mansample_directory = /etc/postfixreadme_directory = nomyhostname = mydomain = myorigin = $mydomaininet_interfaces = allmynetworks = 127.0.0.0/8------------------------------------------------------------测试postfix 发信功能# telnet localhost 25Trying 127.0.0.1...Connected to localhost.Escape character is '^]'.220 ESMTP Postfixhelo 250 mail from:root@250 2.1.0 Okrcpt to:hanyongming@250 2.1.5 Okdata354 End data with <CR><LF>.<CR><LF>from:root Test <root@>to:hanyongming@subject:Mail Test.Mail Test Date 2011-03-13..250 2.0.0 Ok: queued as DEF0D330054quit221 2.0.0 ByeConnection closed by foreign host.# /usr/sbin/postconf -a显示cyrusdovecot则表示postfix支持cyrus-sasl认证# vi /etc/postfix/main.cf------------------------------------------------------------添加以下内容:#####################CYRUS-SASL######################### broken_sasl_auth_clients = yessmtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destinationsmtpd_sasl_auth_enable = yessmtpd_sasl_authenticated_header = yessmtpd_sasl_local_domain = $myhostnamesmtpd_sasl_security_options = noanonymoussmtpd_sasl_path = smtpdsmtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available! --------------------------------------------------------------------# /usr/sbin/postfix reload验证认证是否生效# telnet localhost 25显示以下内容:Trying 127.0.0.1...Connected to localhost.Escape character is '^]'.220 Welcome to our ESMTP,Warning: Version not Available!ehlo 250-PIPELINING250-SIZE 10240000250-VRFY250-ETRN250-AUTH LOGIN PLAIN250-AUTH=LOGIN PLAIN250-ENHANCEDSTATUSCODES250-8BITMIME250 DSN^]telnet> qConnection closed.表示postfix验证生效;# vi /etc/postfix/main.cf---------------------------------------------------------------------添加虚拟域配置文件:#####################Virtual Mailbox Settings##################### virtual_mailbox_base = /home/doaminsvirtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cfvirtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf#virtual_alias_domains =virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cfvirtual_minimum_uid = 1000virtual_uid_maps = static:1000virtual_gid_maps = static:1000virtual_transport = maildropmaildrop_destination_recipient_limit = 1maildrop_destination_concurrency_limit = 1#####################QUOTA Settings######################## message_size_limit = 14336000virtual_mailbox_limit = 20971520virtual_create_maildirsize = yesvirtual_mailbox_extended = yesvirtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_limit_maps.cfvirtual_mailbox_limit_override = yesvirtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, pl ease Tidy your mailbox and try again later.virtual_overquota_bounce = yes----------------------------------------------------------------------八.安装extmail extman# tar zxvf BAK/extmail-1.2.tar.gz# cp -a extmail-1.2 /var/www/html/extmail# tar zxvf BAK/extman-1.1.tar.gz# cp -a extman-1.1 /var/www/html/extman# cd /var/www/html# cp extmail/webmail.cf.default extmail/webmail.cf# vi extmail/webmail.cf----------------------------------------------------------------------修改extmail的配置项:SYS_CONFIG = /var/www/html/extmail/SYS_LANGDIR = /var/www/html/extmail/langSYS_TEMPLDIR = /var/www/html/extmail/htmlSYS_USER_LANG = zh_CNSYS_MYSQL_USER = rootSYS_MYSQL_PASS = izptecmailSYS_MYSQL_DB = extmailSYS_MYSQL_HOST = localhostSYS_MYSQL_SOCKET = /tmp/mysql.socketSYS_AUTHLIB_SOCKET = /usr/local/courier-authlib/var/spool/authdaemon/socket SYS_G_ABOOK_FILE_PATH = /var/www/html/extmail/globabook.cf-----------------------------------------------------------------------# cp extman/webman.cf.default extman/webman.cf# vi extman/webman.cf-----------------------------------------------------------------------修改extman的配置项:SYS_CONFIG = /var/www/html/extman/SYS_LANGDIR = /var/www/html/extman/langSYS_TEMPLDIR = /var/www/html/extman/htmlSYS_MYSQL_USER = rootSYS_MYSQL_PASS = izptecmailSYS_MYSQL_DB = extmailSYS_MYSQL_HOST = localhostSYS_MYSQL_SOCKET = /tmp/mysql.socket安装数据库链接的perl模块:# tar zxvf BAK/Unix-Syslog-1.1.tar.gz# cd Unix-Syslog-1.1/# make# make install# tar zxvf BAK/DBI-1.604.tar.gz# cd DBI-1.604/# perl Makefile.PL# make# make install# tar zxvf BAK/DBD-mysql-4.006.tar.gz# cd DBD-mysql-4.006/# perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config# tar zxvf BAK/GD-2.45.tar.gz# cd GD-2.45/# perl Makefile.PL# make# make install# cd /var/www/html/extman/docs/# /usr/local/mysql/bin/mysql -uroot -p <extmail.sql# /usr/local/mysql/bin/mysql -uroot -p <init.sql# cp mysql_virtual_alias_maps.cf /etc/postfix/# cp mysql_virtual_domains_maps.cf /etc/postfix/# cp mysql_virtual_limit_maps.cf /etc/postfix/# cp mysql_virtual_mailbox_maps.cf /etc/postfix/修改虚拟域配置文件内链接mysql数据库的用户名,密码;# vi /usr/local/apache/conf/httpd.conf----------------------------------------------------------修改apache配置文件User vmailGroup vmail<Directory />Options FollowSymLinksAllowOverride NoneOrder deny,allowAllow from all</Directory><VirtualHost *:80>ServerName DocumentRoot /var/www/html/extmail/html/ScriptAlias /extmail/cgi/ /var/www/html/extmail/cgi/Alias /extmail /var/www/html/extmail/html/ScriptAlias /extman/cgi/ /var/www/html/extman/cgi/Alias /extman /var/www/html/extman/html/SuexecUserGroup vmail vmail</VirtualHost>----------------------------------------------------------# chown -R vmail.vmail /var/www/html# mkdir -pv /tmp/extman# chown -R vmail.vmail /tmp/extman/# /usr/local/apache/bin/apachectl stop# /usr/local/apache/bin/apachectl startweb方式访问登录邮箱管理登录名:root@ 密码:extmail*123*新建域,新建邮箱账户;九.安装maildrop邮件投递# tar zxvf BAK/pcre-8.10.tar.gz# cd pcre-8.10/# ./configure --enable-utf8 --enable-unicode-properties --enable-newline-is-any --enable-pcregr ep-libz --enable-pcregrep-libbz2# make# make install# tar jxvf BAK/maildrop-2.0.4.tar.bz2# cd maildrop-2.0.4/# ln -sv /usr/local/courier-authlib/bin/courierauthconfig /usr/bin# ln -sv /usr/local/courier-authlib/include/* /usr/include# ./configure --enable-sendmail=/usr/sbin/sendmail --enable-trusted-users='root vmail' --enabl e-syslog=1 --enable-maildirquota --enable-maildrop-uid=1000 --enable-maildrop-gid=1000 --wi th-trashquota --with-dirsync# make# make install# vi /etc/maildroprc---------------------------------------------------------添加以下内容:logfile "/var/log/maildrop.log"---------------------------------------------------------# touch /var/log/maildrop.log# chown -R vmail.vmail /var/log/maildrop.log# vi /etc/postfix/master.cf---------------------------------------------------------添加以下内容:maildrop unix - n n - - pipeflags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}---------------------------------------------------------# service courier-authlib restart# service courier-imapd restart# service saslauthd restart# /usr/sbin/postfix reload# /usr/local/apache/bin/apachectl restart建立邮箱收发邮件测试!。
邮件系统postfix安装与配置

系统postfix安装与配置(一)系统postfix安装与配置一、 postfix概述postfix是Wietse Venema在IBM的GPL协议之下开发的MTA(传输代理)软件。
下面一段话摘自postfix的官方站点():“postfix是Wietse Venema想要为使用最广泛的sendmail提供替代品的一个尝试。
在Internet 世界中,大部分的电子都是通过sendmail来投递的,大约有100万用户使用sendmail,每天投递上亿封。
这真实一个让人吃惊的数字。
Postfix试图更快、更容易管理、更安全,同时还与sendmail保持足够的兼容性。
”1.1 postfix的特点1. postfix是免费的:postfix想要作用的围是广大的Internet用户,试图影响大多数的Internet上的电子系统,因此它是免费的。
2. 更快:postfix在性能上大约比sendmail快三倍。
一部运行postfix的台式PC每天可以收发上百万封。
3. 兼容性好:postfix是sendmail兼容的,从而使sendmail用户可以很方便地迁移到postfix。
Postfix 支持/var[/spool]/mail、/etc/aliases、 NIS、和 ~/.forward 文件。
4. 更健壮:postfix被设计成在重负荷之下仍然可以正常工作。
当系统运行超出了可用的存或磁盘空间时,postfix会自动减少运行进程的数目。
当处理的数目增长时,postfix运行的进程不会跟着增加。
5. 更灵活:postfix是由超过一打的小程序组成的,每个程序完成特定的功能。
你可以通过配置文件设置每个程序的运行参数。
6. 安全性postfix具有多层防御结构,可以有效地抵御恶意入侵者。
如大多数的postfix程序可以运行在较低的权限之下,不可以通过网络访问安全性相关的本地投递程序等等。
1.2 postfix的总体结构postfix由十几个具有不同功能的半驻留进程组成,并且在这些进程中并无特定的进程间父子关系。
CENTOS5下配置mail服务器
CENTOS5下配置mail服务器[11月9日最后修正]2007-10-28 16:17CENTOS5,Fedora8下配置mail服务器在Fedora8下比CENTOS5下配置更顺利[QQ:48238398][抄来抄去,呵]说明:apache,php,mysql,为centos5自带的,就是说我装系统的时候,就选择上了:cyrus-sasl,postfix,courier-authlib,maildrop ,courier-imap 是通过源码编译的,写这个的目的就是,复制内容,照着一步步的做下去就能配置出来一个成功的可视化管理的mail服务器如果是rpm方式按装的msqyl,include及lib目录的位置/usr/include/mysql /usr/lib/mysql如果是编译的,位于你指定的目录下,如果编译mysql指定目录为/usr/local/mysql则位于/usr/local/mysql/include/mysql /usr/local/mysql/lib/mysql开始:::如果你的apache,php,mysqsl是centos5自带的,就是说不是你自己编译的,以下的代码可以复制粘贴直接用=cyrus-sasl=按装配置cyrus-sasl=cyrus-sasl=下载地址:ftp:///pub/cyrus-mail/=cryus-sasl=文件名:cyrus-sasl-2.1.22.tar.gz#rpm -qa|grep cyrus-sasl把查找出来的包都删除了#rpm -e --nodeps 包名#rm -rf /usr/lib/sasl#rm -rf /usr/lib/sasl2=cyrus-sasl=进入解压目录编译:#./configure \--enable-plain \--enable-cram \--enable-digest \--enable-login \--enable-sql \--disable-anon \--disable-ntlm \--disable-gssapi \--disable-krb4 \--disable-otp \--disable-srp \--disable-srp-setpass \-with-authdaemond=/usr/local/courier-authlib/var/spool/authdaemon/socket \--with-mysql#make#make install#ln -s /usr/local/lib/sasl2 /usr/lib/sasl2#vi /etc/ld.so.conf/usr/local/lib //增加该行# ldconfig# vi /usr/local/lib/sasl2/smtpd.conf加入以下四行pwcheck_method: authdaemondlog_level: 3mech_list: PLAIN LOGINauthdaemond_path:/usr/local/courier-authlib/var/spool/authdaemon/socket==postfix==按装配置postfix==postfix==下载地址:/download.html==postfix==文件名:postfix-2.4.6.tar.gz==postfix==进入解压目录编译:# yum install db*-devel*# make tidy# groupadd postfix -g 54321 //如果原来系统中有该用户则不需要再建# groupadd postdrop# useradd -s /bin/false -u 54321 -g postfix -G postdrop postfix==postfix==备注,我的mysql是rpm包装的,如果是你自己源码编译的,下边mysql路径会有变化#make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_CYRUS_SASL-DUSE_SASL_AUTH -I/usr/local/include/sasl' 'AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lm -lz -L/usr/local/lib -lsasl2'#make#make install#mv /etc/aliases /etc/aliases.old#ln -s /etc/postfix/aliases /etc/aliases#echo 'root: admin@'>>/etc/postfix/aliases#/usr/bin/newaliases#postconf -n > /etc/postfix/main2.cf#mv /etc/postfix/main.cf /etc/postfix/main.cf.old#mv /etc/postfix/main2.cf /etc/postfix/main.cf# vi /etc/postfix/main.cf==postfix==main.cf加入以下内容# hostnamemynetworks = 127.0.0.1myhostname = mydomain = myorigin = $mydomainmydestination = $mynetworks $myhostname# bannermail_name = Postfix - by smtpd_banner = $myhostname ESMTP $mail_name# response immediatelysmtpd_error_sleep_time = 0sunknown_local_recipient_reject_code = 450# extmail config herevirtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cfvirtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cfvirtual_transport = maildrop:==postfix==main.cf内容结束==postfix==以下几个文件可以通过cp /var/www/html/extsuite/extman/docs/mysql_*/etc/postfix/得到==postfix==编辑mysql_virtual_alias_maps.cfvi /etc/postfix/mysql_virtual_alias_maps.cf内容如下:user = extmailpassword = extmailhosts = localhostdbname = extmailtable = aliasselect_field = gotowhere_field = address==postfix==编辑mysql_virtual_domains_maps.cfvi /etc/postfix/mysql_virtual_domains_maps.cf内容如下:user = extmailpassword = extmailhosts = localhostdbname = extmailtable = domainselect_field = descriptionwhere_field = domain#additional_conditions = and backupmx ='0' and active ='1'==postfix==编辑mysql_virtual_mailbox_maps.cfvi /etc/postfix/mysql_virtual_mailbox_maps.cf内容如下:。
电子邮件服务器的安装与配置
电子邮件服务器的安装与配置概述电子邮件是现代办公和通信的重要组成部分之一。
为了实现高效的电子邮件通信,需要搭建一个稳定、安全和可靠的电子邮件服务器。
本文将介绍如何安装和配置电子邮件服务器,以便您能够快速搭建自己的电子邮件系统。
步骤1:选择邮件服务器软件在搭建电子邮件服务器之前,您需要选择适合您需求的邮件服务器软件。
下面列出了一些常见的邮件服务器软件供您参考: - Microsoft Exchange Server - Exim - Postfix - Sendmail在选择邮件服务器软件时,您需要考虑以下几个因素: - 系统要求:邮件服务器软件是否与您使用的操作系统兼容。
- 功能需求:考虑您需要的电子邮件功能,如群发、自动回复、用户管理等。
- 可靠性和安全性:选择具有稳定性和安全性的邮件服务器软件,以确保您的电子邮件系统不容易受到黑客攻击。
步骤2:安装邮件服务器软件根据您选择的邮件服务器软件的安装指南,按照指导进行安装。
具体步骤可以参考以下示例,以安装Postfix邮件服务器为例:步骤2.1:更新系统软件在开始安装邮件服务器之前,建议先更新您的操作系统软件,以确保拥有最新的补丁和安全更新。
您可以使用以下命令在Ubuntu操作系统上更新软件包:sudo apt updatesudo apt upgrade步骤2.2:安装Postfix使用以下命令来安装Postfix邮件服务器:sudo apt install postfix在安装过程中,您可能需要设置一些Postfix的配置选项。
根据您的需求进行设置,或者保持默认选项即可。
步骤2.3:配置Postfix安装完成后,您需要进行一些基本的配置来使Postfix正常工作。
以下是一些常见的配置选项: - 主机名:设置您的邮件服务器的主机名,确保其与您的域名一致。
- 域名:配置Postfix以接受和发送邮件的域名。
- 发送和接收限制:设置允许发送和接收邮件的IP地址范围或域名。
邮件服务器安装和配置
邮件服务器安装和配置概述邮件服务器是一种用于发送、接收和存储电子邮件的软件系统。
在企业和个人日常沟通中,邮件服务器发挥着重要的作用。
本文将介绍如何安装和配置邮件服务器。
步骤一:选择邮件服务器软件在安装和配置邮件服务器之前,需要选择合适的邮件服务器软件。
常见的邮件服务器软件有以下几种:1.Postfix:一个流行的开源邮件服务器软件,易于安装和配置,具有良好的安全性和性能。
2.Sendmail:一种经典的邮件传输代理(MTA),可靠且功能强大,但配置复杂。
3.Exim:一个易于配置的邮件服务器软件,支持多种邮件协议和扩展。
4.Microsoft Exchange Server:适用于Windows环境的商业邮件服务器软件,具有广泛的功能和集成性。
在选择邮件服务器软件时,需要考虑操作系统兼容性、安全性、功能需求和配置复杂性等因素。
步骤二:安装邮件服务器软件在选择了合适的邮件服务器软件后,接下来需要安装它。
以下是一般的安装步骤:1.下载邮件服务器软件的安装包。
可以从官方网站或开源软件社区下载最新版的安装包。
2.解压安装包并进入解压后的目录。
3.执行安装命令,根据提示完成安装过程。
安装命令可能因不同的软件而有所不同,一般需要使用管理员权限来执行。
4.检查安装是否成功。
可以使用命令行工具或图形界面来验证安装是否成功。
步骤三:配置邮件服务器在成功安装邮件服务器软件后,需要进行相应的配置,以确保其正常运行。
以下是一般的配置步骤:1.打开配置文件。
不同的邮件服务器软件使用不同的配置文件,一般位于安装目录下的/etc或conf子目录中。
2.根据需求修改配置文件。
配置文件包含了各种配置选项,例如网络设置、域名配置、认证方式、存储路径等。
根据具体需求进行修改。
3.保存并关闭配置文件。
在修改完配置文件后,保存并关闭文件。
4.重启邮件服务器。
根据具体的邮件服务器软件,执行相应的命令来重启邮件服务器。
5.检查邮件服务器的运行状态。
CenTOS 5下面用自带的RPM包安装基于Postfix的邮件系统(MySQL)
CenTOS 5下面用自带的RPM包安装基于Postfix的邮件系统(MySQL) (Postfix+Mysql+Dovecot+Extmail+Extman+Mailscanner+Spamassassin+Clamav) Author:汪洋Nickname:ruochen / ruochen0926Date:20070927Version:1.0Contact: E-Mail:ruochen0926(at) QQ:967409Blog:/Note:参考了网上很多网友的帖子,都比较零散,不一一列出,如果在安装或者使用过程中有疑问,请到我的blog跟帖,我会尽快回复目录:目标:配置一个功能齐全的Mail系统1)安装需要的软件包2)DNS相关配置2.1)建立正向反向和MX记录2.2)测试DNS配置3)安装Postfix4)配置Postfix4.1)配置Postfix的主配置文件 /etc/postfix/main.cf4.2)配置Postfix虚拟用户的配置文件5)配置dovecot (IMAP/IMAPS/POP3/POP3S)5.1)配置dovecot的主配置文件/etc/dovecot.conf5.2)配置dovecot的mysql认证配置文件6)测试发信认证及收信6.1)LOGIN登录测试6.2)pop3收信测试7)安装Extmail-1.0.27.1)解压安装7.2)修改Extmail主配置文件7.3)APACHE相关配置7.4)Extmail依赖关系的解决8)安装Extman-0.2.28.1)解压安装8.2)修改Extman的主配置文件8.3)APACHE相关配置9)开启Apache/Mysql/Bind,并让他们自启动10)安装反垃圾SpamAssassin11)安装反病毒Clamav12)安装MailScanner1)安装需要的软件包Mysql部分[root@mailtest /]# rpm -qa|grep mysql mysql-connector-odbc-3.51.12-2.2 mysql-devel-5.0.22-2.1mysql-server-5.0.22-2.1mod_auth_mysql-3.0.0-3.1php-mysql-5.1.6-15.el5mysql-5.0.22-2.1libdbi-dbd-mysql-0.8.1a-1.2.2Http部分[root@mailtest /]# rpm -qa|grep http httpd-2.2.3-6.el5.centos.1Php部分[root@mailtest /]# rpm -qa|grep phpphp-mysql-5.1.6-5.el5php-5.1.6-5.el5php-mbstring-5.1.6-5.el5php-common-5.1.6-5.el5php-cli-5.1.6-5.el5php-pdo-5.1.6-5.el5php-gd-5.1.6-5.el5Perl部分[root@mailtest noarch]# rpm -qa|grep perl perl-HTML-Tagset-3.10-2.1.1perl-Digest-HMAC-1.01-15perl-HTML-Parser-3.56-1perl-Sys-Hostname-Long-1.4-1perl-Net-DNS-0.59-1.fc6perl-XML-SAX-0.14-5perl-IO-stringy-2.108-1perl-DBI-1.56-1perl-5.8.8-10mod_perl-2.0.2-6.1perl-Socket6-0.19-3.fc6perl-IO-Socket-INET6-2.51-2.fc6perl-IO-String-1.08-1.1.1perl-Convert-ASN1-0.20-1.1perl-TimeDate-1.16-3perl-MIME-tools-5.420-1perl-DBD-SQLite-1.13-1perl-BSD-Resource-1.28-1.fc6.1perl-DBD-MySQL-3.0007-1.fc6perl-IO-Zlib-1.04-4.2.1perl-Digest-SHA1-2.11-1.2.1perl-Archive-Tar-1.30-1.fc6perl-IO-Socket-SSL-1.01-1.fc6perl-LDAP-0.33-3.fc6perl-libwww-perl-5.805-1.1.1perl-MailTools-1.71-1perl-Convert-TNEF-0.17-1perl-Filesys-Df-0.90-1perl-URI-1.35-3perl-Compress-Zlib-1.42-1.fc6perl-Net-IP-1.25-2.fc6perl-XML-NamespaceSupport-1.09-1.2.1perl-Net-CIDR-0.11-1perl-Archive-Zip-1.16-1perl-String-CRC32-1.4-2.fc6perl-Net-SSLeay-1.30-4.fc6perl-Convert-BinHex-1.119-2Spamassassin部分[root@mailtest /]# rpm -qa|grep spamassassin spamassassin-3.1.7-4.el5Dovecot部分[root@mailtest /]# rpm -qa|grep dovecot dovecot-1.0-1.2.rc15.el5 #imap imaps pop3 pop3s Cyrus-sasl部分[root@mailtest /]# rpm -qa|grep cyrus-saslcyrus-sasl-lib-2.1.22-4cyrus-sasl-plain-2.1.22-4cyrus-sasl-devel-2.1.22-4cyrus-sasl-2.1.22-4cyrus-sasl-md5-2.1.22-4cyrus-sasl-sql-2.1.22-4Spamassassin所依赖的包perl-Archive-Tar-1.30-1.fc6.noarch.rpmperl-IO-Socket-SSL-1.01-1.fc6.noarch.rpmperl-Compress-Zlib-1.42-1.fc6.i386.rpmperl-IO-Zlib-1.04-4.2.1.noarch.rpmperl-Digest-HMAC-1.01-15.noarch.rpm perl-Net-DNS-0.59-1.fc6.i386.rpmperl-Digest-SHA1-2.11-1.2.1.i386.rpmperl-Net-IP-1.25-2.fc6.noarch.rpmperl-HTML-Parser-3.55-1.fc6.i386.rpmperl-Net-SSLeay-1.30-4.fc6.i386.rpmperl-HTML-Tagset-3.10-2.1.1.noarch.rpmperl-Socket6-0.19-3.fc6.i386.rpmperl-IO-Socket-INET6-2.51-2.fc6.noarch.rpmPostfix所依赖的包db4-devel-4.3.29-9.fc6.i386.rpme2fsprogs-devel-1.39-8.el5.i386.rpmkrb5-devel-1.5-17.i386.rpmzlib-devel-1.2.3-3.i386.rpmopenssl-devel-0.9.8b-8.3.el5.i386.rpmmysql-devel-5.0.22-2.1.i386.rpmcyrus-sasl-devel-2.1.22-4.i386.rpmgcc所依赖的包libgomp-4.1.1-52.el5.i386.rpmgcc-4.1.1-52.el5.i386.rpm其他软件包perl-libwww-perl-5.805-1.1.1.noarch.rpmavahi-compat-howl-0.6.16-1.el5.i386.rpmopenldap-servers-sql-2.3.27-5.i386.rpmperl-LDAP-0.33-3.fc6.noarch.rpmkernel-devel-2.6.18-8.el5.i686.rpmelfutils-libelf-0.125-3.el5.i386.rpmelfutils-libelf-devel-0.125-3.el5.i386.rpmrpm-build-4.4.2-37.el5.i386.rpm建议安装与系统管理相关的两个包nmap-4.11-1.1.i386.rpmsysstat-7.0.0-3.el5.i386.rpm下面的两个软件包用于clamav的数字签名gmp-devel-4.1.4-10.el5gmp-4.1.4-10.el52)DNS相关配置2.1)建立正向反向和MX记录[root@mailtest ~]# cat /var/named/named.test.hk$TTL 86400@ IN SOA test.hk. test1.test.hk ( 1997022700 ; Serial28800 ; Refresh14400 ; Retry3600000 ; Expire86400 ) ; MinimumIN NS mailtesttest.hk. IN MX 5 mail.test.hk.mail IN A 10.10.119.204mailtest IN A 10.10.119.204[root@mailtest ~]# cat /var/named/named.10.10.119$TTL 86400@ IN SOA test.hk. test1.test.hk (1997022700 ; Serial28800 ; Refresh14400 ; Retry3600000 ; Expire86400 ) ; MinimumIN NS mailtest204 IN PTR mail.test.hk.204 IN PTR mailtest.test.hk.[root@mailtest ~]# hostnamemailtest.test.hk2.2)测试DNS配置[root@mailtest ~]# nslookup mail.test.hkServer: 10.10.119.204Address: 10.10.119.204#53Name: mail.test.hkAddress: 10.10.119.204[root@mailtest ~]# nslookup mailtest.test.hkServer: 10.10.119.204Address: 10.10.119.204#53Name: mailtest.test.hkAddress: 10.10.119.204[root@mailtest ~]# nslookup 10.10.119.204Server: 10.10.119.204Address: 10.10.119.204#53204.119.10.10.in-addr.arpa name = mail.test.hk.204.119.10.10.in-addr.arpa name = mailtest.test.hk.[root@mailtest ~]# ping mailtest.test.hkPING mailtest.test.hk (10.10.119.204) 56(84) bytes of data.64 bytes from mailtest.test.hk (10.10.119.204): icmp_seq=1 ttl=64 time=0.793 ms 64 bytes from mailtest.test.hk (10.10.119.204): icmp_seq=2 ttl=64 time=0.046 ms 64 bytes from mailtest.test.hk (10.10.119.204): icmp_seq=3 ttl=64 time=0.040 ms--- mailtest.test.hk ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 2002msrtt min/avg/max/mdev = 0.040/0.293/0.793/0.353 ms[root@mailtest ~]# ping mail.test.hkPING mail.test.hk (10.10.119.204) 56(84) bytes of data.64 bytes from mail.test.hk (10.10.119.204): icmp_seq=1 ttl=64 time=0.395 ms64 bytes from mail.test.hk (10.10.119.204): icmp_seq=2 ttl=64 time=0.037 ms64 bytes from mail.test.hk (10.10.119.204): icmp_seq=3 ttl=64 time=0.038 ms--- mail.test.hk ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 2001msrtt min/avg/max/mdev = 0.037/0.156/0.395/0.169 msNote:DNS的配置错误多看Bind的日志文件/var/log/messages3)安装Postfix虽然CentOS 5自带Postfix,但因为其不支持SSL及Mysql/LDAP,所以我们需要自行编译[root@mailtest /]# rpm -e sendmail --nodeps #卸载系统自带的sendmail[root@mailtest /]# groupadd postfix #添加postfix用户[root@mailtest /]# groupadd postdrop #添加postdrop组[root@mailtest /]# useradd postfix -g postfix -G postdrop -c "Postfix User" -d/dev/null -s /sbin/nologin #添加postfix用户[root@mailtest /]# mkdir -pv /tmp/postfix #建立postfix的临时目录[root@mailtest /]# chown -R postfix.postfix /tmp/postfix #给postfix的临时目录相关权限[root@mailtest /]# mkdir -pv /home/domains/ #建立虚拟邮件用户的邮件存放目录[root@mailtest /]# chown -R postfix.postfix /home/ #给虚拟邮件用户的邮件存放目录相关权限[root@mailtest /]# tar zxvf postfix-2.4.6.tar.gz #解压postfix包[root@mailtest /]# cd postfix-2.4.6 #进入postfix解压目录[root@mailtest postfix-2.4.5]# make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_TLS -DUSE_CYRUS_SASL -DUSE_SASL_AUTH -I/usr/include/sasl -DHAS_LDAP' 'AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lz -lm -L/usr/lib -lssl -lcrypto -lsasl2 -L/usr/lib/openldap -llber -lldap'#配置编译环境支持sasl/tls/mysql/ldap.相关编译参数参考readme文件#在64bit的机器上安装,要将参数里面的lib换成lib64[root@mailtest postfix-2.4.6]# make #编译postfix[root@mailtest postfix-2.4.6]# make install #安装postfix文件到相应目录并配置Note:make install命令后的所有问题都直接敲回车键即可。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
CentOS5.3安装postfix+extmail邮件系统系统所有环境都是采用yum安装改变系统语言关闭selinuxvi/etc/selinux/config去除IPV6修改网关vi/etc/sysconfig/network设IPvi/etc/sysconfig/network-scripts/ifcfg-eth0定义yum的非官方库关闭不需要的服务chkconfig mcstrans offchkconfig restorecond offchkconfig ip6tables offchkconfig iptables offchkconfig netfs off安装必需软件yum-y install ntsysv ntp telnet wget rsync vixie-cron logwatch perl-Unix-Syslog perl-Net-Daemon perl-PlRPC perl-DBI perl-DBD-MySQL freetype-demos freetype-devel libart_lgpl-devel libpng libpng-devel perl-Time-HiRes perl-Time-HiRes-Value perl-File-Tail perl-libwww-perl perl-HTML-Parser perl-HTML-Tagset perl-IO-stringy perl-IO-Multiplex perl-MailTools perl-TimeDate perl-Convert-ASN1perl-Convert-BinHex perl-MIME-tools perl-FCGI perl-GD rrdtool rrdtool-perl apr-devel apr-docs apr-util-devel apr-util-docs giflib libgdiplus mono-core dbus-sharp dbus-sharp-devel dbus-glib-devel dbh dbh-devel pcre pcre-devel httpd httpd-devel httpd-manual mysql mysql-devel mysql-server cyrus-sasl cyrus-sasl-plain bind bind-chroot amavisd-new clamd clamav clamav-db spamassassin bison bzip2-devel expect fam-devel flex freetype-devel gcc gcc-c++gdbm-devel libc-client-devel libjpeg-devel libmcrypt libmcrypt-devel libpng-devel libxslt-devel make rpm-build mod_ssl php php-gd php-mysql php-mbstring php-mcrypt phpmyadmin perl-Mon perl-Authen-PAM perl-Filter perl-Net_SSLeay.pm perl-Convert-BER perl-URI perl-XML-SAX perl-Crypt-Blowfish perl-Crypt-CBC perl-Date-Calc ncurses-devel net-snmp-devel libtool openssl openssl-devel openssl-perl pam-devel pkgconfig postgresql-devel zlib-devel启动mysql和apahcechkconfig httpd onchkconfig mysqld on升级包yum-y update重启系统reboot重新生成rpm包安装postfixcd/usr/local/srcwget /centos/5/os/SRPMS/postfix-2.3.3-2.src.rpmrpm-ivh postfix-2.3.3-2.src.rpmcd/usr/src/redhat/SPECSrpm-Uvh/usr/src/redhat/RPMS/i386/postfix-2.3.*新建邮件用户、组/usr/sbin/groupadd-g1000vgroup/usr/sbin/useradd-g1000-u1000-M-s/bin/false vuser安装courier-authlibcd/usr/local/srcwget /courier/courier-authlib-0.61.0.tar.bz2tar jxvf courier-authlib-0.61.0.tar.bz2ldconfigldconfig-vcp courier-authlib.sysvinit/etc/rc.d/init.d/courier-authlibchmod755/etc/rc.d/init.d/courier-authlibchkconfig--add courier-authlibchkconfig courier-authlib onchmod755/usr/local/courier-authlib/var/spool/authdaemonmv/usr/local/courier-authlib/etc/authlib/authmysqlrc/usr/local/courier-authlib/etc/authlib/authmysqlrc.bak设置smtpdservice courier-authlib startln-s/usr/local/courier-authlib/bin/courierauthconfig/usr/bin/courierauthconfig 安装maildorpcd/usr/local/srcwget /courier/maildrop-2.0.4.tar.bz2tar jvxf maildrop-2.0.4.tar.bz2安装courier-imapcd/usr/local/srcwget /courier/courier-imap-4.4.1.tar.bz2tar jvxf courier-imap-4.4.1.tar.bz2cp/usr/local/courier-imap/etc/imapd.dist/usr/local/courier-imap/etc/imapdcp/usr/local/courier-imap/etc/imapd-ssl.dist/usr/local/courier-imap/etc/imapd-ssl cp/usr/local/courier-imap/etc/pop3d.dist/usr/local/courier-imap/etc/pop3dcp/usr/local/courier-imap/etc/pop3d-ssl.dist/usr/local/courier-imap/etc/pop3d-ssl cp courier-imap.sysvinit/etc/rc.d/init.d/courier-imapdchmod755/etc/rc.d/init.d/courier-imapdchkconfig--add courier-imapd配置pop将extmail,extman,slock安装包上传安装extmailcd/usr/local/srcmkdir/var/www/extsuitetar-zxvf extmail-1.0.5.tar.gzcp-r extmail-1.0.5/var/www/extsuite/extmailcd/var/www/extsuite/extmailcp webmail.cf.default webmail.cfchown-R vuser:vgroup/var/www/extsuite/extmail/cgi/安装extmancd/usr/local/srctar-zxvf extman-0.2.5.tar.gzcp-r extman-0.2.5/var/www/extsuite/extman/chown-R vuser:vgroup/var/www/extsuite/extman/cgi/mkdir/var/www/extsuite/extman/tmpchown-R vuser:vgroup/var/www/extsuite/extman/tmpvi/var/www/extsuite/extman/docs/init.sql将改为你的域名比如导入数据库mysql-u root-p</var/www/extsuite/extman/docs/extmail.sqlmysql-u root-p</var/www/extsuite/extman/docs/init.sql生成extmail系统管理员的用户目录cd/var/www/extsuite/extman/tools./maildirmake.pl/home/domains//postmaster/Maildirchown-R vuser:vgroup/home/domainscp-r/var/www/extsuite/extman/addon/mailgraph_ext//usr/local/mailgraph_ext/ echo"/usr/local/mailgraph_ext/mailgraph-init start">>/etc/rc.d/rc.local echo"/usr/local/mailgraph_ext/qmonitor-init start">>/etc/rc.d/rc.local安装slockdcd/usr/local/srctar-zxvf slockd-0.2.tar.gzcp-r slockd-0.2/usr/local/slockdecho"/usr/local/slockd/slockd-init start">>/etc/rc.d/rc.local配置apache安装fastcgi模块cd/usr/local/srcwget /dist/mod_fastcgi-2.4.6.tar.gztar xfz mod_fastcgi-2.4.6.tar.gzcd mod_fastcgi-2.4.6ln-s../../usr/lib/httpd/build/etc/httpd/buildcp Makefile.AP2Makefilemake top_dir=/etc/httpd installecho"/var/www/extsuite/extmail/dispatch-init start">>/etc/rc.d/rc.local/var/www/extsuite/extmail/dispatch-init start配置phpmyadminln-s/usr/share/phpmyadmin/var/www/extsuite/phpmyadmin注:初始安装账户extmail,extman密码可能有点问题登陆不进去,这个可以用phpmyadmin来设置密码,默认phpmyadmin root密码为空$1$ITIH4eKD$s9C2wHpLQXOLkzY5U1jYL.=extmail而后再从extman后台去修改密码就可以了。