Mail-SpamAssassin

 view release on metacpan or  search on metacpan

INSTALL  view on Meta::CPAN

modules, so invoking sa-update should be performed only after installing
or upgrading SpamAssassin code, not before.

Installing rules from network is done with a single command:

        sa-update

For security reasons, it should not be run as root, but as the user normally
running SpamAssassin.  You can run the initial setup once as root, to create
necessary directories etc.  Then you need to change ownership of
LOCAL_STATE_DIR to that user (usually: chown -R user:user
/var/lib/spamassassin), you can find out the default directory with
sa-update --help (look for --updatedir).  Same needs to be done for
LOCAL_RULES_DIR/sa-update-keys (usually: chown -R user:user
/etc/mail/spamassassin/sa-update-keys), the directory can be found with
spamassassin --help (look for --siteconfigpath).

If you wish to install rules from downloaded files, rather than "live" from
the latest online ruleset, here is how to do it.

Obtain all the following files from https://spamassassin.apache.org/downloads.cgi:

    Mail-SpamAssassin-rules-xxx.tgz
    Mail-SpamAssassin-rules-xxx.tgz.asc

ldap/README.testing  view on Meta::CPAN

    rootpw      secret1

  On Fedora Core 1, you can use the file from
  http://yolinux.com/TUTORIALS/OpenLDAP2.0-stooges-slapd.conf-sample.txt 
  pretty much as-is.


- Next, create the storage directories:

    sudo mkdir /var/lib/ldap/stooges /var/lib/ldap/fraternity
    sudo chown ldap.ldap /var/lib/ldap/stooges    [Fedora Core only]
    sudo chown ldap.ldap /var/lib/ldap/fraternity [Fedora Core only]


- And start the server:

    sudo /etc/rc.d/init.d/ldap start              [Fedora Core only]
    sudo /etc/init.d/slapd start                  [Debian only]


- Now load the LDIF data for our testing: (this LDIF file adds a "spamassassin"
  line to the "curley" user.)

lib/Mail/SpamAssassin.pm  view on Meta::CPAN

      # procedure no longer does so, as it avoids reading line-by-line
      my($inbuf,$nread);
      while ( $nread=read(IN,$inbuf,16384) ) {
        print OUT $inbuf  or die "cannot write to $fname: $!";
      }
      defined $nread  or die "error reading $defprefs: $!";
      undef $inbuf;
      close OUT or die "error closing $fname: $!";
      close IN  or die "error closing $defprefs: $!";

      if (($< == 0) && ($> == 0) && defined($user)) { # chown it
        my ($uid,$gid) = (getpwnam(untaint_var($user)))[2,3];
        unless (chown($uid, $gid, $fname)) {
          warn "config: couldn't chown $fname to $uid:$gid for $user: $!\n";
        }
      }
      warn "config: created user preferences file: $fname\n";
      return(1);
    }
  }

  return(0);
}

spamd/spamd.raw  view on Meta::CPAN

    if ($owner) {
      my ($login,$pass,$puid,$pgid) = getpwnam($owner)
                           or die "spamd: $owner not in passwd database\n";
      $uid = $puid;
    }
    if ($group) {
      my ($name,$pass,$ggid,$members) = getgrnam($group)
                           or die "spamd: $group not in group database\n";
      $gid = $ggid;
    }
    if (!chown $uid, $gid, $path) {
      die "spamd: could not chown $path to $uid/$gid: $!";
    }
  }

  if (!chmod $mode, $path) {    # make sure everybody can talk to it
    die "spamd: could not chmod $path to $mode: $!";
  }

  push(@listen_sockets, { specs => $socket_specs,
                          path => $path,
                          socket => $server_unix,



( run in 2.766 seconds using v1.01-cache-2.11-cpan-71847e10f99 )