summaryrefslogtreecommitdiff
path: root/mail-filter/mapson
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /mail-filter/mapson
reinit the tree, so we can have metadata
Diffstat (limited to 'mail-filter/mapson')
-rw-r--r--mail-filter/mapson/Manifest6
-rw-r--r--mail-filter/mapson/files/mapson-3.3-gcc6.patch287
-rw-r--r--mail-filter/mapson/mapson-3.3.ebuild41
-rw-r--r--mail-filter/mapson/metadata.xml11
4 files changed, 345 insertions, 0 deletions
diff --git a/mail-filter/mapson/Manifest b/mail-filter/mapson/Manifest
new file mode 100644
index 000000000000..78ebca6eda7f
--- /dev/null
+++ b/mail-filter/mapson/Manifest
@@ -0,0 +1,6 @@
+AUX mapson-3.3-gcc6.patch 10368 SHA256 82b78506bec350cbbaaa074329e21c37be1c588861038cf2d7a1d49d47cb6894 SHA512 159e5a3e4b7fafe0b1c12e020c9c37bfefa40218fe2d974a263060eb27b1afebff4215d03a574e6487f36a61fc71f19b1bdc69ce4234095a9bc6a8fdc173f1e7 WHIRLPOOL 75b16b13604c4e11392cb9a7c1e9fc0f3c82d9ddc6435dfbfafdc824b5aef6c3c6ad6ac9cea4473b148e0d46b881ebf848e20e49c5f0c290a590da2bcf0d6db4
+DIST mapson-3.3.tar.gz 421820 SHA256 91e5cb1f39f58c71c182ccbd4fb9b0c2cf323030961ab7283276b14b5cf63850 SHA512 208d3b21d59689465a5c46619a53b3342c3ca96575d681b9ad01b1b6ffa05f05f56ab6e7ae38a8b2161e3f8d42b90b559baf8ff9db4ab4c83238d7adcb645fd0 WHIRLPOOL 66a7cb58f31105fcbb8cfaa63c1ad6ade9f3199f49b7f52e09ef1ac638b0b01c188c5251c14d9268faff6938093e4f0c2815f0c09fe87b0c422f3cb3bbf37286
+EBUILD mapson-3.3.ebuild 903 SHA256 f0a3d97f98562b7454e58a44fae4481302abced24b704cdc25cef1747bc4c5cb SHA512 de34f4ab56b5f89dc70350de3f448bcff1f6d2da10e9d5d83d63fbb253e9a1ed26a8dcd6986024bdc92bf4cde8f8177e6feaa7cfdf8f8d2ec68b5d1fa7bb574a WHIRLPOOL 54b8ca933b3c7af41e3d59564a400938dd520b98bae3aae453332c295fbc89efda51cad9e126c8fb13a37ba9c67204aab521ed91a532ffd006f3fd5f775f5481
+MISC ChangeLog 2423 SHA256 742a1135658135c1d6d6e01a9c546fa491d0476ae57def498c3380ede50e0711 SHA512 a4a11de11f7135a5d67893a03de13ed81fffdaf4dfe0c9cb26ba7f922161195c8ce3ab2bae49be61cc5cf67bea529ae40c923cb5392fd6727795f210445d44aa WHIRLPOOL fa4ec3880bdd5d61f082a8e5abf64a53236a3ae5db49c2dd22a6fe5c6cd7bb540f518f15af4d6c2389920620a6c5059cd7b235bd5f7b5dc0557906249e199105
+MISC ChangeLog-2015 1710 SHA256 e7619638e88bda706021c55785f1540dea40630e95778dfe9713b305c5e9cb52 SHA512 e2fef493a5b21003df373740de0f4caa4898fc82697f7c7a07e05c3ef5aee66c17fc1890158dc2763bcd8dfae079a5fcc7616be32b1256d887b80a9210246855 WHIRLPOOL 08c3cf7048fb7f9a4abd577251d450db9c2fed48af5c9191a8e94befc5f4919e691238dfa9f35224ae01b961f6cf5bc934399ac909a47d49356ddc4b044491e6
+MISC metadata.xml 320 SHA256 36775305af430ea38f7d92486ca2ce39681379d3eb361004b4a4f96b8a05631f SHA512 50c96dab096d9409047fc8c7421bda4899b004b83b09300763acb4df6396d255dcb95bdde850b2c168770718eab093bceecc40db11f95cd37bec7c00a077249a WHIRLPOOL 96fb149fec7d9f30bd86ee47c174868b75a9aaa642f33caed900303a0ea6647901122ec3ec6a5ef6d33fb17fb62db3d88d82218d9dde77df2623b8499be975f0
diff --git a/mail-filter/mapson/files/mapson-3.3-gcc6.patch b/mail-filter/mapson/files/mapson-3.3-gcc6.patch
new file mode 100644
index 000000000000..d43c2cb95ea9
--- /dev/null
+++ b/mail-filter/mapson/files/mapson-3.3-gcc6.patch
@@ -0,0 +1,287 @@
+--- a/accept-confirmation.cpp
++++ b/accept-confirmation.cpp
+@@ -52,7 +52,7 @@
+ for (rc = read(fd, tmp, sizeof(tmp)); rc > 0; rc = read(fd, tmp, sizeof(tmp)))
+ mail.append(tmp, rc);
+ if (rc < 0)
+- throw system_error(string("Failed to read mail file '") + filename + "'");
++ throw mapson_system_error(string("Failed to read mail file '") + filename + "'");
+ deliver(mail);
+ unlink(filename.c_str());
+ }
+--- a/address-db.cpp
++++ b/address-db.cpp
+@@ -26,7 +26,7 @@
+
+ fd = open(filename.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+ if (fd < 0)
+- throw system_error(string("Can't open address db '") +
++ throw mapson_system_error(string("Can't open address db '") +
+ filename + "' for reading");
+ fd_sentry sentry(fd);
+
+@@ -36,7 +36,7 @@
+ lock.l_start = 0;
+ lock.l_len = 0;
+ if (fcntl(fd, F_SETLKW, &lock) != 0)
+- throw system_error(string("Can't lock file '") + filename + "'");
++ throw mapson_system_error(string("Can't lock file '") + filename + "'");
+
+ // Read the file into memory.
+
+@@ -47,7 +47,7 @@
+ rc = read(fd, buffer, sizeof(buffer)))
+ data.append(buffer, rc);
+ if (rc < 0)
+- throw system_error(string("Failed to read address db '") +
++ throw mapson_system_error(string("Failed to read address db '") +
+ filename + "' into memory");
+
+ // Success. Don't close the file descriptor.
+@@ -107,7 +107,7 @@
+ {
+ ssize_t rc = write(fd, data.data()+len, data.size()-len);
+ if (rc < 0)
+- throw system_error(string("Failed writing to the address db '") + filename + "'");
++ throw mapson_system_error(string("Failed writing to the address db '") + filename + "'");
+ else
+ len += rc;
+ }
+--- a/config.cpp
++++ b/config.cpp
+@@ -70,9 +70,9 @@
+ string tmp = string(name) + "=" + value;
+ char* env = strdup(tmp.c_str());
+ if (env == 0)
+- throw system_error("strdup() failed");
++ throw mapson_system_error("strdup() failed");
+ if (putenv(env) != 0)
+- throw system_error("putenv() failed");
++ throw mapson_system_error("putenv() failed");
+ }
+ }
+
+@@ -84,7 +84,7 @@
+
+ pwd_sentry sentry(getpwuid(getuid()));
+ if (sentry.pwd == 0)
+- throw system_error("Can't get my user name");
++ throw mapson_system_error("Can't get my user name");
+ log_file.assign(sentry.pwd->pw_dir).append("/.mapson/log");
+ spool_dir.assign(sentry.pwd->pw_dir).append("/.mapson/spool");
+ address_db.assign(sentry.pwd->pw_dir).append("/.mapson/address-db");
+--- a/deliver.cpp
++++ b/deliver.cpp
+@@ -31,11 +31,11 @@
+
+ FILE* fh = popen(config->mailbox.c_str()+1, "w");
+ if (fh == NULL)
+- throw system_error(string("Can't start delivery pipe '") + config->mailbox + "'");
++ throw mapson_system_error(string("Can't start delivery pipe '") + config->mailbox + "'");
+ int len = fwrite(mail.data(), mail.size(), 1, fh);
+ pclose(fh);
+ if (len != 1)
+- throw system_error(string("Failed to pipe to MTA process '") + config->mailbox + "'");
++ throw mapson_system_error(string("Failed to pipe to MTA process '") + config->mailbox + "'");
+ }
+ else
+ {
+@@ -43,7 +43,7 @@
+
+ int fd = open(config->mailbox.c_str(), O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
+ if (fd < 0)
+- throw system_error(string("Can't open mailbox file '") + config->mailbox + "' for writing");
++ throw mapson_system_error(string("Can't open mailbox file '") + config->mailbox + "' for writing");
+ fd_sentry sentry(fd);
+
+ struct flock lock;
+@@ -52,13 +52,13 @@
+ lock.l_start = 0;
+ lock.l_len = 0;
+ if (fcntl(fd, F_SETLKW, &lock) != 0)
+- throw system_error(string("Can't lock file '") + config->mailbox + "'");
++ throw mapson_system_error(string("Can't lock file '") + config->mailbox + "'");
+
+ for (size_t len = 0; len < mail.size(); )
+ {
+ ssize_t rc = write(fd, mail.data()+len, mail.size()-len);
+ if (rc < 0)
+- throw system_error(string("Failed writing to the mailbox file '") + config->mailbox + "'");
++ throw mapson_system_error(string("Failed writing to the mailbox file '") + config->mailbox + "'");
+ else
+ len += rc;
+ }
+--- a/lines2regex.cpp
++++ b/lines2regex.cpp
+@@ -29,7 +29,7 @@
+ if (errno == ENOENT)
+ return "";
+ else
+- throw system_error(string("Can't open regex db '") +
++ throw mapson_system_error(string("Can't open regex db '") +
+ filename + "' for reading");
+ }
+ fd_sentry sentry(fd);
+@@ -40,7 +40,7 @@
+ lock.l_start = 0;
+ lock.l_len = 0;
+ if (fcntl(fd, F_SETLKW, &lock) != 0)
+- throw system_error(string("Can't lock file '") + filename + "'");
++ throw mapson_system_error(string("Can't lock file '") + filename + "'");
+
+ // Read the file into memory.
+
+@@ -52,7 +52,7 @@
+ rc = read(fd, buffer, sizeof(buffer)))
+ data.append(buffer, rc);
+ if (rc < 0)
+- throw system_error(string("Failed to read regex db '") +
++ throw mapson_system_error(string("Failed to read regex db '") +
+ filename + "' into memory");
+
+ // Walk through the lines and compile the regexes.
+--- a/log.cpp
++++ b/log.cpp
+@@ -30,10 +30,10 @@
+ char buf[64];
+ time_t tstamp = time(0);
+ if (tstamp == static_cast<time_t>(-1))
+- throw system_error("time(2) failed");
++ throw mapson_system_error("time(2) failed");
+ struct tm* tmtime = localtime(&tstamp);
+ if (tmtime == 0)
+- throw system_error("localtime(3) failed");
++ throw mapson_system_error("localtime(3) failed");
+ strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tmtime);
+ return buf;
+ }
+@@ -42,7 +42,7 @@
+ {
+ fileh.file = fopen(file, "a");
+ if (fileh.file == 0)
+- throw system_error(string("Could not open log file ") + file);
++ throw mapson_system_error(string("Could not open log file ") + file);
+
+ struct flock lock;
+ lock.l_type = F_WRLCK;
+@@ -50,7 +50,7 @@
+ lock.l_start = 0;
+ lock.l_len = 0;
+ if (fcntl(fileno(fileh.file), F_SETLKW, &lock) != 0)
+- throw system_error(string("Can't lock file '") + file + "'");
++ throw mapson_system_error(string("Can't lock file '") + file + "'");
+ }
+
+ void _debug(const char* fmt, ...)
+--- a/mapson.cpp
++++ b/mapson.cpp
+@@ -62,7 +62,7 @@
+
+ fd = open(argv[i], O_RDONLY, 0);
+ if (fd < 0)
+- throw system_error("Can't open file for reading");
++ throw mapson_system_error("Can't open file for reading");
+ fd_sentry sentry(fd);
+ string mail;
+ for (rc = read(fd, buffer, sizeof(buffer));
+@@ -72,7 +72,7 @@
+ mail.append(buffer, rc);
+ }
+ if (rc < 0)
+- throw system_error("Failed to read from file");
++ throw mapson_system_error("Failed to read from file");
+
+ // Extract the mail addresses.
+
+@@ -196,7 +196,7 @@
+ mail.append(buffer, rc);
+ }
+ if (rc < 0)
+- throw system_error("Failed to read mail from standard input");
++ throw mapson_system_error("Failed to read mail from standard input");
+
+ // Check whether the mail contains a valid cookie. If it does,
+ // mail will be replaced with the original e-mail, that was
+--- a/parse-config-file.cpp
++++ b/parse-config-file.cpp
+@@ -55,7 +55,7 @@
+
+ std::ifstream file(filename);
+ if (!file)
+- throw system_error(std::string("parse_config_file() failed to open '") + filename + "'");
++ throw mapson_system_error(std::string("parse_config_file() failed to open '") + filename + "'");
+
+ // Now we read line by line and process each one seperately.
+
+--- a/request-confirmation.cpp
++++ b/request-confirmation.cpp
+@@ -157,7 +157,7 @@
+ string filename = config->request_for_confirmation_file;
+ int fd = multi_open(filename, O_RDONLY, S_IRUSR | S_IWUSR);
+ if (fd < 0)
+- throw system_error(string("Can't open request-mail template file '") + filename + "' for reading");
++ throw mapson_system_error(string("Can't open request-mail template file '") + filename + "' for reading");
+ fd_sentry sentry(fd);
+
+ // Read the file into memory.
+@@ -167,7 +167,7 @@
+ for (rc = read(fd, buffer, sizeof(buffer)); rc > 0; rc = read(fd, buffer, sizeof(buffer)))
+ mail_template.append(buffer, rc);
+ if (rc < 0)
+- throw system_error(string("Failed to read request-mail template file '") + filename + "' into memory");
++ throw mapson_system_error(string("Failed to read request-mail template file '") + filename + "' into memory");
+
+ // Expand variables in the template.
+
+@@ -180,11 +180,11 @@
+ debug(("Executing mail transport agent '%s'.", config->mta.c_str()));
+ FILE* fh = popen(config->mta.c_str(), "w");
+ if (fh == NULL)
+- throw system_error(string("Can't start MTA '") + config->mta + "'");
++ throw mapson_system_error(string("Can't start MTA '") + config->mta + "'");
+ if (fwrite(mail_template.data(), mail_template.size(), 1, fh) != 1)
+ {
+ pclose(fh);
+- throw system_error(string("Failed to pipe to MTA process '") + config->mta + "'");
++ throw mapson_system_error(string("Failed to pipe to MTA process '") + config->mta + "'");
+ }
+ pclose(fh);
+ }
+--- a/spool.cpp
++++ b/spool.cpp
+@@ -44,13 +44,13 @@
+ info("Spooling e-mail '%s' as '%s'.", config->message_id.c_str(), filename.c_str());
+ int fd = open(filename.c_str(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ if (fd < 0)
+- throw system_error(string("Can't open spool file '") + filename + "' for writing");
++ throw mapson_system_error(string("Can't open spool file '") + filename + "' for writing");
+ fd_sentry sentry(fd);
+ for (size_t len = 0; len < mail.size(); )
+ {
+ ssize_t rc = write(fd, mail.data()+len, mail.size()-len);
+ if (rc < 0)
+- throw system_error(string("Failed writing to the spool file '") + filename + "'");
++ throw mapson_system_error(string("Failed writing to the spool file '") + filename + "'");
+ else
+ len += rc;
+ }
+--- a/system-error.hpp
++++ b/system-error.hpp
+@@ -23,14 +23,14 @@
+ #include <string>
+ #include <cstring>
+
+-class system_error : public std::runtime_error
++class mapson_system_error : public std::runtime_error
+ {
+ public:
+- system_error() : runtime_error(str())
++ mapson_system_error() : runtime_error(str())
+ {
+ }
+
+- explicit system_error(std::string const & msg)
++ explicit mapson_system_error(std::string const & msg)
+ : runtime_error(msg + ": " + str())
+ {
+ }
diff --git a/mail-filter/mapson/mapson-3.3.ebuild b/mail-filter/mapson/mapson-3.3.ebuild
new file mode 100644
index 000000000000..5c6ce7bac660
--- /dev/null
+++ b/mail-filter/mapson/mapson-3.3.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="A challenge/response-based white-list spam filter"
+HOMEPAGE="http://mapson.sourceforge.net/"
+SRC_URI="mirror://sourceforge/mapson/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="debug"
+
+RDEPEND="virtual/mta"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gcc6.patch
+}
+
+src_configure() {
+ econf $(use_with debug)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS INSTALL NEWS README
+ doman doc/mapson.1
+ dohtml doc/mapson.html
+ dodir /etc/mapson
+ insinto /etc/mapson
+ newins sample-config mapson.config
+ dodir /usr/share/mapson
+ insinto /usr/share/mapson
+ newins sample-challenge-template challenge-template
+ rm -f "${D}"/etc/sample-config
+ rm -f "${D}"/usr/share/{mapson.html,sample-challenge-template}
+}
diff --git a/mail-filter/mapson/metadata.xml b/mail-filter/mapson/metadata.xml
new file mode 100644
index 000000000000..bd18711b8a38
--- /dev/null
+++ b/mail-filter/mapson/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>net-mail@gentoo.org</email>
+ <name>Net-Mail</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">mapson</remote-id>
+ </upstream>
+</pkgmetadata>