$NetBSD: patch-ag,v 1.1 2009/03/16 18:13:34 adrianp Exp $

Add a custom configuration option in dspam.conf of "StripRcptDomain" which,
if selected, strips the RCPT TO domain from email processed through DSPAM.

--- src/daemon.c.orig	2006-08-03 18:27:00.000000000 +0100
+++ src/daemon.c	2006-08-03 19:29:22.000000000 +0100
@@ -571,6 +571,15 @@
           goto GETCMD;
         }
 
+	/* Chop of @.* from the recipient */
+	if (_ds_match_attribute(agent_config, "StripRcptDomain", "on")) {
+	  strtok(username, "@");
+	  if (username[0] == 0 || username[0] == '-') { 
+	    daemon_reply(TTX, LMTP_BAD_CMD, "5.1.2", ERR_LMTP_BAD_RCPT);
+	    goto GETCMD;
+	  }
+	}
+
         if (_ds_match_attribute(agent_config, "Broken", "case"))
           lc(username, username);
 
