CENTOS7架设邮件服务器(实测1000以上用户)postfix+dovecot+cyrus-sasl+openwebmail-程序员宅基地

一、安装环境:
CentOS Linux release 7.7.1908 (Core),关闭防火墙,有独立的内部DNS服务器。
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
二、安装postfix:
yum -y install postfix

postfix配置如下(/etc/postfix/main.cf):

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mail.xxx.xxx #修改邮件主机
mydomain = xxx.xxx #修改域名
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = m y h o s t n a m e , l o c a l h o s t . myhostname, localhost. myhostname,localhost.mydomain, localhost, $mydomain # $mydomain必须要引用,没有引用会出现已域名为结尾的邮件无法接收。
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8, 10.36.0.0/16
relay_domains = $mydestination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mail_spool_directory = /var/spool/mail #openwebmail 无法支持 Maildir/
smtpd_banner = $myhostname ESMTP
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
#smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd d a e m o n d i r e c t o r y / daemon_directory/ daemondirectory/process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.10.1/samples
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
message_size_limit = 100000000
mailbox_size_limit = 1000000000

systemctl enable postfix

systemctl start postfix
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
三、安装dovecot

yum -y install dovecot

vi /etc/dovecot/dovecot.conf
protocols = imap pop3
listen = *

vi /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no
auth_mechanisms = plain login

vi /etc/dovecot/conf.d/10-mail.conf
first_valid_uid = 501 # uid 501开始的都能登录。默认是1000导致部分邮件账号无法登录
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u #openwebmail支持Mbox

vi /etc/dovecot/conf.d/10-master.conf
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}

vi /etc/dovecot/conf.d/10-ssl.conf
ssl = no

systemctl start dovecot

systemctl enable dovecot

验证:
[root@adm ~]# telnet localhost 110
Trying ::1…
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
+OK Dovecot ready.
user 账号
+OK
pass 密码
+OK Logged in.
quit
+OK Logging out.
Connection closed by foreign host.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
四、cyrus-sasl配置

yum install cyrus-sasl-*

[root@adm ~]# vi /etc/sysconfig/saslauthd
MECH=shadow

vi /etc/sasl2/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login
log_level: 3

验证:
[root@adm ~]# testsaslauthd -u 账号 -p ‘密码
0: OK “Success.”
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
五、openwebmail
第一步:
到http://www.openwebmail.org/openwebmail/download/处下载如下文件包:
openwebmail-2.53.tar.gz
1 CGI.pm-3.05.tar.gz
2 Text-Iconv-1.2.tar.gz
3 Digest-1.08.tar.gz
4 libiconv-1.9.1.tar.gz (非必须)
5 libnet-1.19.tar.gz
6 Digest-MD5-2.33.tar.gz
7 MIME-Base64-3.01.tar.gz

第二步:
分别对于他们进行编译安装:

[root@linux CGI.pm-3.05]# perl Makefile.PL
Checking if your kit is complete…
Looks good
Writing Makefile for CGI

[root@linux CGI.pm-3.05]# make; make install
Writing /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/CGI/.packlist
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod

[root@linux openwebmail]# tar zvxf libnet-1.19.tar.gz
[root@linux openwebmail]# cd libnet-1.19
[root@linux libnet-1.19]# perl Makefile.PL
Checking for Socket…ok
Checking for IO::Socket…ok
Checking if your kit is complete…
Looks good
Ah, I see you already have installed libnet before.
Do you want to modify/update your configuration (y|n) ? [no] no
这里提示要不要对原有网络配置进行更新修改,我们选择no
This script will prompt you to enter hostnames that can be used as
defaults for some of the modules in the libnet distribution.
To ensure that you do not enter an invalid hostname, I can perform a
lookup on each hostname you enter. If your internet connection is via
a dialup line then you may not want me to perform these lookups, as
it will require you to be on-line.
Do you want me to perform hostname lookups (y|n) ? [yes]
The following questions all require a list of host names, separated
with spaces. If you do not have a host available for any of the
services, then enter a single space, followed by . To accept the
default, hit
Enter a list of available NNTP hosts : []
Enter a list of available SMTP hosts : []
Enter a list of available POP3 hosts : []
Enter a list of available SNPP hosts : []
Enter a list of available PH Hosts : []
Enter a list of available TIME Hosts : []
Enter a list of available DAYTIME Hosts : []
Do you have a firewall/ftp proxy between your machine and the internet
If you use a SOCKS firewall answer no
(y|n) ? [no]
Normally when FTP needs a data connection the client tells the server
a port to connect to, and the server initiates a connection to the client.
Some setups, in particular firewall setups, can/do not work using this
protocol. In these situations the client must make the connection to the
server, this is called a passive transfer.
Should all FTP connections be passive (y|n) ? [yes]
What is your local internet domain name : []
If you specified some default hosts above, it is possible for me to
do some basic tests when you run make test' This will causemake test’ to be quite a bit slower and, if your
internet connection is via dialup, will require you to be on-line
unless the hosts are local.
Do you want me to run these tests (y|n) ? [yes]
To allow Net::FTP to be tested I will need a hostname. This host
should allow anonymous access and have a /pub directory
What host can I use : []
Writing libnet.cfg
Writing Makefile for Net
make install:同样提示(目前看来是perl编译器有些问题,但不知道会不会对他有影响)
Writing /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/Net/.packlist
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
同上安装Digest-MD5-2.33正常
同上安装MIME-Base64-3.01正常
同上安装Text-Iconv-1.2正常
同上安装Digest-1.08正常

第三步:Install a Repostory File for CentOS 7
cd /etc/yum.repo.d
wget ftp://openwebmail.org/pub/openwebmail/el7/openwebmail-el7.repo
yum install openwebmail
yum install gcc perl-CGI
/usr/local/bin/openwebmail-tool --init

The version of Perl on your system (5.016003) does not support set user id.
Attempting to wrap the openwebmail perl files in a C wrapper to enable set
user id capability…
Found C compiler /usr/bin/cc
wrapping file: openwebmail-abook.pl…done
wrapping file: openwebmail-advsearch.pl…done
wrapping file: openwebmail-cal.pl…done
wrapping file: openwebmail-folder.pl…done
wrapping file: openwebmail-main.pl…done
wrapping file: openwebmail-prefs.pl…done
wrapping file: openwebmail-read.pl…done
wrapping file: openwebmail-saprefs.pl…done
wrapping file: openwebmail-send.pl…done
wrapping file: openwebmail-spell.pl…done
wrapping file: openwebmail-tool.pl…done
wrapping file: openwebmail-vdomain.pl…done
wrapping file: openwebmail-viewatt.pl…done
wrapping file: openwebmail-webdisk.pl…done
wrapping file: openwebmail.pl…done

creating db /var/www/cgi-bin/openwebmail/etc/maps/b2g …done.
creating db /var/www/cgi-bin/openwebmail/etc/maps/g2b …done.
creating db /var/www/cgi-bin/openwebmail/etc/maps/lunar …done.

Creating UTF-8 locales…
langconv ar_AE.CP1256 -> ar_AE.UTF-8
langconv ar_AE.ISO8859-6 -> ar_AE.UTF-8
langconv bg_BG.CP1251 -> bg_BG.UTF-8
langconv ca_ES.ISO8859-1 -> ca_ES.UTF-8
langconv cs_CZ.ISO8859-2 -> cs_CZ.UTF-8
langconv da_DK.ISO8859-1 -> da_DK.UTF-8
langconv de_DE.ISO8859-1 -> de_DE.UTF-8
langconv el_GR.ISO8859-7 -> el_GR.UTF-8
langconv en_US.ISO8859-1 -> en_US.UTF-8
langconv es_AR.ISO8859-1 -> es_AR.UTF-8
langconv fi_FI.ISO8859-1 -> fi_FI.UTF-8
langconv fr_FR.ISO8859-1 -> fr_FR.UTF-8
langconv he_IL.CP1255 -> he_IL.UTF-8
langconv hr_HR.ISO8859-2 -> hr_HR.UTF-8
langconv hu_HU.ISO8859-2 -> hu_HU.UTF-8
langconv id_ID.ISO8859-1 -> id_ID.UTF-8
langconv it_IT.ISO8859-1 -> it_IT.UTF-8
langconv ko_KR.eucKR -> ko_KR.UTF-8
langconv lt_LT.CP1257 -> lt_LT.UTF-8
langconv nl_NL.ISO8859-1 -> nl_NL.UTF-8
langconv no_NO.ISO8859-1 -> no_NO.UTF-8
langconv pl_PL.ISO8859-2 -> pl_PL.UTF-8
langconv pt_BR.ISO8859-1 -> pt_BR.UTF-8
langconv pt_PT.ISO8859-1 -> pt_PT.UTF-8
langconv ro_RO.ISO8859-2 -> ro_RO.UTF-8
langconv ru_RU.KOI8-R -> ru_RU.UTF-8
langconv sk_SK.ISO8859-2 -> sk_SK.UTF-8
langconv sl_SI.CP1250 -> sl_SI.UTF-8
langconv sr_CS.ISO8859-2 -> sr_CS.UTF-8
langconv sv_SE.ISO8859-1 -> sv_SE.UTF-8
langconv th_TH.TIS-620 -> th_TH.UTF-8
langconv tr_TR.ISO8859-9 -> tr_TR.UTF-8
langconv uk_UA.KOI8-U -> uk_UA.UTF-8
…done.

Welcome to the OpenWebMail!
This program is going to send a short message back to the developer,
so we could have the idea that who is installing and how many sites are
using this software, the content to be sent is:
OS: Linux 3.10.0-123.el7.x86_64 x86_64
Perl: 5.016003
WebMail: OpenWebMail 2.54 20141206

总结:安装过程中会出现各种各样的异常,参考了很多分享出来的过程,环境不尽相同问题得不到解决,复制命令的时候回出现字符格式不同导致命令出错,分享出来与各位共勉。感谢分享,重要参考链接如下,再次表示感谢。

参考链接:
postfix+dovecot+cyrus-sasl:
https://blog.csdn.net/zuo187qiang/article/details/78201118
openwebmail:
https://blog.csdn.net/weixin_34109408/article/details/93563074 (openwebmail 无法支持 Maildir/,postfix和dovecot格式统一修改)
http://www.openwebmail.org/openwebmail/download/centos/el7/
https://www.cnblogs.com/wwufengg/articles/centos-openwebmail-postfix-perl.html

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/lzx1823/article/details/103876877

智能推荐

Android的广播的两种注册方式_android注册广播-程序员宅基地

整体概述广播是在程序之间的,一般会由系统发起:比如电量不足消息到达后,BroadCastReceiver调用onReceive方法来实现广播的事件两种方法来发送广播context.sendBroadcast(intent)通常会伴随数据的传递intent.putExtra()context.sendOrderBroadCast(intent)这个在intent-filter中设置优先级android:priority两种注册方式静态注册在Androidmanifest.xml中注册_android注册广播

简单算法 设计LRU缓存结构(java)_完整java 设计lru缓存结构get\set_搞不懂语言的程序员的博客-程序员宅基地

简单算法 设计LRU缓存结构(java)描述设计LRU缓存结构,该结构在构造时确定大小,假设大小为K,并有如下两个功能set(key, value):将记录(key, value)插入该结构get(key):返回key对应的value值[要求]set和get方法的时间复杂度为O(1)某个key的set或get操作一旦发生,认为这个key的记录成了最常使用的。当缓存的大小超过K时,移除最不经常使用的记录,即set或get最久远的。若opt=1,接下来两个整数x, y,表示set(x, y)_完整java 设计lru缓存结构get\set

linux基础(练习二)_在/home/stooges目录中更改组权限,使其属于stooges组-程序员宅基地

上节练习linux基础(一) 一、用文件系统权限控制文件访问二、归档与复制三、访问文件系统利一、用文件系统权限控制文件访问切换到root用户创建/home/stooges目录,并更改组权限,以使其属于stooges组对/home/stooges目录设置权限,使GID位目录(2)、所有者(7)和组(7)具有完全的读取和写入执行权限,而其他用户对该用户没有权限。修改全局登陆脚本,使..._在/home/stooges目录中更改组权限,使其属于stooges组

(微信公众号)验证消息的确来自微信服务器_返回验证消息给微信服务器是请求公众号哪个地址-程序员宅基地

https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp14211353191. 开发者提交信息后,微信服务器将发送GET请求到填写的服务器地址URL上,GET请求携带参数如下表所示:参数 描述 signature 微信加密签名,signature结合了开发者填写的token参数和请求中的timest..._返回验证消息给微信服务器是请求公众号哪个地址

多线程程序中操作的原子性[转载]-程序员宅基地

0. 背景原子操作就是不可再分的操作。在多线程程序中原子操作是一个非常重要的概念,它常常用来实现一些同步机制,同时也是一些常见的多线程Bug的源头。本文主要讨论了三个问题:1. 多线程程序中对变量的读写操作是否是原子的?2. 多线程程序中对Bit field(位域)的读写操作是否是线程安全的?3. 程序员该如何使用原子操作?1. 多线程环境下对变量的读写操作是否是原子的?我们先从一道..._it would run faster quadword aligned

功能安全专题之功能安全概念阶段_功能安全概念阶段最后输出物-程序员宅基地

**“当我们展望未来新技术的挑战时,采用统一的开发和应用标准至关重要。”** --- 通用汽车副总裁 Ken Kelzer, 2018。在诸多的标准与规范中,ISO 26262(汽车功能安全标准),继承自 IEC 61508(通用电子电气功能安全标准),定义了针对汽车工业的安全(Safety)相关组件的国际标准。_功能安全概念阶段最后输出物

随便推点

Java基础学习总结:网络编程之(四)TCP与UDP的区别及常见的网络协议(转)_socketjava tcp和udp区别-程序员宅基地

TCP和UDP的区别原文:https://blog.csdn.net/li_ning_/article/details/521174631、TCP与UDP基本区别基于连接与无连接 TCP要求系统资源较多,UDP较少; UDP程序结构较简单 流模式(TCP)与数据报模式(UDP); TCP保证数据正确性,UDP可能丢包 TCP保证数据顺序,U..._socketjava tcp和udp区别

Apache PHP 等服务器时间时区修改-程序员宅基地

今天在研究Moodle的时候, 突然发现系统中记录的时间和实际时间有出入.所以就深入了解了一下, 发现Apache(PHP)的服务器时间时区默认为UTC(Coordinated UniversalTime 世界统一时间).既然问题发现了就修改一下吧.(如图)1. 找到 php.ini 如果是集成整合的PHP运行环境就修改整合环境下的Apache/bin文件夹中的 php

python version 3.4 required_解决Win10安装PyWin32问题Python Version 3.4 required which was not found in the...-程序员宅基地

程序找不到注册表项Windows Registry Editor Version 5.00[HKEY_CURRENT_USER\SOFTWARE\Python][HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore][HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.4][HKEY_CURRENT_USER\SOFTW...

5G时代,给商业带来哪些机会和革新呢?_5g会带来哪些商业机会-程序员宅基地

摘要:前面我们说到5G时代对生活带来的改变,本篇将重点介绍5G对商务产生的改变。5G作为在各个产业出现数字转换的基础而备受期待。到2026年,在主要的10个产业中,5G所带来的数字转换的市场规模将达到1.3万亿美元。从各产业的构成比来看,能源产业/公用事业(水,电,燃气等)占19%,制造业占18%,公共安全产业(保洁/治安等)占13%,健康养老产业占12%,公共交通产业占10%,媒体/娱乐产业占9%,汽车产业占8%,金融服务业占6%,零售业占4%,农业占1%。4G以前的移动通信系统通过移动电话(功能机)及智_5g会带来哪些商业机会

Android终端系统APP应用性能测试之响应速度&流畅度-程序员宅基地

Android性能测试的基础,给大家介绍下测试思路!响应速度:是指终端中的APP/应用的启动时间(包含冷启动和热启动,补充概念:”冷启动”:是指APP/应用第一次开启;”热启动”:是指APP/应用第二次以后开启;);这里的启动方式有两种:1.人工手动点击打开;2.通过命令启动该应用;(这两者启动肯定是有误差的,实际上在手机面向客户,所以经常采用人工启动应用开始计时)测试方法..._终端系统app

字体粗细与fontWeight的对应关系_bold font weight对照-程序员宅基地

usWeight/bWeight100 2渺 極細Airline100 2絲   Ultralight100 2纖200 3線200 3輕 纖細 Thin300 4細 細體 Light350-  準細 Demilight350-  半細 Semilight--- -書 標準Book/Text400 5標 常規 Regula..._bold font weight对照