Index: configure
--- configure.orig	2006-04-05 18:00:01 +0200
+++ configure	2008-02-19 00:08:39 +0100
@@ -7080,9 +7080,6 @@
 
 
 # Check for libmilter and its header files in the usual locations
-if test -d /usr/lib/libmilter ; then
-	LDFLAGS="$LDFLAGS -L/usr/lib/libmilter"
-fi
 
 echo "$as_me:$LINENO: checking for mi_stop in -lmilter" >&5
 echo $ECHO_N "checking for mi_stop in -lmilter... $ECHO_C" >&6
@@ -7369,7 +7366,7 @@
 fi
 
 
-for ac_header in libmilter/mfapi.h
+for ac_header in milter/mfapi.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
Index: spamass-milter.1.in
--- spamass-milter.1.in.orig	2004-03-18 19:37:08 +0100
+++ spamass-milter.1.in	2008-02-19 00:08:39 +0100
@@ -20,6 +20,8 @@
 .Op Fl r Ar nn
 .Op Fl u Ar defaultuser
 .Op Fl x
+.Op Fl a
+.Op Fl c Ar comment
 .Op Fl - Ar spamc flags ...
 .Sh DESCRIPTION
 The
@@ -199,6 +201,11 @@
 Requires the
 .Fl u
 flag.  
+.It Fl a
+Causes spamass-milter to pass through unchecked any messages from connections
+established using SMTP authentication.  This is useful for sites with remote users.
+.It Fl c Ar comment
+Custom delivery status notification (DSN) comment. Default is "Blocked by SpamAssassin".
 .It Fl - Ar spamc flags ...
 Pass all remaining options to spamc. 
 This allows you to connect to a remote spamd with
Index: spamass-milter.cpp
--- spamass-milter.cpp.orig	2006-03-23 22:41:36 +0100
+++ spamass-milter.cpp	2008-02-19 00:08:55 +0100
@@ -100,7 +100,7 @@
 extern "C" {
 #endif
 
-#include "libmilter/mfapi.h"
+#include "milter/mfapi.h"
 //#include "libmilter/mfdef.h"
 
 #if !HAVE_DECL_STRSEP
@@ -170,6 +170,8 @@
 bool flag_full_email = false;		/* pass full email address to spamc */
 bool flag_expand = false;	/* alias/virtusertable expansion */
 bool warnedmacro = false;	/* have we logged that we couldn't fetch a macro? */
+bool auth = false;		/* don't scan authenticated users */
+char *comment = NULL;
 
 #if defined(__FreeBSD__) /* popen bug - see PR bin/50770 */
 static pthread_mutex_t popen_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -181,7 +183,7 @@
 main(int argc, char* argv[])
 {
    int c, err = 0;
-   const char *args = "fd:mMp:P:r:u:D:i:b:B:e:x";
+   const char *args = "fc:d:mMp:P:r:u:D:i:b:B:e:xa";
    char *sock = NULL;
    bool dofork = false;
    char *pidfilename = NULL;
@@ -196,9 +198,15 @@
 	/* Process command line options */
 	while ((c = getopt(argc, argv, args)) != -1) {
 		switch (c) {
+			case 'a':
+				auth = true;
+				break;
 			case 'f':
 				dofork = true;
 				break;
+			case 'c':
+				comment = strdup(optarg);
+				break;
 			case 'd':
 				parse_debuglevel(optarg);
 				break;
@@ -265,6 +273,8 @@
 				break;
 		}
 	}
+    if (!comment)
+		comment = strdup("Blocked by SpamAssassin");
 
    if (flag_full_email && !flag_sniffuser)
    {
@@ -281,7 +291,8 @@
       cout << "SpamAssassin Sendmail Milter Plugin" << endl;
       cout << "Usage: spamass-milter -p socket [-b|-B bucket] [-d xx[,yy...]] [-D host]" << endl;
       cout << "                      [-e defaultdomain] [-f] [-i networks] [-m] [-M]" << endl;
-      cout << "                      [-P pidfile] [-r nn] [-u defaultuser] [-x]" << endl;
+      cout << "                      [-P pidfile] [-r nn] [-u defaultuser] [-x] [-a]" << endl;
+      cout << "                      [-c comment]" << endl;
       cout << "                      [-- spamc args ]" << endl;
       cout << "   -p socket: path to create socket" << endl;
       cout << "   -b bucket: redirect spam to this mail address.  The orignal" << endl;
@@ -302,6 +313,8 @@
       cout << "   -u defaultuser: pass the recipient's username to spamc.\n"
               "          Uses 'defaultuser' if there are multiple recipients." << endl;
       cout << "   -x: pass email address through alias and virtusertable expansion." << endl;
+      cout << "   -a: don't scan messages over an authenticated connection." << endl;
+      cout << "   -c comment: delivery status notification (DSN) comment." << endl;
       cout << "   -- spamc args: pass the remaining flags to spamc." << endl;
               
       exit(EX_USAGE);
@@ -355,6 +368,8 @@
 	debug(D_ALWAYS, "spamass-milter %s exiting", PACKAGE_VERSION);
 	if (pidfilename)
 		unlink(pidfilename);
+    if (comment)
+		free(comment);
 	return err;
 }
 
@@ -452,8 +467,7 @@
 	if (do_reject)
 	{
 		debug(D_MISC, "Rejecting");
-		smfi_setreply(ctx, "550", "5.7.1", "Blocked by SpamAssassin");
-
+		smfi_setreply(ctx, "550", "5.7.1", comment);
 
 		if (flag_bucket)
 		{
@@ -783,6 +797,15 @@
   }
   /* debug(D_ALWAYS, "ZZZ got private context %p", sctx); */
 
+  if (auth) {
+    const char *auth_type = smfi_getsymval(ctx, "{auth_type}");
+
+    if (auth_type) {
+      debug(D_MISC, "auth_type=%s", auth_type);
+      return SMFIS_ACCEPT;
+    }
+  }
+
   debug(D_FUNC, "mlfi_envfrom: enter");
   try {
     // launch new SpamAssassin
