首页 > 系统相关 >阿里云 Ubuntu 22.04.4 LTS 安装postfix+dovecot 搭建邮件服务器

阿里云 Ubuntu 22.04.4 LTS 安装postfix+dovecot 搭建邮件服务器

时间:2024-06-15 15:29:54浏览次数:29  
标签:LTS tls ssl postfix auth etc 22.04 smtpd dovecot

一 安装

1安装postfix

sudo apt-get install postfix
#如果没有弹出配置界面,运行
dpkg-reconfigure postfix

 

 

 

 

 

#sudo vim  /etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 3.6
# TLS parameters
#smtp服务端的TLS配置
smtpd_use_tls = yes
smtpd_tls_cert_file=/etc/ssl/zld/fullchain.pem
smtpd_tls_key_file=/etc/ssl/zld/privkey.pem
smtpd_tls_security_level=encrypt
smtpd_tls_loglevel = 1
#smtp客户端的TLS配置
smtp_use_tls = yes
#smtp_tls_CApath=/etc/ssl/certs
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_security_level=encrypt
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_loglevel = 1

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.test.com
mydomain = test.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = iZbp1g7fmjea77vsqc5hmmZ, test.com, iZbp1g7fmjea77vsqc5hmmZ, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
#dovecot smtp认证
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =$myhostname
smtpd_sasl_authenticated_header = yes
#检测用户认证是否通过
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination,reject
#sudo vim  /etc/postfix/master.cf
smtps     inet  n       -       n       -       -       smtpd
#  -o syslog_name=postfix/smtps
   -o smtpd_tls_wrappermode=yes

 2 安装dovecot

#安装dovecot
sudo apt-get install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd
sudo vim  /etc/dovecot/dovecot.conf
#listen = *, :: --> listen = *
sudo vim  /etc/dovecot/conf.d/10-auth.conf
#disable_plaintext_auth = yes --> disable_plaintext_auth = no
auth_mechanisms = plain  -->  auth_mechanisms = plain login
#邮箱数据目录
sudo vim  /etc/dovecot/conf.d/10-mail.conf
mail_location = mbox:~/mail:INBOX=/var/mail/%u --> mail_location = maildir:~/Maildir
#配置stmp 校验
sudo vim  /etc/dovecot/conf.d/10-master.conf
# Postfix smtp-auth 下面修改
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
    user = postfix
    group = postfix
  }
#配置证书
sudo vim  /etc/dovecot/conf.d/10-ssl.conf
ssl = yes --> ssl = required
ssl_cert = </etc/dovecot/private/dovecot.pem --> 改成实际ssl证书
ssl_key = </etc/dovecot/private/dovecot.key  --> 改成实际ssl证书

3 客户端测试

#foxmail收取邮件报错
Jun 13 11:13:38 iZbp1g7fmjea77vsqc5hmmZ dovecot: pop3-login: Disconnected: Connection closed: SSL_accept() failed: error:0A000076:SSL routines::no suitable signature algorithm (no auth atte
mpts in 0 secs): user=<>, rip=61.174.145.130, lip=172.16.195.13, TLS handshaking: SSL_accept() failed: error:0A000076:SSL routines::no suitable signature algorithm, session=<A8ab4rwaofI9rpGC>(END)
#解决,foxmail升级最新版本 即可

 

标签:LTS,tls,ssl,postfix,auth,etc,22.04,smtpd,dovecot
From: https://blog.csdn.net/tonyhi6/article/details/139632001

相关文章

  • ubuntu22.04编译openwrt的lede-17.01一些错误的处理方式
    m4c-stack.c:55:26:error:missingbinaryoperatorbeforetoken“(“55|#elifHAVE_LIBSIGSEGV&&解决方法:wgethttps://raw.githubusercontent.com/keyfour/openwrt/2722d51c5cf6a296b8ecf7ae09e46690403a6c3d/tools/m4/patches/011-fix-sigstksz.patch-O......
  • OpenEuler22.03安装openGauss5.0.2LTS版本
    OpenEuler22.03安装openGauss5.0.2LTS版本文章目录OpenEuler22.03安装openGauss5.0.2LTS版本一、安装规划二、安装准备2.1修改主机名2.2安装依赖2.3同步时间2.4关闭防火墙2.5关闭selinux2.6关闭透明大页2.7重启机器2.8设置网卡MTU2.9设置字符......
  • 快速上手 GreatSQL 8.0.32-25 with openEuler 24.03 LTS
    5月底,openEuler24.03LTS发布,详情戳:恭喜!openEuler24.03LTS版本发布:首个AI原生开源操作系统在诸多亮点特性中,有一条值得注意:集成GreatSQL数据库,适用于金融级应用场景,具有高可用、高性能、高兼容、高安全等特性。那么,本文就来介绍一下如何安装openEuler24.0......
  • zabbix(ubuntu22.04)
    zabbix是一款监控软件,可监控各种网络参数,同时支持灵活的告警机制。常用术语主机(Host):需要监控的网络设备,可用IP或域名表示主机群组(Hostgroup):为了方面批量管理大量Host,我们会通过主机群组的方式设置一些通用的权限设置监控项(Item):一个特定监控指标的相关数据,这些数据来......
  • 在ubuntu22.04下安装cursor
    在ubuntu22.04下安装cursor安装Cursor编程软件1.访问Cursor网站下载Linux版本的AppImage文件2.如果出现“dlopen():errorloadinglibfuse.so.2”错误,需要安装fuse。3.将Cursor添加到应用程序列表4.保存.desktop文件,Cursor就会出现在应用程序列表中。5.如果出现点击curs......
  • Ubuntu 22.04扩容LVM空间
    今天为了编译ThingsBoard的源代码,发现原来给虚拟机分配的40个G不够用了。于是乎在VMWareWorkstation中扩容了40G的磁盘空间。但是此时lvm是不会自动扩容的,因此我们需要手动调整下卷的配置。首先df-h检查发现挂载的空间的确没有变化mrchip@ubuntu22:~$df-hFilesystem......
  • ubuntu22.04搭建tftp服务
    通常情况下我们调试linux内核的时候是在我们的ubuntu主机上进行的,这里同样以ubuntu为例,沃恩调试好内核之后,需要将我们调试好的内核下载到我们的开发板上跑起来,通常情况下是我们的板子先启动uboot,然后uboot通过网络服务命令将我们主机上编译好的内核下载到我们的开发板山的DRAM......
  • rockylinux8编译安装zabbix6.0.30-LTS
    zabbix6.和mysql安装系统环境:rockylinux8.10zabbix版本:zabbix-6.0.30LTS版本php版本:php7.2nginx版本:1.26mysql版本:mysql8#下载软件包wgethttps://cdn.zabbix.com/zabbix/sources/stable/6.0/zabbix-6.0.30.tar.gztarxvfzabbix-6.0.30.tar.gzln-s/tools/zabbix-6.0......
  • Ubuntu 24.04 LTS 安装配置 MySQL Community Server 8.4.0 LTS
    1安装 AptRepository​​​​​​​地址MySQL::DownloadMySQLAPTRepositorysudodpkg-imysql-apt-config_0.8.30-1_all.deb #安装mysql8.4ltssudoaptupdatesudoapt-getinstallmysql-server#修改mysqlroot密码策略 2查看版本test@test:~$my......
  • openEuler 24.03 LTS - 华为欧拉开源版(华为 RHEL 兼容发行版)
    openEuler24.03LTS-华为欧拉开源版(华为RHEL兼容发行版)华为红帽企业Linux兼容发行版请访问原文链接:https://sysin.org/blog/openeuler/,查看最新版。原创作品,转载请保留出处。作者主页:sysin.orgopenEuler通过开放的社区形式与全球开发者共同构建一个开放、多元和架构......