Ed Henderson asks:

> There is a Unix::Syslog module that supposedly is more secure according to
> the docs.  But I don't have a clue as to how to use it instead of
> Sys::Syslog.  Any suggestions?

Yes, I asked my Perl module/Solaris expert about Sys:: and Unix::
He told me that he thought that Sys:: tended to be perl internal stuff
while Unix:: was more what the user would use.

I have crudely copied the corresponding parts from amavisd and enclose
a patch below. This now successfully logs via syslog on Solaris, but is
not integrated with the -s flag, it just uses mail.info
Warning - I am no expert.

FYI Amavis is a virus scanning wrapper for your mailer, which can be run
in the same way as spamc and spamd (amavis/amavisd).
http://sourceforge.net/projects/amavis/

Geoff

UK-Human Genome Mapping Project-Resource Centre,
Hinxton, Cambridge, CB10 1SB, UK
Tel: +44 1223 494530  Fax: +44 1223 494512  E-mail: [EMAIL PROTECTED]
====================
/usr/local/gnu/bin/diff -u 
/packages/localsrc/mail/Mail-SpamAssassin-2.11/spamd/spamd.orig spamd
--- /packages/localsrc/mail/Mail-SpamAssassin-2.11/spamd/spamd.orig     Wed Mar 
13 09:22:44 2002
+++ spamd       Wed Mar 13 09:18:05 2002
@@ -13,7 +13,7 @@
 use Carp;
 use Mail::SpamAssassin;
 use Mail::SpamAssassin::NoMailAudit;
-use Sys::Syslog qw(:DEFAULT setlogsock);
+use Unix::Syslog qw(:macros :subs);
 use POSIX qw(setsid);
 use Getopt::Std;
 use POSIX ":sys_wait_h";
@@ -127,7 +127,7 @@
 sub spawn;  # forward declaration
 sub logmsg; # forward declaration
 
-setlogsock('unix');
+#setlogsock('unix');
 
 my $port = $opt_p || 783;
 my $addr = gethostbyname($opt_i || '127.0.0.1');
@@ -171,6 +171,12 @@
 $SIG{INT} = \&kill_handler;
 $SIG{TERM} = \&kill_handler;
 
+my $SYSLOG_LEVEL = "mail.info";
+my ($FACILITY, $PRIORITY);
+($FACILITY = $SYSLOG_LEVEL) =~ s/(\w+)\.(\w+)/LOG_\U$1/;
+($PRIORITY = $SYSLOG_LEVEL) =~ s/(\w+)\.(\w+)/LOG_\U$2/;
+openlog("spamd", "LOG_PID", eval "$FACILITY");
+
 # now allow waiting processes to connect, if they're watching the log.
 # The test suite does this!
 if ($opt_D) {
@@ -547,8 +553,7 @@
 
 sub logmsg
 {
-    openlog('spamd','cons,pid',$log_facility);
-    syslog('info',"@_");
+    syslog(eval "$PRIORITY", "%s", "@_");
     if ($opt_D) { warn "logmsg: @_\n"; }
 }


== patch ends ===


_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to