备份/恢复系统BAREOS的安装、设置和使用(四)

本文详细介绍了如何为Bareos配置外部SMTP邮件服务器,包括安装配置Postfix服务,修改Director邮件发送命令,确保Bareos能通过SMTP发送备份和恢复状态的邮件通知。
摘要由CSDN通过智能技术生成

为Bareos配置外部SMTP邮件服务器

Bareos可以用电子邮件将有关信息发送到邮箱,并提供了bsmtp邮件发送工具。bsmtp工具很简单,并不适用一般中小微企业情况。本文将介绍如何配置外部SMTP服务器为Bareos发送邮件。




安装配置postfix服务


安装Postfix
root@bareos:~# apt install libsasl2-modules postfix mailutils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libsasl2-modules is already the newest version (2.1.27~101-g0780600+dfsg-3ubuntu2).
The following additional packages will be installed:
  guile-2.0-libs libgc1c2 libgsasl7 libkyotocabinet16v5 libltdl7 libmailutils5 libmysqlclient20 libntlm0 libpython2.7 libpython2.7-minimal
  libpython2.7-stdlib mailutils-common mysql-common ssl-cert
Suggested packages:
  mailutils-mh mailutils-doc procmail postfix-mysql postfix-pgsql postfix-ldap postfix-pcre postfix-lmdb postfix-sqlite sasl2-bin
  dovecot-common resolvconf postfix-cdb postfix-doc openssl-blacklist
The following NEW packages will be installed:
  guile-2.0-libs libgc1c2 libgsasl7 libkyotocabinet16v5 libltdl7 libmailutils5 libmysqlclient20 libntlm0 libpython2.7 libpython2.7-minimal
  libpython2.7-stdlib mailutils mailutils-common mysql-common postfix ssl-cert
0 upgraded, 16 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,916 kB of archives.
After this operation, 43.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
......
......
......
Processing triggers for systemd (237-3ubuntu10.3) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for rsyslog (8.32.0-1ubuntu4) ...
Processing triggers for ufw (0.35-5) ...
root@bareos:~# 

当询问邮件设置类型时,暂时选择“No configuration”,我们将在后面手工配置。

这里写图片描述


配置postfix

现在的SMTP服务,一般都会有严格的安全控制,包括QQ邮箱、阿里邮箱。如以前经常使用的方式:以account1授权发送邮件,在邮件头使用From:account2或Reply-to:account3的方式来说明不同的邮件来源,现在已不可行,account2和account3都必须独立验证授权。为此,我们需要为postfix配置三个文件,分别是main.cfsasl_passwdsender_relay

配置 main.cf

/etc/postfix/main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Bareos)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = lswin.cn
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
myne
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值