Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lost connection after CONNECT from localhost[127.0.0.1] #19

Open
eloirobe opened this issue Sep 23, 2020 · 3 comments
Open

lost connection after CONNECT from localhost[127.0.0.1] #19

eloirobe opened this issue Sep 23, 2020 · 3 comments
Assignees

Comments

@eloirobe
Copy link

Hello just start the image with
docker run -p 25:25 -e "RELAY_MYDOMAIN=domain.com" -e "RELAY_HOST=relay:25" turgon37/smtp-relay

Appears this log message

2020-09-23T13:20:44.588007+00:00 813952df60c9 postfix/smtpd[132]: disconnect from localhost[127.0.0.1] commands=0/0 2020-09-23T13:20:49.666838+00:00 813952df60c9 postfix/smtpd[132]: connect from localhost[127.0.0.1] 2020-09-23T13:20:49.666968+00:00 813952df60c9 postfix/smtpd[132]: lost connection after CONNECT from localhost[127.0.0.1] 2020-09-23T13:20:49.666984+00:00 813952df60c9 postfix/smtpd[132]: disconnect from localhost[127.0.0.1] commands=0/0 2020-09-23T13:20:54.766237+00:00 813952df60c9 postfix/smtpd[132]: connect from localhost[127.0.0.1] 2020-09-23T13:20:54.766333+00:00 813952df60c9 postfix/smtpd[132]: lost connection after CONNECT from localhost[127.0.0.1] 2020-09-23T13:20:54.766343+00:00 813952df60c9 postfix/smtpd[132]: disconnect from localhost[127.0.0.1] commands=0/0 2020-09-23T13:20:59.863704+00:00 813952df60c9 postfix/smtpd[132]: connect from localhost[127.0.0.1] 2020-09-23T13:20:59.863809+00:00 813952df60c9 postfix/smtpd[132]: lost connection after CONNECT from localhost[127.0.0.1] 2020-09-23T13:20:59.863831+00:00 813952df60c9 postfix/smtpd[132]: disconnect from localhost[127.0.0.1] commands=0/0 2020-09-23T13:21:04.958953+00:00 813952df60c9 postfix/smtpd[132]: connect from localhost[127.0.0.1]
Is it normal?

@Turgon37
Copy link
Owner

Hello theses messages are caused by the container healthcheck https://github.com/Turgon37/docker-smtp-relay/blob/master/Dockerfile#L76
I cannot prevent theses messages to occurs, and in fact healthcheck ensure that postfix is running and able to receive incoming mails and can inform your containers orchestrator of this healthy state.

@Turgon37 Turgon37 self-assigned this Sep 23, 2020
@schiegg
Copy link

schiegg commented Nov 16, 2020

Hi everybody,
are these messages logged in any form running in deamon (-d) mode or just written on command line and if they are logged, is there any log rotation and deletion by default or will my container grow in size slowly till its bursting? ;-)

@borice
Copy link

borice commented Jan 2, 2021

I was able to silence these healthcheck logs through rsyslog filtering. Here's the updated /etc/rsyslog.conf ruleset at the bottom which shows how I filter out these annoying healthcheck-related messages:

ruleset(name="process_logs") {
  # discard log messages generated by health check
  :msg, contains, "connect from localhost" stop
  :msg, contains, "lost connection after CONNECT from localhost" stop
  :msg, contains, "disconnect from localhost" stop

  # copy all messages to stdout
  action(
    type="omfile"
    name="output_logs_stdout"
    File="/proc/self/fd/1"
  )
}

You can create a custom rsyslog.conf file which you can then mount in /etc/rsyslog.conf to replace the image-provided one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants