![postfix 错误:打开数据库 /var/lib/mailman/data/aliases.db:没有此文件](https://linux22.com/image/795660/postfix%20%E9%94%99%E8%AF%AF%EF%BC%9A%E6%89%93%E5%BC%80%E6%95%B0%E6%8D%AE%E5%BA%93%20%2Fvar%2Flib%2Fmailman%2Fdata%2Faliases.db%EF%BC%9A%E6%B2%A1%E6%9C%89%E6%AD%A4%E6%96%87%E4%BB%B6.png)
在尝试遵循Ubuntu 上 postfix 和 mailman 指南,我不明白这些指示:
This build of mailman runs as list. It must have permission to read /etc/aliases and read and write /var/lib/mailman/data/aliases. Do this with these commands:
sudo chown root:list /var/lib/mailman/data/aliases
sudo chown root:list /etc/aliases
Save and run:
sudo newaliases
我遇到了这种错误:
root@dur:~#
root@dur:~#
root@dur:~# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 dur.bounceme.net ESMTP Postfix (Ubuntu)
ehlo dur
250-dur.bounceme.net
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.
root@dur:~#
root@dur:~# tail /var/log/mail.log
Aug 28 01:16:43 dur postfix/master[19444]: terminating on signal 15
Aug 28 01:16:43 dur postfix/postfix-script[19558]: starting the Postfix mail system
Aug 28 01:16:43 dur postfix/master[19559]: daemon started -- version 2.9.1, configuration /etc/postfix
Aug 28 01:16:45 dur postfix/postfix-script[19568]: stopping the Postfix mail system
Aug 28 01:16:45 dur postfix/master[19559]: terminating on signal 15
Aug 28 01:16:45 dur postfix/postfix-script[19673]: starting the Postfix mail system
Aug 28 01:16:45 dur postfix/master[19674]: daemon started -- version 2.9.1, configuration /etc/postfix
Aug 28 01:17:22 dur postfix/smtpd[19709]: error: open database /var/lib/mailman/data/aliases.db: No such file or directory
Aug 28 01:17:22 dur postfix/smtpd[19709]: connect from localhost[127.0.0.1]
Aug 28 01:18:37 dur postfix/smtpd[19709]: disconnect from localhost[127.0.0.1]
root@dur:~#
root@dur:~# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
default_transport = smtp
home_mailbox = Maildir/
inet_interfaces = loopback-only
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-mail-stack-delivery.conf -m "${EXTENSION}"
mailbox_size_limit = 0
mailman_destination_recipient_limit = 1
mydestination = dur, dur.bounceme.net, localhost.bounceme.net, localhost
myhostname = dur.bounceme.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relay_domains = lists.dur.bounceme.net
relay_transport = relay
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
root@dur:~#
root@dur:~#
我想知道这其中可能有什么联系。我确实发现我没有必需的文件:
root@dur:~#
root@dur:~# ll /var/lib/mailman/data/aliases
ls: cannot access /var/lib/mailman/data/aliases: No such file or directory
root@dur:~#
这些别名是在哪个阶段创建的?我该如何创建它们?这是导致错误的原因吗error: open database /var/lib/mailman/data/aliases.db: No such file or directory Aug 28 01:17:22 dur postfix/smtpd[19709]: connect from localhost[127.0.0.1]
?
答案1
这些别名是在什么阶段创建的?
安装mailman
仅复制以下位置的安装文件/var/lib/mailman
:
# ls -l /var/lib/mailman/data/
total 16
-rw-rw-r-- 1 root list 10 Aug 28 16:08 last_mailman_version
-rw-r--r-- 1 root list 14100 Jul 18 00:45 sitelist.cfg
我怎样才能创建它们?
$ sudo /usr/lib/mailman/bin/genaliases
$ ls -l /var/lib/mailman/data/
total 20
-rw-rw---- 1 root list 355 Aug 28 16:46 aliases
-rw-r----- 1 root list 3072 Aug 28 16:46 aliases.db
-rw-rw-r-- 1 root list 10 Aug 28 16:08 last_mailman_version
-rw-r--r-- 1 root list 14100 Jul 18 00:45 sitelist.cfg
这是导致错误的原因吗
error: open database /var/lib/mailman/data/aliases.db: No such file or directory Aug 28 01:17:22 dur postfix/smtpd[19709]: connect from localhost[127.0.0.1]
?
是的。