Hi,
the maildrop 1.6.0 ChangeLog claims that maildrop now exits with
EX_NOUSER for virtual users. This may or may not be the case, but
maildrop still doesn't work properly for local users, such as
$ maildrop -d nonexistent </dev/null ; echo $?
75
I have updated the patch so maildrop REALLY exits with EX_NOUSER (rather
than the EX_TEMPFAIL that Maildrop::trap stomps over this errexit that
isn't used), find it attached and for download at
http://mandree.home.pages.de/postfix/fix-maildrop-NO_USER-1.6.0+.diff
The patch is useful when maildrop is f. i. used as a Postfix transport
(from master.cf) rather than a mailbox_command (from main.cf). Postfix
is capable of rejecting unknown users at the SMTP port, but not at QMQP
ports nor for sendmail injection.
--
Matthias Andree
Encrypt your mail: my GnuPG key ID is 0x052E7D95
diff -Nur --exclude 'rfc*.h' --exclude '*.spec' --exclude '*.html'
maildrop-1.6.0/maildrop/maildrop.C maildrop-1.6.0-ma/maildrop/maildrop.C
--- maildrop-1.6.0/maildrop/maildrop.C 2000-12-31 07:04:00.000000000 +0100
+++ maildrop-1.6.0-ma/maildrop/maildrop.C 2003-09-06 21:58:17.000000000 +0200
@@ -74,6 +74,15 @@
cleanup();
return (r);
}
+ catch (Except e)
+ {
+ merr << argv[0] << ": " << e.string << "\n";
+#if SYSLOG_LOGGING
+ syslog(LOG_INFO, e.string);
+#endif
+ cleanup();
+ return (e.exit_code);
+ }
catch (const char *p)
{
merr << argv[0] << ": " << p << "\n";
diff -Nur --exclude 'rfc*.h' --exclude '*.spec' --exclude '*.html'
maildrop-1.6.0/maildrop/maildrop.h maildrop-1.6.0-ma/maildrop/maildrop.h
--- maildrop-1.6.0/maildrop/maildrop.h 1999-09-10 04:10:05.000000000 +0200
+++ maildrop-1.6.0-ma/maildrop/maildrop.h 2003-09-06 21:58:17.000000000 +0200
@@ -16,6 +16,13 @@
#include "mio.h"
#include "config.h"
+class Except {
+public:
+ int exit_code;
+ const char *string;
+ Except(int ex, const char *s) { exit_code = ex; string = s; }
+};
+
class Maildrop {
public:
int verbose_level; // Current verbose level
diff -Nur --exclude 'rfc*.h' --exclude '*.spec' --exclude '*.html'
maildrop-1.6.0/maildrop/main.C maildrop-1.6.0-ma/maildrop/main.C
--- maildrop-1.6.0/maildrop/main.C 2003-08-09 23:16:10.000000000 +0200
+++ maildrop-1.6.0-ma/maildrop/main.C 2003-09-06 21:58:57.000000000 +0200
@@ -92,7 +92,7 @@
static void nouser()
{
errexit=EX_NOUSER;
- throw "Invalid user specified.";
+ throw Except(errexit, "Invalid user specified.");
}
static void nochangeuidgid()