Mail-SpamAssassin-Plugin-OpenPGP

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

etc/init_openpgp.pre
lib/Mail/SpamAssassin/Plugin/OpenPGP.pm
LICENSE-Apache.txt
MANIFEST
MANIFEST.SKIP
META.yml			# Will be created by "make dist"
NOTICE.txt
README
rules/10_misc.cf
rules/test_load_plugin.pre
rules/user_prefs.template
t/00-load.t
t/acceptance-bad.t
t/acceptance-base.pl
t/acceptance-encrypted.t
t/acceptance-good.t
t/acceptance-normal.t
t/acceptance-unknown.t
t/boilerplate.t
t/config
t/config.dist

SIGNATURE  view on Meta::CPAN

SHA1 cf398c2a73851acae027d4e591b62c23e2fef8e4 MANIFEST
SHA1 cb145d7db363b64d355eb990659f206c1077cca7 MANIFEST.SKIP
SHA1 8f4de38baf87cc3c80e22a42d38b6abe38308235 META.yml
SHA1 251d966d2e1f6a2b5532c292d4f43d21ed9d0f07 NOTICE.txt
SHA1 9d3b34db332fdfa58402956fb290ee0873cfe635 README
SHA1 0c9e90a6e962fdba9902cceed09b41a830b13af5 etc/26_openpgp.cf
SHA1 439dc180bd26255a53fc2556c9db27d5f635dd1c etc/init_openpgp.pre
SHA1 6251dae9d9411607c0c60e8753700d9588f89fd7 lib/Mail/SpamAssassin/Plugin/OpenPGP.pm
SHA1 8ea48df280439619c7618774150445c2d8d849b2 rules/10_misc.cf
SHA1 283f7364f5dfb5db1c75c2bdec90ea8e7784a86c rules/test_load_plugin.pre
SHA1 ee9aa2a0c155c661439643b1a60181cf0ba980e0 rules/user_prefs.template
SHA1 c74b253b51081af1c2d875602bd605f97a82992c t/00-load.t
SHA1 20ca644ea438d62736b14927418b3f5a55d8f73a t/SATest.pm
SHA1 36a006f19ef904960814d887f7b01b1c4adad0c4 t/acceptance-bad.t
SHA1 9ba5d3d2e11e11f075e6cffa6c652e3f16ddf740 t/acceptance-base.pl
SHA1 dfe2eaed25f28be8ca2efba7628b782499932943 t/acceptance-encrypted.t
SHA1 9ce883ae9a639045b004c7ed74f825fa01b1c89d t/acceptance-good.t
SHA1 ec7620732ee33756f8f41acb296edebcf6326a8e t/acceptance-normal.t
SHA1 acf21dd4a8fdc491004882fb59f8d523959c1106 t/acceptance-unknown.t
SHA1 2c317c92eb043906db6789f9f01744cbc0e6c53e t/boilerplate.t
SHA1 4529db8acd258e0c931248890af27035d86ae97b t/config

rules/10_misc.cf  view on Meta::CPAN

#
# user_scores_sql_username is the authorized username to connect to DSN
# user_scores_sql_password is the password for the database username

#user_scores_dsn		DBI:mysql:spamassassin:localhost
#user_scores_sql_username	spam
#user_scores_sql_password	spamfilter

##########################################################################
# Headers to be added to mail (can be overriden by users in
# ~/.spamassassin/user_prefs)
# Make sure the header stays entirely on one line here

clear_headers

#X-Spam-Checker-Version: SpamAssassin 2.60-cvs (1.188-2003-05-24-exp)
add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on _HOSTNAME_

#X-Spam-Flag: YES
add_header spam Flag _YESNOCAPS_

rules/10_misc.cf  view on Meta::CPAN

add_header all Level _STARS(*)_

#X-Spam-Status: Yes, score=14.0 required=5.0 tests=BAYES_99,CALL_FREE
#        DATE_IN_PAST_12_24,DCC_CHECK,DRASTIC_REDUCED,FROM_HAS_MIXED_NUMS
#        FROM_HAS_MIXED_NUMS3,HOME_EMPLOYMENT,INVALID_DATE,INVALID_MSGID
#        LINES_OF_YELLING,MSGID_HAS_NO_AT,NO_REAL_NAME,ONCE_IN_LIFETIME
#        UNDISC_RECIPS autolearn=spam version=2.60-cvs
add_header all Status "_YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_"

###########################################################################
# Default prefs values: users can override these in their 
# ~/.spamassassin/user_prefs files.

# How many points before a mail is considered spam.
required_score           5

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales              all

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.  This is an expensive

rules/10_misc.cf  view on Meta::CPAN

bayes_auto_learn_threshold_spam		12.0
endif # Mail::SpamAssassin::Plugin::AutoLearnThreshold

# Set this to 0 to turn off auto-learning.
bayes_auto_learn			1

# report_safe controls the markup of spam. If you set it to 0, the message
# body of spam messages will not be modified
report_safe           1

# Some common prefs settings can be set here, to take effect site-wide
# unless the user override them. See the user_prefs.template file for
# explanations.


t/SATest.pm  view on Meta::CPAN

  $spamd_localrules_args = " --siteconfigpath log/localrules.tmp";
  $scr_localrules_args =   " --siteconfigpath log/localrules.tmp";
  $salearn_localrules_args =   " --siteconfigpath log/localrules.tmp";

  $scr_cf_args = "-C log/test_rules_copy";
  $scr_pref_args = "-p log/test_default.cf";
  $salearn_cf_args = "-C log/test_rules_copy";
  $salearn_pref_args = "-p log/test_default.cf";
  $scr_test_args = "";
  $salearn_test_args = "";
  $set_test_prefs = 0;
  $default_cf_lines = "
    bayes_path ./log/user_state/bayes
    auto_whitelist_path ./log/user_state/auto-whitelist
  ";

  (-f "t/test_dir") && chdir("t");        # run from ..

  read_config();

  $NO_SPAMC_EXE = ($RUNNING_ON_WINDOWS &&

t/SATest.pm  view on Meta::CPAN


  rmtree ("log/localrules.tmp");
  mkdir ("log/localrules.tmp", 0755);

  for $file (<../rules/*.pre>) {
    $base = basename $file;
    copy ($file, "log/localrules.tmp/$base")
      or warn "cannot copy $file to log/localrules.tmp/$base";
  }

  copy ("../rules/user_prefs.template", "log/test_rules_copy/99_test_default.cf")
    or die "user prefs copy failed";

  open (PREFS, ">>log/test_rules_copy/99_test_default.cf");
  print PREFS $default_cf_lines;
  close PREFS;

  # create an empty .prefs file
  open (PREFS, ">>log/test_default.cf"); close PREFS;

  mkdir("log/user_state",0755);

  $home = $ENV{'HOME'};
  $home ||= $ENV{'WINDIR'} if (defined $ENV{'WINDIR'});
  $cwd = getcwd;

  $ENV{'TEST_DIR'} = $cwd;
  $testname = $tname;

t/SATest.pm  view on Meta::CPAN


sub tstlocalrules {
  my $lines = shift;

  $set_local_rules = 1;

  open (OUT, ">log/localrules.tmp/00test.cf") or die;
  print OUT $lines; close OUT;
}

sub tstprefs {
  my $lines = shift;

  $set_test_prefs = 1;

  # TODO: should we use -p, or modify the test_rules_copy/99_test_default.cf?
  # for now, I'm taking the -p route, since we have to be able to test
  # the operation of user-prefs in general, itself.

  open (OUT, ">log/tst.cf") or die;
  print OUT $lines; close OUT;
  $scr_pref_args = "-p log/tst.cf";
}

# creates a .pre file in the localrules dir to be parsed alongside init.pre
# make it zz_* just to make sure it is parse last

sub tstpre {

t/SATest.pm  view on Meta::CPAN

      $spamd_cf_args,
      $spamd_localrules_args,
    );
  }
  if ($spamd_extra_args !~ /(?:-p\s*[0-9]+|-o|--socketpath)/) {
    push(@spamd_args,
      qq{-p}, $spamdport,
    );
  }

  if ($set_test_prefs) {
    warn "oops! SATest.pm: a test prefs file was created, but spamd isn't reading it\n";
  }

  my $spamd_stdout = "log/$testname-spamd.out";
  my $spamd_stderr = "log/$testname-spamd.err";
  my $spamd_stdlog = "log/$testname-spamd.log";
  my $spamd_forker = $ENV{'SPAMD_FORKER'}   ?
                       $ENV{'SPAMD_FORKER'} :
                     $RUNNING_ON_WINDOWS    ?
                       "start $perl_path"   :
                       $perl_path;

t/SATest.pm  view on Meta::CPAN

  }
}

sub create_saobj {
  my ($args) = shift; # lets you override/add arguments

  # YUCK, these file/dir names should be some sort of variable, at
  # least we keep their definition in the same file for the moment.
  my %setup_args = ( rules_filename => 'log/test_rules_copy',
		     site_rules_filename => 'log/localrules.tmp',
		     userprefs_filename => 'log/test_default.cf',
		     userstate_dir => 'log/user_state',
		     local_tests_only => 1,
                     # debug => 'all',
		   );

  # override default args
  foreach my $arg (keys %$args) {
    $setup_args{$arg} = $args->{$arg};
  }

t/acceptance-base.pl  view on Meta::CPAN

    # add lines to test-local rules
    tstlocalrules (q{
    score OPENPGP_SIGNED -1
    score OPENPGP_SIGNED_GOOD -1
    score OPENPGP_SIGNED_BAD 1
}   );

    # make sure it has the right permissions, otherwise gnupg won't use it (no permissions to group or world)
    chmod 0700, 'gpg-home';

    tstprefs (q{
    dns_available no
    
    #gpg_executable /usr/bin/gpg
    gpg_homedir gpg-home
}   );

};

acceptance_init();



( run in 0.598 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )