voxpupuli / puppet-postfix

Puppet postfix module
Apache License 2.0
70 stars 173 forks source link

maillog configuration? #386

Closed Szparki closed 5 months ago

Szparki commented 5 months ago

The module is not managing log related settings, such as maillog_file or maillog_file_rotate_suffix. Without these on Ubuntu and Debian, postfix logs are filling up /var/log/syslog, making it difficult to find none mail related information.

Affected Puppet, Ruby, OS and module versions/distributions

Szparki commented 5 months ago

I found out that you can configure it with postfix::config, for example:

        postfix::config {
         'maillog_file':                     value => '/var/log/postfix.log';
         'maillog_file_rotate_suffix':       value => '%Y%m%d';
       }
smortex commented 5 months ago

Correct. For historic reasons, some parameters must be passed to the postfix class and are then passed to postfix::config resources, but rather than adding more like this, I feel it is better to directly write the config you wants with postfix::config resources.

Closing since the issue is resolved.

Szparki commented 5 months ago

I see, thank you @smortex ! Do you have an example how to define them in hieradata?

Also I noticed that I do need postlog in master.cf but I haven't found an option to configure it with the module. If I add by hand it gets removed:

Apr 26 14:04:01 postfix-server postfix/postfix-script[1877795]: fatal: missing 'postlog' service in master.cf - run 'postfix upgrade-configuration'
Notice: /Stage[main]/Postfix::Files/File[/etc/postfix/master.cf]/content:
--- /etc/postfix/master.cf  2024-04-29 08:47:01.814602062 +0000
+++ /tmp/puppet-file20240429-1989427-r6yung 2024-04-29 08:47:16.946726595 +0000
@@ -44,7 +44,6 @@
 lmtp      unix  -       -       n       -       -       lmtp
 anvil     unix  -       -       n       -       1       anvil
 scache    unix  -       -       n       -       1       scache
-postlog   unix-dgram n  -       n       -       1       postlogd
 #
 # ====================================================================
 # Interfaces to non-Postfix software. Be sure to examine the manual
Szparki commented 5 months ago

I can use master_entries to add the postlog line, good