[Mimedefang] Syslog facility inconsistency.

Cale Fairchild cale at computan.com
Tue Aug 31 21:11:34 EDT 2010


On Tue, 24 Aug 2010, John Nemeth wrote:

> Cale Fairchild wrote:
> }
> } I am setting up a mail server with mimedefang 2.70 and I have run into
> } logging inconsistencies.
> }
> } I have set up md_graphdefang_log_enable('local5', 1) and most of the
> } logging is going to the appropriate place, however I am also using the
> } md_check_against_smtp_server function in a filter_recipient check and all
> } the logging associated with that function is still being logged to the
> } mail facility. I believe that I have found the place to change this in the
> } mimedefang.pl but I wanted to make sure I will not break anything.
> }
> } Sorry if this has already been addressed, I could not find anything in
> } searching the mailing list archives.
> }
> } --- mimedefang.pl.dist  2010-08-09 21:51:04.000000000 -0400
> } +++ mimedefang.pl       2010-08-24 21:18:00.000000000 -0400
> } @@ -7518,13 +7518,13 @@
> }              if ($code =~ /^[123]/) {
> }                  $retval = 'CONTINUE';
> }              } elsif ($code =~ /^4/) {
> } -               md_syslog('info', "$MsgID: md_check_against_smtp_server
> } for $recip on $server returned $code $dsn $text");
> } +               md_syslog("$GraphDefangSyslogFacility|info", "$MsgID:
> } md_check_against_smtp_server for $recip on $server returned $code $dsn
> } $text");
>
>     "info" is a logging level, not a logging facility, so this patch is
> completely wrong.  Also, there is no reason why general logging and
> graphdefang logging have to go to the same place and it would be wrong to
> force that.  Finally, MIMEDefang provides $SyslogFacility and md_openlog()
> for specifying the facility.  See man mimedefang-filter.
>
> }-- End of excerpt from Cale Fairchild
> _______________________________________________
> NOTE: If there is a disclaimer or other legal boilerplate in the above
> message, it is NULL AND VOID.  You may ignore it.
>
> Visit http://www.mimedefang.org and http://www.roaringpenguin.com
> MIMEDefang mailing list MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>

Actually the syntax of both uses of md_syslog was pulled from the current 
mimedefang.pl (2.70)

line 7621: md_syslog('info', "$MsgID: ...
line 7265: md_syslog("$GraphDefangSyslogFacility|info", "MDLOG,$id ...

So they seem to both be valid, if undocumented, which is why I sent this 
question to the mailing list.

The usage in line 7265 redirects the syslog messages to the facility which 
is set up in the mimedefang-filter example file: 
md_graphdefang_log_enable('local5', 1);

The usage in line 7621 forwards it to the mail facility no matter what 
parameters the md_graphdefang_log_enable is called with.

The part that confuses me is that the general logging is being rediected 
to local5 as directed in the md_graphdefang_log_enable call which lead me 
to assume that this function sets the $SyslogFacility variable. It is the 
built in function feedback from the function md_check_against_smtp_server 
which is still being directed to the LOG_MAIL facility. I read the 
mimedefang-filter man page many times and it still appears to me when 
looking at the code that the logging in this particular function may not 
be set up the same as the other logging within the mimedefang.pl program.

Perhaps I am just being obtuse but something just doesn't seem right.



More information about the MIMEDefang mailing list