Skip to content

Rsyslog fills up /var/log/maillog with GBs in seconds in a CentOS 7 container #21

@andymwood

Description

@andymwood

I'm trying to set up an IMAP mail server in a Docker container running CentOS 7 and I'm encountering the problem as described in the title.

To reproduce use this Dockerfile:

FROM rsyslog/rsyslog_base_centos7
RUN yum -y install postfix maildrop dovecot
EXPOSE 25 110 143
COPY run.sh /run.sh
RUN chmod 755 /*.sh
RUN echo "maildrop:x:59:postfix" >> /etc/group
CMD /run.sh

and run.sh:

#!/bin/bash
rsyslogd
cd /etc/postfix
newaliases
for file in canonical \
		  	helo_access \
		  	relay_ccerts \
		  	relay \
		  	relocated \
		  	sender_canonical \
		  	transport \
		  	virtual
do
	postmap $file
done
postfix start
exec dovecot -F

And run with:

docker build -t mail .
docker run -d --name mail mail && sleep 5 && docker exec mail ls -hl /var/log/maillog

-rw------- 1 root root 2.5G Sep 25 07:54 /var/log/maillog

docker exec mail cat /var/log/messages

Sep 25 07:55:34 aa8628bbfcc6 rsyslogd: environment variable TZ is not set, auto correcting this to TZ=/etc/localtime  [v8.33.0 try http://www.rsyslog.com/e/2442 ]
Sep 25 07:55:34 aa8628bbfcc6 rsyslogd: command 'SystemLogSocketName' is currently not permitted - did you already set it via a RainerScript command (v6+ config)? [v8.33.0 try http://www.rsyslog.com/e/2222 ]
Sep 25 07:55:34 aa8628bbfcc6 rsyslogd:  [origin software="rsyslogd" swVersion="8.33.0" x-pid="8" x-info="http://www.rsyslog.com"] start

/var/log/maillog just keeps filling up very quickly, and the container is unusable. The problem didn't occur when I was using a CentOS 6 container.

I assume something's misconfigured somewhere. Can anyone help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions