Skip to content

silence errorneous output when not generating reports#1657

Merged
georglauterbach merged 4 commits intodocker-mailserver:masterfrom
erdos4d:silence_errorneous_output_when_not_generating_reports
Oct 21, 2020
Merged

silence errorneous output when not generating reports#1657
georglauterbach merged 4 commits intodocker-mailserver:masterfrom
erdos4d:silence_errorneous_output_when_not_generating_reports

Conversation

@erdos4d
Copy link
Copy Markdown
Contributor

@erdos4d erdos4d commented Oct 17, 2020

Another small PR in my efforts to get the logs clean. The documentation states that for the postfix and logwatch reports, we should set PFLOGSUMM_TRIGGER and LOGWATCH_INTERVAL to empty (the defaults) to not generate those reports. When doing this, the functions _setup_mail_summary and _setup_logwatch get called and generate the erroneous output:

Error PFLOGSUMM_TRIGGER not found in _setup_mail_summery
Warning LOGWATCH_INTERVAL not found in _setup_logwatch

This PR corrects the start-mailserver.sh script to not call those function in the case that we are not generating reports. I tested it with a container build and run both with and without the changes and the log lines disappear when the changes are present.

@erdos4d erdos4d force-pushed the silence_errorneous_output_when_not_generating_reports branch from 3bac875 to 2b3eadd Compare October 17, 2020 19:00
@erdos4d erdos4d force-pushed the silence_errorneous_output_when_not_generating_reports branch from 2b3eadd to cc8592e Compare October 17, 2020 19:02
Comment thread target/start-mailserver.sh Outdated
@georglauterbach georglauterbach self-requested a review October 18, 2020 15:42
@erdos4d
Copy link
Copy Markdown
Contributor Author

erdos4d commented Oct 18, 2020

Ok, I took another look and I now see that my first understanding of the logic of the script was off. My changes now boil down to the following:

  • Removal of the undocumented variable LOGWATCH_TRIGGER and condition that always evaluates true in the start-mailserver.sh script.
  • Addition of appropriate warning messages when reports are turned off, not misleading errors.
  • Removal of PFLOGSUMM_TRIGGER condition that also always evaluates to true (the variable is set in a later function, but cannot be "none" when the condition is evaluated).

@georglauterbach
Copy link
Copy Markdown
Member

Ok, I took another look and I now see that my first understanding of the logic of the script was off. My changes now boil down to the following:

* Removal of the undocumented variable LOGWATCH_TRIGGER and condition that always evaluates true in the start-mailserver.sh script.

* Addition of appropriate warning messages when reports are turned off, not misleading errors.

* Removal of PFLOGSUMM_TRIGGER condition that also always evaluates to true (the variable **is** set in a later function, but cannot be "none" when the condition is evaluated).

I like this. Nevertheless, I will request a review more. But I will already approve of this :)

@erik-wramner
Copy link
Copy Markdown
Contributor

Perhaps the message should be info rather than warning as having the reports disabled is perfectly normal? Other than that it looks fine!

@georglauterbach
Copy link
Copy Markdown
Member

That's a good idea @erik-wramner. @erdos4d I will just do this, as this is the fastest and easiest way. Then I will merge it.

@georglauterbach georglauterbach merged commit 451bbfd into docker-mailserver:master Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants