On Fri, Oct 22, 2004 at 08:43:10AM -0500, Chris Barnes wrote:
> I have what might be a silly question.
> We have 2 linux boxes:
> 
> 1) server (ie. only sysadmins can logon directly).  It is the mail 
> server (as well as apache, etc).  It has SA installed.   The raid5 disk 
> holding the user files are connected to this box.
> 
> 2) interactive user box - users can logon (ssh) to this box.
> /home is nfs mounted from box1
> 
> /usr/bin/sa-learn is on box1 (obviously).
 
If I were you, I would set up a dummy user on box1 with ssh keys so
that the dummy user could login without a password from box2, and after
applying the '-u user' patch after my signature, you could write a small
script on box2 that does something like:

ssh -i /path/to/key [EMAIL PROTECTED] /path/to/sa-learn -u box2_user
  --sa-learn-flags

which will take the mail on stdin and pipe it to sa-learn on the other
box.

Be careful about security issues here to protect box1.

It might be safer to just have your users dump stuff into a spam and ham
directory somewhere on box2 and have a cronjob do the dirty work from
there and then delete the files.

Or something else using standard tools to run something on anohter box.
Like a web form or something.  The cronjob is probably the safest and
easiest to implement.

Mike


-- 
/-----------------------------------------\
| Michael Barnes <[EMAIL PROTECTED]> |
| UNIX Systems Administrator              |
| College of William and Mary             |
| Phone: (757) 879-3930                   |
\-----------------------------------------/

--- sa-learn    Fri Oct 15 11:38:19 2004
+++ /usr/local/bin/sa-learn     Thu Oct 21 10:44:09 2004
@@ -1,4 +1,7 @@
 #!/usr/local/bin/perl -T -w
+
+eval 'exec /usr/local/bin/perl -T -w -S $0 ${1+"$@"}'
+    if 0; # not running under some shell
 # <@LICENSE>
 # Copyright 2004 Apache Software Foundation
 # 
@@ -95,6 +98,7 @@
   'ham|nonspam' => sub { $isspam = 0; },
   'spam'        => sub { $isspam = 1; },
   'sync'        => \$synconly,
+  'username|u=s'    => \$opt{'username'},
   'rebuild'     => sub { $synconly = 1; warn "The --rebuild option has been 
deprecated.  Please use --sync instead.\n" },
 
   'configpath|config-file|config-dir|c|C=s' => \$opt{'configpath'},
@@ -186,6 +190,7 @@
     rules_filename      => $opt{'configpath'},
     site_rules_filename => $opt{'siteconfigpath'},
     userprefs_filename  => $opt{'prefspath'},
+    username           => $opt{'username'},
     debug               => defined( $opt{'debug-level'} ),
     local_tests_only    => 1,
     dont_copy_prefs     => 1,
@@ -516,6 +521,7 @@
  --backup                          Backup, to STDOUT, existing database
  --restore <filename>              Restore a database from filename
 
+ -u username, --username=username  Override username taken from the runtime 
environment
  -C path, --configpath=path, --config-file=path   Path to standard 
configuration dir
  -p prefs, --prefspath=file, --prefs-file=file    Set user preferences file
  --siteconfigpath=path             Path for site configs (def: 
/etc/mail/spamassassin)

--- sa-learn    Fri Oct 15 11:38:19 2004
+++ /usr/local/bin/sa-learn     Thu Oct 21 10:44:09 2004
@@ -1,4 +1,7 @@
 #!/usr/local/bin/perl -T -w
+
+eval 'exec /usr/local/bin/perl -T -w -S $0 ${1+"$@"}'
+    if 0; # not running under some shell
 # <@LICENSE>
 # Copyright 2004 Apache Software Foundation
 # 
@@ -95,6 +98,7 @@
   'ham|nonspam' => sub { $isspam = 0; },
   'spam'        => sub { $isspam = 1; },
   'sync'        => \$synconly,
+  'username|u=s'    => \$opt{'username'},
   'rebuild'     => sub { $synconly = 1; warn "The --rebuild option has been 
deprecated.  Please use --sync instead.\n" },
 
   'configpath|config-file|config-dir|c|C=s' => \$opt{'configpath'},
@@ -186,6 +190,7 @@
     rules_filename      => $opt{'configpath'},
     site_rules_filename => $opt{'siteconfigpath'},
     userprefs_filename  => $opt{'prefspath'},
+    username           => $opt{'username'},
     debug               => defined( $opt{'debug-level'} ),
     local_tests_only    => 1,
     dont_copy_prefs     => 1,
@@ -516,6 +521,7 @@
  --backup                          Backup, to STDOUT, existing database
  --restore <filename>              Restore a database from filename
 
+ -u username, --username=username  Override username taken from the runtime 
environment
  -C path, --configpath=path, --config-file=path   Path to standard 
configuration dir
  -p prefs, --prefspath=file, --prefs-file=file    Set user preferences file
  --siteconfigpath=path             Path for site configs (def: 
/etc/mail/spamassassin)

Reply via email to