我正在尝试在ZoneMinder的本地Ubuntu 12.04使用ZoneMinder 。 我从Ubuntu Desktop安装了Postfix软件包及其依赖项。
现在,如果我尝试使用以下命令发送电子邮件,它的效果很好:
echo "This is the body of the email" | mail -s "This is the subject line" [email protected]
然后,如果从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 -qi获取排队的电子邮件(别名数据库不可用)
A09B4A40C16 422 Thu Apr 16 16:59:37 [email protected] (alias database unavailable) [email protected]
我试图设置pownership到其他post中build议与下面的postfix
sudo chown postfix:postfix -R /var/lib/postfix
并重新启动后缀,但没有帮助。
main.cf有以下几点
smtpd_banner = $ myhostname ESMTP $ mail_name(Ubuntu)biff = no
# 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
我应该检查什么?
这是因为你有
alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases
hash:表示您必须拥有包含散列的数据库文件,如后缀查找表types中所述 :
基于散列的索引文件types。 这仅在支持Berkeley DB数据库的系统上可用。 公共数据库文件是使用postmap(1)或postalias(1)命令创build的,私有数据库由Postfix守护进程维护。 在“hash:table”中使用的数据库名称是没有“.db”后缀的数据库文件名。
因此,如alias_maps文档中所述:
如果更改别名数据库,请运行
postalias /etc/aliases(或系统存储邮件别名文件的任何位置),或者运行新build别名以build立必要的DBM或DB文件。
这将根据/etc/aliases信息构build/etc/aliases.db文件。
当然,你也必须在初始设置时运行这些命令。