Postfix别名db:没有这样的文件或目录

前端之家收集整理的这篇文章主要介绍了Postfix别名db:没有这样的文件或目录前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图在带有ZoneMinder的本地Ubuntu 12.04上使用后缀.
我从Ubuntu Desktop安装了Postfix包及其依赖项.

现在,如果我尝试使用以下命令发送电子邮件,它的效果很好:

echo "This is the body of the email" | mail -s "This is the subject line" myemail@gmail.com

然后,如果来自ZoneMinder的警报发送电子邮件,我会得到以下信息

Apr 16 17:05:18 ubuntu postfix/local[11541]: warning: hash:/etc/aliases is unavailable. open database /etc/aliases.db: No such file or directory

如果我运行postqueue -q我得到排队的电子邮件(别名数据库不可用)

A09B4A40C16      422 Thu Apr 16 16:59:37  destination@email.net
                                                  (alias database unavailable)
                                         root@nameofthehost.net

我尝试按照以下其他帖子的建议将pownership设置为postfix

sudo chown postfix:postfix -R /var/lib/postfix

并重新启动后缀,但没有帮助.

main.cf具有以下内容

smtpd_banner = $myhostname ESMTP $mail_name(Ubuntu)
biff =没有

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

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# 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.

myhostname = ubuntu
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = meridianozero.net,localhost,localhost.localdomain,localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailBox_command = procmail -a "$EXTENSION"
mailBox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

我应该检查什么?

@H_301_30@
这是因为你有
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

散列:表示您必须具有包含散列的数据库文件,如Postfix lookup table types中所述:

An indexed file type based on hashing. This is available only on
systems with support for Berkeley DB databases. Public database files
are created with the postmap(1) or postalias(1) command,and private
databases are maintained by Postfix daemons. The database name as used
in “hash:table” is the database file name without the “.db” suffix.

因此,如alias_maps的文档中所述:

If you change the alias database,run postalias /etc/aliases (or
wherever your system stores the mail alias file),or simply run
newaliases to build the necessary DBM or DB file.

这将根据/ etc / aliases中的信息构建/etc/aliases.db文件.

当然,您也必须在初始设置期间运行这些命令中的任何一个.

猜你在找的Ubuntu相关文章