summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mail-mta/nullmailer/ChangeLog12
-rw-r--r--mail-mta/nullmailer/Manifest29
-rw-r--r--mail-mta/nullmailer/files/digest-nullmailer-1.001
-rw-r--r--mail-mta/nullmailer/files/nullmailer-1.00-gcc34-fix.patch24
-rw-r--r--mail-mta/nullmailer/files/nullmailer-1.00-smtp-auth.patch143
-rw-r--r--mail-mta/nullmailer/files/nullmailer-1.00-syslog.patch301
-rw-r--r--mail-mta/nullmailer/files/remotes.sample6
-rw-r--r--mail-mta/nullmailer/nullmailer-1.00.ebuild129
8 files changed, 626 insertions, 19 deletions
diff --git a/mail-mta/nullmailer/ChangeLog b/mail-mta/nullmailer/ChangeLog
index 5a4836ead819..1e820bdb515f 100644
--- a/mail-mta/nullmailer/ChangeLog
+++ b/mail-mta/nullmailer/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for mail-mta/nullmailer
# Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/nullmailer/ChangeLog,v 1.13 2005/03/03 18:40:52 ciaranm Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/nullmailer/ChangeLog,v 1.14 2005/06/02 04:58:37 robbat2 Exp $
+
+*nullmailer-1.00 (02 Jun 2005)
+
+ 02 Jun 2005; Robin H. Johnson <robbat2@gentoo.org>
+ +files/nullmailer-1.00-gcc34-fix.patch,
+ +files/nullmailer-1.00-smtp-auth.patch,
+ +files/nullmailer-1.00-syslog.patch, files/remotes.sample,
+ +nullmailer-1.00.ebuild:
+ Bug #74903 and #83574, bump version, and make nullmailer compile with GCC3.4
+ (including under FreeBSD).
03 Mar 2005; Ciaran McCreesh <ciaranm@gentoo.org>
nullmailer-1.00_rc7-r1.ebuild, nullmailer-1.00_rc7-r2.ebuild,
diff --git a/mail-mta/nullmailer/Manifest b/mail-mta/nullmailer/Manifest
index 220b67ee4bd7..8afa8b6545c9 100644
--- a/mail-mta/nullmailer/Manifest
+++ b/mail-mta/nullmailer/Manifest
@@ -1,24 +1,19 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 a2d095c1c0e8ad7941e2906ab0a890b2 ChangeLog 3742
-MD5 0c0e050ec359f92b6a42c57ebe6b26b8 nullmailer-1.00_rc7-r5.ebuild 4415
MD5 df1b62368f5f626e26eaf4b678948324 nullmailer-1.00_rc7-r2.ebuild 3533
MD5 742c697dfe7b504eaa213fb5b20e7118 nullmailer-1.00_rc7-r4.ebuild 3830
+MD5 c6b65bbbb3a616cb7d477df13339d21d nullmailer-1.00.ebuild 4119
MD5 dd627bf2e85f34c159c4889a3503f70f nullmailer-1.00_rc7-r1.ebuild 3182
-MD5 c422882176b83baa82dc9ee2964f70f4 nullmailer-1.00_rc7.ebuild 3231
+MD5 7713fe393545d72d5ccd8608226f62c1 ChangeLog 4108
MD5 9d0c568ea32cf6b45797c6e7c82b4a67 metadata.xml 280
-MD5 4a2517a7b69e06ec8f1dcc634f1f9f28 files/mailer.conf 1588
-MD5 ccc26a349646e55860dc06066004ce63 files/remotes.sample 301
+MD5 c422882176b83baa82dc9ee2964f70f4 nullmailer-1.00_rc7.ebuild 3231
+MD5 0c0e050ec359f92b6a42c57ebe6b26b8 nullmailer-1.00_rc7-r5.ebuild 4415
+MD5 a8919e8c159a7204d3d17f018d5415ce files/nullmailer-1.00-smtp-auth.patch 3990
MD5 4fbcdae998661648262584be8be8b7df files/digest-nullmailer-1.00_rc7 70
+MD5 4fbcdae998661648262584be8be8b7df files/digest-nullmailer-1.00_rc7-r1 70
MD5 4fbcdae998661648262584be8be8b7df files/digest-nullmailer-1.00_rc7-r2 70
-MD5 639fa6e9d323b500b247ab367596cb29 files/digest-nullmailer-1.00_rc7-r5 143
MD5 4fbcdae998661648262584be8be8b7df files/digest-nullmailer-1.00_rc7-r4 70
-MD5 4fbcdae998661648262584be8be8b7df files/digest-nullmailer-1.00_rc7-r1 70
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.2.6 (GNU/Linux)
-
-iD8DBQFCJ133LLFUmVNQ7rkRAj6tAKCr0MvHcoxsSaqxzytDGNZpwTZPvQCguUO/
-j0lJDhmEkfSP+XuEs2efn40=
-=S0rH
------END PGP SIGNATURE-----
+MD5 639fa6e9d323b500b247ab367596cb29 files/digest-nullmailer-1.00_rc7-r5 143
+MD5 4a2517a7b69e06ec8f1dcc634f1f9f28 files/mailer.conf 1588
+MD5 a01ca848067aabbcb80c249f08c764eb files/nullmailer-1.00-syslog.patch 10047
+MD5 6d7b320c8d40ac0e2b4daca84d975cba files/remotes.sample 444
+MD5 8fec0281a21917aa07f71f32877486d6 files/nullmailer-1.00-gcc34-fix.patch 618
+MD5 c367e5657509b68e227ffa43f954a211 files/digest-nullmailer-1.00 67
diff --git a/mail-mta/nullmailer/files/digest-nullmailer-1.00 b/mail-mta/nullmailer/files/digest-nullmailer-1.00
new file mode 100644
index 000000000000..af23048d4c3a
--- /dev/null
+++ b/mail-mta/nullmailer/files/digest-nullmailer-1.00
@@ -0,0 +1 @@
+MD5 ead32b3543ef652891edf3856ec759dd nullmailer-1.00.tar.gz 170605
diff --git a/mail-mta/nullmailer/files/nullmailer-1.00-gcc34-fix.patch b/mail-mta/nullmailer/files/nullmailer-1.00-gcc34-fix.patch
new file mode 100644
index 000000000000..15aa0e7fb3e3
--- /dev/null
+++ b/mail-mta/nullmailer/files/nullmailer-1.00-gcc34-fix.patch
@@ -0,0 +1,24 @@
+--- lib/fdbuf/fdobuf.h~ Sat Mar 5 01:12:32 2005
++++ lib/fdbuf/fdobuf.h Sat Mar 5 01:12:53 2005
+@@ -17,6 +17,8 @@
+ #ifndef FDBUF__FDOBUF__H__
+ #define FDBUF__FDOBUF__H__
+
++#include <pwd.h>
++
+ class fdobuf : protected fdbuf
+ {
+ public:
+--- lib/list.h~ Sat Mar 5 01:16:28 2005
++++ lib/list.h Sat Mar 5 01:13:35 2005
+@@ -18,8 +18,8 @@
+ typedef list_node<T> node;
+ typedef list_iterator<T> iter;
+ typedef const_list_iterator<T> const_iter;
+- friend class iter;
+- friend class const_iter;
++ friend class list_iterator<T>;;
++ friend class const_list_iterator<T>;;
+
+ list()
+ : head(0), tail(0), cnt(0)
diff --git a/mail-mta/nullmailer/files/nullmailer-1.00-smtp-auth.patch b/mail-mta/nullmailer/files/nullmailer-1.00-smtp-auth.patch
new file mode 100644
index 000000000000..23aa47837114
--- /dev/null
+++ b/mail-mta/nullmailer/files/nullmailer-1.00-smtp-auth.patch
@@ -0,0 +1,143 @@
+--- doc/nullmailer-send.8~ Sat Mar 5 10:13:38 2005
++++ doc/nullmailer-send.8 Sat Mar 5 10:16:51 2005
+@@ -57,10 +57,11 @@
+ The protocol name defaults to
+ .IR smtp ,
+ and may be followed by command-line arguments for that module.
+-For example, to connect to port 2525 on your SMTP smart host, use:
++For example, to connect to port 2525 on your SMTP smart host,
++which also requires SMTP authentication, use:
+
+ .EX
+- smarthost.dom smtp --port=2525
++ smarthost.dom smtp --port=2525 --auth=user,pass
+ .EE
+
+ Blank lines and lines starting with a pound are ignored.
+--- protocols/protocol.cc~ Sat Mar 5 09:38:23 2005
++++ protocols/protocol.cc Sat Mar 5 09:39:42 2005
+@@ -30,10 +30,12 @@
+ const char* cli_help_suffix = "";
+ const char* cli_args_usage = "remote-address < mail-file";
+ const int cli_args_min = 1;
+-const int cli_args_max = 1;
++const int cli_args_max = 2;
+ cli_option cli_options[] = {
+ { 'p', "port", cli_option::integer, 0, &port,
+ "Set the port number on the remote host to connect to", 0 },
++ { 'a', "auth", cli_option::string, 0, &auth,
++ "Set the user and password for authentication (user,pass)", 0 },
+ {0, 0, cli_option::flag, 0, 0, 0, 0}
+ };
+
+--- protocols/protocol.h~ Sat Mar 5 09:40:15 2005
++++ protocols/protocol.h Sat Mar 5 09:40:46 2005
+@@ -8,6 +8,7 @@
+
+ // This must be provided by the protocol, but will be set by the lib.
+ extern int port;
++extern char* auth;
+
+ extern void protocol_prep(fdibuf* in);
+ extern void protocol_send(fdibuf* in, int fd);
+--- protocols/qmqp.cc~ Sat Mar 5 09:40:59 2005
++++ protocols/qmqp.cc Sat Mar 5 09:41:21 2005
+@@ -31,6 +31,7 @@
+ #include "protocol.h"
+
+ int port = 628;
++char* auth = "";
+ const char* cli_program = "qmqp";
+ const char* cli_help_prefix = "Send an emal message via QMQP\n";
+
+--- protocols/smtp.cc~ Sat Mar 5 09:41:31 2005
++++ protocols/smtp.cc Sat Mar 5 09:44:58 2005
+@@ -30,6 +30,7 @@
+ #include "protocol.h"
+
+ int port = 25;
++char* auth = "";
+ const char* cli_program = "smtp";
+ const char* cli_help_prefix = "Send an email message via SMTP\n";
+
+@@ -136,6 +137,11 @@
+ {
+ }
+
++void to64(char* infile, char* outfile);
++void to64(const mystring& infile, mystring& outfile);
++void output64chunk(int c1, int c2, int c3, int pads, char** outfile);
++void output64chunk(int c1, int c2, int c3, int pads, mystring& outfile);
++
+ void protocol_send(fdibuf* in, int fd)
+ {
+ mystring hh = getenv("HELOHOST");
+@@ -143,5 +149,68 @@
+ smtp conn(fd);
+ conn.docmd("", 200);
+ conn.docmd("HELO " + hh, 200);
++
++ if ( strlen(auth) > 0 )
++ {
++ mystring authstr = auth;
++ mystring uname = authstr.left(authstr.find_first(','));
++ mystring pass = authstr.sub(authstr.find_first(',')+1,authstr.length());
++ mystring plain = uname + "\1" + uname + "\1" + pass;
++ mystring encoded = "AUTH PLAIN ";
++ to64(plain,encoded);
++ conn.docmd(encoded,200);
++ }
++
+ conn.send(in);
+ }
++
++static char basis_64[] =
++ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
++
++void to64(const mystring& infile, mystring& outfile)
++{
++ int c1, c2, c3;
++ size_t inpos = 0;
++ while ((c1 = infile[inpos++])) {
++ c2 = infile[inpos++];
++ if (!c2) {
++ output64chunk(c1, 0, 0, 2, outfile);
++ } else {
++ c3 = infile[inpos++];
++ if (!c3) {
++ output64chunk(c1, c2, 0, 1, outfile);
++ } else {
++ output64chunk(c1, c2, c3, 0, outfile);
++ }
++ }
++ }
++}
++
++void output64chunk(int c1, int c2, int c3, int pads, mystring& outfile)
++{
++ if (c1==1) c1 = 0;
++ if (c2==1) c2 = 0;
++ if (c3==1) c3 = 0;
++
++ char out[5];
++ out[0] = basis_64[c1>>2];
++ out[1] = basis_64[((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)];
++ switch (pads)
++ {
++ case 0:
++ out[2] = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)];
++ out[3] = basis_64[c3 & 0x3F];
++ break;
++ case 1:
++ out[2] = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)];
++ out[3] = '=';
++ break;
++ case 2:
++ out[2] = '=';
++ out[3] = '=';
++ break;
++ };
++ out[4] = 0;
++ outfile += out;
++}
++
diff --git a/mail-mta/nullmailer/files/nullmailer-1.00-syslog.patch b/mail-mta/nullmailer/files/nullmailer-1.00-syslog.patch
new file mode 100644
index 000000000000..33a6cdfb79cb
--- /dev/null
+++ b/mail-mta/nullmailer/files/nullmailer-1.00-syslog.patch
@@ -0,0 +1,301 @@
+diff -NuarwbB nullmailer-1.00.orig/doc/nullmailer-send.8 nullmailer-1.00/doc/nullmailer-send.8
+--- nullmailer-1.00.orig/doc/nullmailer-send.8 2005-06-01 20:47:27.000000000 -0700
++++ nullmailer-1.00/doc/nullmailer-send.8 2005-06-01 20:47:59.000000000 -0700
+@@ -3,6 +3,7 @@
+ nullmailer-send \- Send queued messages
+ .SH SYNOPSIS
+ .B nullmailer-send
++.RB [ \-\-daemon ]\ [ \-\-syslog ]
+ .SH DESCRIPTION
+ This program is responsible for coordinating the transmission of
+ messages that have been queued by
+@@ -37,6 +38,15 @@
+ sleeps for a number of seconds specified by
+ .B pausetime
+ before retrying sending the contents of the queue.
++.SH OPTIONS
++.TP
++.BR \-d ,\ \-\-daemon
++Fork into the background, implies --syslog.
++.TP
++.BR \-s ,\ \-\-syslog
++Use syslog for error and log messages.
++With --daemon, syslog will be used exclusively, without --daemon,
++syslog will be used additionally.
+ .SH CONTROL FILES
+ All the control files are reread each time the queue is run.
+ .TP
+diff -NuarwbB nullmailer-1.00.orig/protocols/protocol.cc nullmailer-1.00/protocols/protocol.cc
+--- nullmailer-1.00.orig/protocols/protocol.cc 2005-06-01 20:47:27.000000000 -0700
++++ nullmailer-1.00/protocols/protocol.cc 2005-06-01 20:52:54.000000000 -0700
+@@ -22,11 +22,15 @@
+ #include <config.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <sys/syslog.h>
+ #include "connect.h"
+ #include "errcodes.h"
+ #include "protocol.h"
+ #include "cli++.h"
+
++static int use_syslog = 0;
++static int daemonize = 0;
++
+ const char* cli_help_suffix = "";
+ const char* cli_args_usage = "remote-address < mail-file";
+ const int cli_args_min = 1;
+@@ -36,23 +40,35 @@
+ "Set the port number on the remote host to connect to", 0 },
+ { 'a', "auth", cli_option::string, 0, &auth,
+ "Set the user and password for authentication (user,pass)", 0 },
++ { 'd', "daemon", cli_option::flag, 1, &daemonize, "use syslog exclusively ", 0 },
++ { 's', "syslog", cli_option::flag, 1, &use_syslog, "use syslog additionally", 0 },
+ {0, 0, cli_option::flag, 0, 0, 0, 0}
+ };
+
+ void protocol_fail(int e, const char* msg)
+ {
++ if (use_syslog)
++ syslog(LOG_ERR, "%s: Failed: %s", cli_program, msg);
++ if (!daemonize)
+ ferr << cli_program << ": Failed: " << msg << endl;
+ exit(e);
+ }
+
+ void protocol_succ(const char* msg)
+ {
++ if (use_syslog)
++ syslog(LOG_ERR, "%s: Succeeded: %s", cli_program, msg);
++ if (!daemonize)
+ ferr << cli_program << ": Succeeded: " << msg << endl;
+ exit(0);
+ }
+
+ int cli_main(int, char* argv[])
+ {
++ if (daemonize)
++ use_syslog = 1;
++ if (use_syslog)
++ openlog("nullmailer", LOG_CONS | LOG_PID, LOG_MAIL);
+ const char* remote = argv[0];
+ fdibuf in(0, true);
+ protocol_prep(&in);
+diff -NuarwbB nullmailer-1.00.orig/src/Makefile.in nullmailer-1.00/src/Makefile.in
+--- nullmailer-1.00.orig/src/Makefile.in 2005-02-28 09:39:50.000000000 -0800
++++ nullmailer-1.00/src/Makefile.in 2005-06-01 20:51:15.000000000 -0700
+@@ -65,7 +65,7 @@
+ nullmailer_queue_DEPENDENCIES = ../lib/libnullmailer.a
+ am_nullmailer_send_OBJECTS = send.$(OBJEXT)
+ nullmailer_send_OBJECTS = $(am_nullmailer_send_OBJECTS)
+-nullmailer_send_DEPENDENCIES = ../lib/libnullmailer.a
++nullmailer_send_DEPENDENCIES = ../lib/cli++/libcli++.a ../lib/libnullmailer.a
+ am_sendmail_OBJECTS = sendmail.$(OBJEXT)
+ sendmail_OBJECTS = $(am_sendmail_OBJECTS)
+ sendmail_DEPENDENCIES = ../lib/cli++/libcli++.a ../lib/libnullmailer.a
+@@ -173,13 +173,13 @@
+ #noinst_PROGRAMS = address
+ INCLUDES = -I../lib -I../lib/cli++
+ mailq_SOURCES = mailq.cc
+-mailq_LDADD = ../lib/libnullmailer.a
++mailq_LDADD = ../lib/cli++/libcli++.a ../lib/libnullmailer.a
+ nullmailer_inject_SOURCES = inject.cc
+ nullmailer_inject_LDADD = ../lib/cli++/libcli++.a ../lib/libnullmailer.a
+ nullmailer_queue_SOURCES = queue.cc
+ nullmailer_queue_LDADD = ../lib/libnullmailer.a
+ nullmailer_send_SOURCES = send.cc
+-nullmailer_send_LDADD = ../lib/libnullmailer.a
++nullmailer_send_LDADD = ../lib/cli++/libcli++.a ../lib/libnullmailer.a
+ sendmail_SOURCES = sendmail.cc
+ sendmail_LDADD = ../lib/cli++/libcli++.a ../lib/libnullmailer.a
+ all: all-am
+diff -NuarwbB nullmailer-1.00.orig/src/send.cc nullmailer-1.00/src/send.cc
+--- nullmailer-1.00.orig/src/send.cc 2005-02-28 09:48:54.000000000 -0800
++++ nullmailer-1.00/src/send.cc 2005-06-01 20:47:59.000000000 -0700
+@@ -27,6 +27,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/stat.h>
++#include <sys/syslog.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <unistd.h>
+@@ -38,11 +39,27 @@
+ #include "hostname.h"
+ #include "itoa.h"
+ #include "list.h"
++#include "cli++/cli++.h"
+
+ typedef list<mystring> slist;
+
+-#define fail(MSG) do { ferr << MSG << endl; return false; } while(0)
+-#define fail_sys(MSG) do{ ferr << MSG << strerror(errno) << endl; return false; }while(0)
++static int use_syslog = 0;
++static int daemonize = 0;
++
++const char* cli_program = "nullmailer-send";
++const char* cli_help_prefix = "nullmailer daemon\n";
++const char* cli_help_suffix = "";
++const char* cli_args_usage = "";
++const int cli_args_min = 0;
++const int cli_args_max = 0;
++cli_option cli_options[] = {
++ { 'd', "daemon", cli_option::flag, 1, &daemonize, "daemonize , implies --syslog", 0 },
++ { 's', "syslog", cli_option::flag, 1, &use_syslog, "use syslog", 0 },
++ { 0, 0, cli_option::flag, 0, 0, 0, 0 }
++};
++
++#define fail(MSG) do { if (use_syslog) syslog(LOG_ERR, "%s", MSG); if (!daemonize) ferr << MSG << endl; return false; } while (0)
++#define fail_sys(MSG) do { if (use_syslog) syslog(LOG_ERR, "%s %s", MSG, strerror(errno)); if (!daemonize) ferr << MSG << strerror(errno) << endl; return false; } while (0)
+
+ struct remote
+ {
+@@ -141,6 +158,9 @@
+ bool load_files()
+ {
+ reload_files = false;
++ if (use_syslog)
++ syslog(LOG_INFO, "Rescanning queue.");
++ if (!daemonize)
+ fout << "Rescanning queue." << endl;
+ DIR* dir = opendir(".");
+ if(!dir)
+@@ -159,12 +179,19 @@
+
+ void exec_protocol(int fd, remote& remote)
+ {
+- if(close(0) == -1 || dup2(fd, 0) == -1 || close(fd) == -1)
++ if (!daemonize && close(STDIN_FILENO) < 0)
++ return;
++ if (fd != STDIN_FILENO)
++ if (dup2(fd, STDIN_FILENO) < 0 || close(fd) < 0)
+ return;
+ mystring program = PROTOCOL_DIR + remote.proto;
+- const char* args[3+remote.options.count()];
++ const char* args[5+remote.options.count()];
+ unsigned i = 0;
+ args[i++] = program.c_str();
++ if (daemonize)
++ args[i++] = "-d";
++ if (use_syslog)
++ args[i++] = "-s";
+ for(slist::const_iter opt(remote.options); opt; opt++)
+ args[i++] = strdup((*opt).c_str());
+ args[i++] = remote.host.c_str();
+@@ -173,8 +200,8 @@
+ }
+
+ #undef fail
+-#define fail(MSG) do { fout << MSG << endl; return false; } while(0)
+-#define fail2(MSG1,MSG2) do{ fout << MSG1 << MSG2 << endl; return false; }while(0)
++#define fail(MSG) do { if (use_syslog) syslog(LOG_ERR, "%s", MSG); if (!daemonize) fout << MSG << endl; return false; } while (0)
++#define fail2(MSG1,MSG2) do { if (use_syslog) syslog(LOG_ERR, "%s %s", MSG1, MSG2); if (!daemonize) fout << MSG1 << MSG2 << endl; return false; } while (0)
+
+ bool catchsender(pid_t pid)
+ {
+@@ -187,6 +214,9 @@
+ if(status)
+ fail2("Sending failed: ", errorstr[status]);
+ else {
++ if (use_syslog)
++ syslog(LOG_INFO, "Sent file.");
++ if (!daemonize)
+ fout << "Sent file." << endl;
+ return true;
+ }
+@@ -200,9 +230,16 @@
+ {
+ int fd = open(filename.c_str(), O_RDONLY);
+ if(fd == -1) {
++ if (use_syslog)
++ syslog(LOG_ERR, "Can't open file '%s'", filename.c_str());
++ if (!daemonize)
+ fout << "Can't open file '" << filename << "'" << endl;
+ return false;
+ }
++ if (use_syslog)
++ syslog(LOG_INFO, "Starting delivery: protocol: %s host: %s file: %s",
++ remote.proto.c_str(), remote.host.c_str(), filename.c_str());
++ if (!daemonize)
+ fout << "Starting delivery: protocol: " << remote.proto
+ << " host: " << remote.host
+ << " file: " << filename << endl;
+@@ -231,6 +268,9 @@
+ fail("No remote hosts listed for delivery");
+ if(files.count() == 0)
+ return true;
++ if (use_syslog)
++ syslog(LOG_INFO, "Starting delivery, %d message(s) in queue.", files.count());
++ if (!daemonize)
+ fout << "Starting delivery, "
+ << itoa(files.count()) << " message(s) in queue." << endl;
+ for(rlist::iter remote(remotes); remote; remote++) {
+@@ -242,6 +282,9 @@
+ file++;
+ }
+ }
++ if (use_syslog)
++ syslog(LOG_INFO, "Delivery complete, %d message(s) remain.", files.count());
++ if (!daemonize)
+ fout << "Delivery complete, "
+ << itoa(files.count()) << " message(s) remain." << endl;
+ return true;
+@@ -287,6 +330,9 @@
+ int s = select(trigger+1, &readfds, 0, 0,
+ (files.count() == 0) ? 0 : &timeout);
+ if(s == 1) {
++ if (use_syslog)
++ syslog(LOG_INFO, "Trigger pulled.");
++ if (!daemonize)
+ fout << "Trigger pulled." << endl;
+ read_trigger();
+ reload_files = true;
+@@ -300,21 +346,46 @@
+ return true;
+ }
+
+-int main(int, char*[])
++int cli_main(int, char*[])
+ {
+ mystring hh;
++ pid_t pid;
++
++ if (daemonize)
++ use_syslog = 1;
++ if (use_syslog)
++ openlog("nullmailer", LOG_CONS | LOG_PID, LOG_MAIL);
+
+ read_hostnames();
+ if (!config_read("helohost", hh)) hh = me;
+ setenv("HELOHOST", hh.c_str(), 1);
+
+- if(!open_trigger())
++ if(!open_trigger()) {
++ if (use_syslog)
++ syslog(LOG_CRIT, "Could not open trigger.");
++ if (!daemonize)
++ ferr << "Could not open trigger." << endl;
+ return 1;
++ }
+ if(chdir(QUEUE_MSG_DIR) == -1) {
+- fout << "Could not chdir to queue message directory." << endl;
++ if (use_syslog)
++ syslog(LOG_CRIT, "Could not chdir to queue message directory.");
++ if (!daemonize)
++ ferr << "Could not chdir to queue message directory." << endl;
+ return 1;
+ }
+
++ if (daemonize) {
++ if ((pid = fork()) < 0) {
++ syslog(LOG_CRIT, "Could not fork.");
++ return 1;
++ }
++ if (pid)
++ return 0;
++ close(STDIN_FILENO);
++ close(STDOUT_FILENO);
++ close(STDERR_FILENO);
++ }
+ signal(SIGALRM, catch_alrm);
+ signal(SIGHUP, SIG_IGN);
+ load_config();
diff --git a/mail-mta/nullmailer/files/remotes.sample b/mail-mta/nullmailer/files/remotes.sample
index cf4bd7c59d90..ebcf5dc2cbe1 100644
--- a/mail-mta/nullmailer/files/remotes.sample
+++ b/mail-mta/nullmailer/files/remotes.sample
@@ -1,6 +1,7 @@
-# Format is: HOST PROTOCOL
+# Format is: HOST PROTOCOL [OPTIONS]
# HOST = IP or DNS
# PROTOCOL = smtp | qmtp
+# OPTIONS = [--port=NUMBER] [--auth=user,pass]
#
# Examples:
# A standard SMTP server:
@@ -11,3 +12,6 @@
#
# A nonstandard SMTP server setup:
# someotherserver.domain.com smtp --port=2525
+#
+# As of 1.00, nullmailer also supports SMTP AUTH
+# mailserver smtp --auth=user,pass
diff --git a/mail-mta/nullmailer/nullmailer-1.00.ebuild b/mail-mta/nullmailer/nullmailer-1.00.ebuild
new file mode 100644
index 000000000000..97fed7ab1938
--- /dev/null
+++ b/mail-mta/nullmailer/nullmailer-1.00.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/nullmailer/nullmailer-1.00.ebuild,v 1.1 2005/06/02 04:58:37 robbat2 Exp $
+
+inherit eutils flag-o-matic
+
+MY_P="${P/_rc/RC}"
+S=${WORKDIR}/${MY_P}
+DESCRIPTION="Simple relay-only local mail transport agent"
+SRC_URI="http://untroubled.org/${PN}/${MY_P}.tar.gz"
+HOMEPAGE="http://untroubled.org/${PN}/"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~x86 ~ppc"
+IUSE="mailwrapper"
+
+DEPEND="virtual/libc
+ sys-apps/groff"
+RDEPEND="!mailwrapper? ( !virtual/mta )
+ mailwrapper? ( >=net-mail/mailwrapper-0.2 )
+ virtual/libc
+ >=sys-process/supervise-scripts-3.2
+ >=sys-process/daemontools-0.76-r1
+ sys-apps/shadow"
+PROVIDE="virtual/mta"
+
+NULLMAILER_GROUP_NAME=nullmail
+NULLMAILER_GROUP_GID=88
+NULLMAILER_USER_NAME=nullmail
+NULLMAILER_USER_UID=88
+NULLMAILER_USER_SHELL=/bin/false
+NULLMAILER_USER_GROUPS=nullmail
+NULLMAILER_USER_HOME=/var/nullmailer
+
+setupuser() {
+ enewgroup ${NULLMAILER_GROUP_NAME} ${NULLMAILER_GROUP_GID}
+ enewuser ${NULLMAILER_USER_NAME} ${NULLMAILER_USER_UID} ${NULLMAILER_USER_SHELL} ${NULLMAILER_USER_HOME} ${NULLMAILER_USER_GROUPS}
+}
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+ EPATCH_OPTS="-d ${S} -p0" \
+ epatch "${FILESDIR}/${P}-smtp-auth.patch" || die "SMTP auth patch failed"
+ EPATCH_OPTS="-d ${S} -p1" \
+ epatch "${FILESDIR}/${P}-syslog.patch" || die "syslog patch failed"
+ EPATCH_OPTS="-d ${S} -p0" \
+ epatch "${FILESDIR}/${P}-gcc34-fix.patch" || die "GCC-3.4 patch failed"
+}
+
+
+pkg_setup() {
+ setupuser
+}
+
+src_compile() {
+ append-ldflags -Wl,-z,now
+ # Note that we pass a different directory below due to bugs in the makefile!
+ econf --localstatedir=/var || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install () {
+ einstall localstatedir=${D}/var/nullmailer || die "einstall failed"
+ if use mailwrapper; then
+ mv ${D}/usr/sbin/sendmail ${D}/usr/sbin/sendmail.nullmailer
+ mv ${D}/usr/bin/mailq ${D}/usr/bin/mailq.nullmailer
+ dosym /usr/sbin/sendmail /usr/bin/mailq
+ insinto /etc/mail
+ doins ${FILESDIR}/mailer.conf
+ fi
+ dodoc AUTHORS BUGS COPYING HOWTO INSTALL NEWS README YEAR2000 TODO ChangeLog
+ # A small bit of sample config
+ dodir /etc/nullmailer
+ insinto /etc/nullmailer
+ newins ${FILESDIR}/remotes.sample remotes
+ # daemontools stuff
+ dodir /var/nullmailer/service{,/log}
+ insinto /var/nullmailer/service
+ newins scripts/nullmailer.run run
+ fperms 700 /var/nullmailer/service/run
+ insinto /var/nullmailer/service/log
+ newins scripts/nullmailer-log.run run
+ fperms 700 /var/nullmailer/service/log/run
+ # usablity
+ dodir /usr/lib
+ dosym /usr/sbin/sendmail usr/lib/sendmail
+ # permissions stuff
+ keepdir /var/log/nullmailer /var/nullmailer/{tmp,queue}
+ fperms 770 /var/log/nullmailer /var/nullmailer/{tmp,queue}
+ fowners nullmail:nullmail /usr/sbin/nullmailer-queue /usr/bin/mailq
+ fperms 4711 /usr/sbin/nullmailer-queue /usr/bin/mailq
+ fowners nullmail:nullmail /var/log/nullmailer /var/nullmailer/{tmp,queue,trigger}
+ fperms 660 /var/nullmailer/trigger
+ msg_mailerconf
+}
+
+pkg_config() {
+ [ ! -s /etc/nullmailer/me ] && /bin/hostname --fqdn >/etc/nullmailer/me
+ [ ! -s /etc/nullmailer/defaultdomain ] && /bin/hostname --domain >/etc/nullmailer/defaultdomain
+ msg_svscan
+ msg_mailerconf
+}
+
+msg_svscan() {
+ einfo "To start nullmailer at boot you have to enable the /etc/init.d/svscan rc file"
+ einfo "and create the following link :"
+ einfo "ln -fs /var/nullmailer/service /service/nullmailer"
+}
+msg_mailerconf() {
+ use mailwrapper && \
+ ewarn "Please ensure you have selected nullmailer in your /etc/mailer.conf"
+}
+
+pkg_postinst() {
+ setupuser
+ # Do this again for good measure
+ [ ! -e /var/nullmailer/trigger ] && mkfifo /var/nullmailer/trigger
+ chown nullmail:nullmail /var/log/nullmailer /var/nullmailer/{tmp,queue,trigger}
+ chmod 770 /var/log/nullmailer /var/nullmailer/{tmp,queue}
+ chmod 660 /var/nullmailer/trigger
+
+ TMP_P="${PN}-${PV}"
+ [ "${PR}" != "r0" ] && TMP_P="${TMP_P}-${PR}"
+ einfo "To create an initial setup, please do:"
+ einfo "ebuild /var/db/pkg/${CATEGORY}/${TMP_P}/${TMP_P}.ebuild config"
+ msg_svscan
+ msg_mailerconf
+}