如何在Ubuntu 20.04 LTS上安装Postfix
admin
2023-07-31 21:14:00
0

postfix-mail-logopostfix-mail-logo在Ubuntu 20.04 LTS Focal Fossa上安装Postfix

步骤1.首先,通过apt在终端中运行以下命令来确保所有系统软件包都是最新的。

sudo apt update
sudo apt upgrade

步骤2.在Ubuntu 20.04上安装Postfix。

现在,我们通过运行以下命令继续安装Postfix:

sudo apt install postfix sasl2-bin

现在,将提示您选择邮件服务器配置的类型。选择继续,从该列表中选择[无配置],然后按Enter键,如下图突出显示:

+------+ Postfix Configuration +-------+
| General type of mail configuration:  |
|                                      |
|       No configuration               |
|       Internet Site                  |
|       Internet with smarthost        |
|       Satellite system               |
|       Local only                     |
|                                      |
|                                      |
|                          |
|                                      |
+--------------------------------------+

步骤3.配置Postfix。

成功安装后,现在我们编辑Postfix配置文件:

cp /usr/share/postfix/main.cf.dist /etc/postfix/main.cf
nano /etc/postfix/main.cf

添加以下行:

Add the following lines:

# line 78: uncomment

mail_owner = postfix

# line 94: uncomment and specify hostname

myhostname = mail.yundongfang.com

# line 102: uncomment and specify the domain name

mydomain = yundongfang.com

# line 123: uncomment

myorigin = $mydomain

# line 137: uncomment

inet_interfaces = all

# line 185: uncomment

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

# line 228: uncomment

local_recipient_maps = unix:passwd.byname $alias_maps

# line 270: uncomment

mynetworks_style = subnet

# line 287: add your local network

mynetworks = 127.0.0.0/8,10.0.0.0/24

# line 407: uncomment

alias_maps = hash:/etc/aliases

# line 418: uncomment

alias_database = hash:/etc/aliases

# line 440: uncomment

home_mailbox = Maildir/

# line 576: comment out and add
# smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_banner = $myhostname ESMTP

# line 650: add

sendmail_path = /usr/sbin/postfix

# line 655: add

newaliases_path = /usr/bin/newaliases

# line 660: add

mailq_path = /usr/bin/mailq

# line 666: add

setgid_group = postdrop

# line 670: comment out
#html_directory =

# line 674: comment out
#manpage_directory =

# line 679: comment out
#sample_directory =

# line 683: comment out
#

readme_directory =

# line 684: if also listen IPv6, change to [all]

inet_protocols = ipv4

# add to the end

# for example, limit an email size to 10Mmessage_size_limit = 10485760# for example, limit mailbox size to 1Gmailbox_size_limit = 1073741824# SMTP-Auth settings
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject

保存文件并关闭它。要应用更改,请输入命令:

newaliases
sudo systemctl restart postfix

恭喜你!您已经成功安装了Postfix。感谢您使用本教程在Ubuntu 20.04 LTS Focal Fossa系统上安装Postfix。如需其他帮助或有用信息,建议您访问Postfix官方网站。

相关内容

热门资讯

Windows 11 和 10... Windows 11/10 文件夹属性中缺少共享选项卡 – 已修复 1.检查共享选项卡是否可用 右键...
事件 ID 7034:如何通过... 点击进入:ChatGPT工具插件导航大全 服务控制管理器 (SCM) 负责管理系统上运行的服务的活动...
Radmin VPN Wind... Radmin VPN 是一款免费且用户友好的软件,旨在牢固地连接计算机以创建一个有凝聚力的虚拟专用网...
Hive OS LOLMine... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
如何修复 Steam 内容文件... Steam 内容文件锁定是当您的 Steam 文件无法自行更新时出现的错误。解决此问题的最有效方法之...
Hive OS 部署 PXE ... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
如何在电报Telegram中隐... 点击进入:ChatGPT工具插件导航大全 在Android上的电报中隐藏您的电话号码 您可以通过切换...
在 iCloud 上关闭“查找... 如果您是 Apple 的长期用户,您肯定会遇到过 Find My 应用程序,它本机安装在 iPhon...
farols1.1.501.0... faro ls 1.1.501.0(64bit)可以卸载,是一款无需连接外部PC机或笔记本计算机即可...
如何在Instagram上扫描... 如何在Instagram上扫描名称标签/ QR? 总而言之,您可以通过大约四种不同的方法来扫描这些I...