summaryrefslogtreecommitdiff
path: root/gnu/packages/perl-web.scm
diff options
context:
space:
mode:
authorAntero Mejr <antero@mailbox.org>2023-06-04 17:42:49 +0000
committerDanny Milosavljevic <dannym@friendly-machines.com>2024-12-22 13:19:19 +0100
commit87c928e1620e7326aa46d86f24905f56fd96d627 (patch)
tree4437100b2fe960f18e82e91ec22312920fdfb0fd /gnu/packages/perl-web.scm
parentcca94f021fed9ff60c97537357a0ce6b9dcd2ecb (diff)
gnu: Add spamassassin.
* gnu/packages/perl-web.scm (spamassassin): New variable. Signed-off-by: Danny Milosavljevic <dannym@friendly-machines.com>
Diffstat (limited to 'gnu/packages/perl-web.scm')
-rw-r--r--gnu/packages/perl-web.scm87
1 files changed, 87 insertions, 0 deletions
diff --git a/gnu/packages/perl-web.scm b/gnu/packages/perl-web.scm
index 3449ccaf0f..c134edc61c 100644
--- a/gnu/packages/perl-web.scm
+++ b/gnu/packages/perl-web.scm
@@ -464,3 +464,90 @@ revoke assertions which in turn is used for computing confidence values
associated with individual signatures.")
(license license:perl-license)))
+(define-public spamassassin
+ (package
+ (name "spamassassin")
+ (version "4.0.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "mirror://cpan/authors/id/S/SI/SIDNEY/Mail-SpamAssassin-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0djgm04kvgq0iab4hhv66gxhl2bhyhj1lfpjcdsw7qq3s6krv5v5"))
+ (modules '((guix build utils)))
+ (snippet #~(delete-file "spamc/configure"))))
+ (build-system perl-build-system)
+ (arguments
+ (list #:phases #~(modify-phases %standard-phases
+ (add-before 'configure 'setup
+ (lambda _
+ (delete-file "t/debug.t") ;hangs
+ (delete-file "t/dnsbl_subtests.t") ;6 failures
+ (delete-file "t/spamc_x_e.t") ;3 failures
+ (setenv "CONFIG_SHELL" (which "sh"))
+ (with-directory-excursion "spamc"
+ (invoke "autoreconf" "-vif"))))
+ (add-after 'install 'fix-lib-path
+ (lambda _
+ (let ((bin (string-append #$output "/bin/")))
+ (for-each
+ (lambda (file)
+ (substitute* file
+ ;; TODO: Can we find a way to keep -T?
+ (("perl -T")
+ "perl"))
+ (wrap-program file
+ `("PERL5LIB" ":" prefix
+ (,(getenv "PERL5LIB")
+ ,(string-append
+ #$output
+ "/lib/perl5/site_perl")))))
+ (map (lambda (file)
+ (string-append bin file))
+ '("spamd" "sa-awl" "sa-check_spamd"
+ "sa-compile" "sa-learn"
+ "sa-update" "spamassassin")))))))))
+ (native-inputs (list autoconf
+ automake
+ perl-devel-cycle
+ perl-net-dns
+ perl-critic
+ perl-critic-policy-perlsecret
+ perl-test-most
+ perl-test-pod
+ perl-text-diff))
+ (propagated-inputs (list perl-archive-zip
+ perl-bsd-resource
+ perl-dbd-sqlite
+ perl-dbi
+ perl-email-address-xs
+ perl-encode-detect
+ perl-geo-ip
+ perl-html-parser
+ perl-io-socket-inet6
+ perl-io-socket-ssl
+ perl-io-string
+ perl-libwww
+ perl-mail-dkim
+ perl-mail-dmarc
+ perl-mail-spf
+ perl-net-cidr-lite
+ perl-net-dns
+ perl-net-ip
+ perl-net-libidn
+ perl-net-patricia
+ perl-netaddr-ip
+ perl-razor2-client-agent))
+ (home-page "https://metacpan.org/release/Mail-SpamAssassin")
+ (synopsis
+ "Extensible email filter used to identify spam")
+ (description
+ "Apache SpamAssassin is an anti-spam platform giving system
+administrators a filter to classify email and block spam (unsolicited bulk
+email). It uses a robust scoring framework and plug-ins to integrate a wide
+range of advanced heuristic and statistical analysis tests on email headers
+and body text including text analysis, Bayesian filtering, DNS blocklists,
+and collaborative filtering databases.")
+ (license license:asl2.0)))