后缀日志文件在哪里?


76

我知道这已经被问过一百遍了。但是我已经做了很多Google搜索,但都没有成功。我的问题:我想记录我的postfix服务器的每个活动。默认文件/var/log/mail或任何其他不相关mail或不postfix存在。

  1. 放入配置文件/etc/postfx/main.cf以启用日志记录的确切字符串是什么?
  2. 在哪里可以看到哪个配置文件后缀使用?(根据下面的提示)

感谢您的回答。

提示:我将后缀与鸽舍一起使用。我几个月前安装了meta包。

输出为postconf -n

    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    append_dot_mydomain = no
    biff = no
    broken_sasl_auth_clients = yes
    config_directory = /etc/postfix
    home_mailbox = Maildir/
    inet_interfaces = all
    mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-dovecot-postfix.conf -n -m "${EXTENSION}"
    mailbox_size_limit = 0
    mydestination = mydomain.de localhost
    myhostname = mydomain.de
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    myorigin = /etc/mailname
    readme_directory = no
    recipient_delimiter = +
    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_sender_restrictions = reject_unknown_sender_domain
    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
    virtual_alias_maps = hash:/etc/postfix/virtual
    virtual_gid_maps = static:5000
    virtual_mailbox_base = /var/mail/vhosts
    virtual_mailbox_domains = mydomain2.de
    virtual_mailbox_maps = hash:/etc/postfix/vmailbox
    virtual_minimum_uid = 100
    virtual_uid_maps = static:5000

Output for /etc/syslog.conf

#  /etc/syslog.conf Configuration file for syslogd.
#
#           For more information see syslog.conf(5)
#           manpage.

#
# First some standard logfiles.  Log by facility.
#

auth,authpriv.*      -/var/log/auth.log
*.*;auth,authpriv.none;local0.none;local1.none      -/var/log/syslog
#cron.*          -/var/log/cron.log
daemon.*            -/var/log/daemon.log
kern.*              -/var/log/kern.log
lpr.*               -/var/log/lpr.log
user.*              -/var/log/user.log

#
# Logging for the mail system.  Split it up so that
# it is easy to write scripts to parse these files.
#

# Logging for INN news system
#
news.crit        -/var/log/news/news.crit
news.err         -/var/log/news/news.err
news.notice         -/var/log/news/news.notice

#
# Some `catch-all' logfiles.
#
*.=debug;\
    auth,authpriv.none;\
    news.none   -/var/log/debug
*.=info;*.=notice;*.=warning;\
    auth,authpriv.none;\
    cron,daemon.none;\
    mail,news.none      -/var/log/messages

#
# Emergencies are sent to everybody logged in.
#
*.emerg             *

#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.
#
#daemon,mail.*;\
#   news.=crit;news.=err;news.=notice;\
#   *.=debug;*.=info;\
#   *.=notice;*.=warning    /dev/tty8

# The named pipe /dev/xconsole is for the `xconsole' utility.  To use it,
# you must invoke `xconsole' with the `-file' option:
# 
#    $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
#      busy site..
#
daemon.*;mail.*;\
    news.err;\
    *.=debug;*.=info;\
    *.=notice;*.=warning    |/dev/xconsole

2
Ubuntu的Postfix软件包/var/log/mail.log默认情况下仅登录到。如果不存在或未在其中登录,请说明对系统所做的更改。如果不提供您尝试/发现的详细信息,我们将无法真正为您提供帮助。也许就像修改后的rsyslog配置一样简单。我们无权访问您的系统,也看不到您的屏幕,因此我们依赖您在问题中提供的信息。并打印当前的Postfix配置postconf -n
gertvdijk 2013年

编辑您的问题以包括详细信息。这就是这个网站的运作方式。评论不适合这样。
gertvdijk 2013年

你好 我添加了postconf的输出。过去我什么都没改变。我刚刚安装了meta包。好吧,我可能有人占领了服务器并删除了日志:-D。最近几天从该服务器发送了很多邮件,似乎是垃圾邮件...
Steve Rakebrandt

如果您怀疑有人只是直截了当地删除了日志文件,则它们可能不再正确旋转,并且文件描述符仍对较旧的(未链接)日志文件开放。您是否尝试过重新启动Postfix和rsyslog
gertvdijk 2013年

是的,如果已经重新启动了postfix几次。几分钟前,我还重新启动了服务器。没有变化。文件仍然丢失。据我所知,所有活动日志将在一段时间后压缩,因此我认为这些都是活动日志:aptitude,auth,daemon,dovecot,dpkg,mysql,vsftpd。好吧,如果今天晚上我没有得到任何结果,我将进行备份并开始重新安装过程(提供程序功能)。顺便说一句,我无法重新启动rsyslog(d)->无法识别的服务。
Steve Rakebrandt

Answers:


76

他们应该在/var/log/mail.log。但是,您(或提供者)似乎已更改了syslog工具配置。使用纯syslogd而不是rsyslogd是很有可能的,但是随后您可以期望事情会有所不同。

如评论中已经提到的,通过安装rsyslog,文件重新出现。


1
是的,就我而言,我只需要运行“ apt-get install rsyslog”和“ service postfix restart”,我的/var/log/mail.log就会出现
Mike

6

在Ubuntu 16.04上,我在/var/log/syslog以下位置找到了后缀日志:

grep postfix /var/log/syslog

您可以查看后缀日志流:

tail -f /var/log/syslog | grep postfix
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.