Courier does so-called tarpitting on connections that are considered spam. 
That means it keeps the tcp connection open for a while and is meant to eat 
ressources from spammers.

We had the problem on our servers that it was eating too much of our 
ressources. Also I'm unsure if this is generally a useful idea. But others may 
have a different opinion on that, so I think this should be made optional.

See attached patch, adds an option TARPIT to esmtpd config.

-- 
Hanno Böck              Blog:           http://www.hboeck.de/
GPG: 3DBD3B20           Jabber/Mail:    ha...@hboeck.de

http://schokokeks.org - professional webhosting
diff -Naur courier-0.64.0/courier/module.esmtp/courieresmtpd.c courier-0.64.0-1/courier/module.esmtp/courieresmtpd.c
--- courier-0.64.0/courier/module.esmtp/courieresmtpd.c	2009-08-23 12:26:34.000000000 +0200
+++ courier-0.64.0-1/courier/module.esmtp/courieresmtpd.c	2010-01-31 19:46:52.000000000 +0100
@@ -81,10 +81,14 @@
 
 static void tarpit()
 {
-	sleep(teergrube);
-	teergrube *= 2;
-	if (teergrube > MAX_TEERGRUBE)
-		teergrube=MAX_TEERGRUBE;
+	const char *p;
+	if ((p=getenv("TARPIT")) && atoi(p))
+	{
+		sleep(teergrube);
+		teergrube *= 2;
+		if (teergrube > MAX_TEERGRUBE)
+			teergrube=MAX_TEERGRUBE;
+	}
 }
 
 void iov_logerror(const char *q, const char *p)
diff -Naur courier-0.64.0/courier/module.esmtp/esmtpd.dist.in courier-0.64.0-1/courier/module.esmtp/esmtpd.dist.in
--- courier-0.64.0/courier/module.esmtp/esmtpd.dist.in	2009-08-13 00:25:49.000000000 +0200
+++ courier-0.64.0-1/courier/module.esmtp/esmtpd.dist.in	2010-01-31 19:41:17.000000000 +0100
@@ -51,6 +51,12 @@
 
 BOFHNOVRFY=0
 
+##NAME: TARPIT:1
+#
+#  Set TARPIT to 0 to disable tarpitting
+
+TARPIT=1
+
 ##NAME: NOADDMSGID:0
 #
 #  The following environment variables keep Courier from adding
diff -Naur courier-0.64.0/courier/module.esmtp/esmtpd-ssl.dist.in courier-0.64.0-1/courier/module.esmtp/esmtpd-ssl.dist.in
--- courier-0.64.0/courier/module.esmtp/esmtpd-ssl.dist.in	2009-08-13 00:25:49.000000000 +0200
+++ courier-0.64.0-1/courier/module.esmtp/esmtpd-ssl.dist.in	2010-01-31 19:41:49.000000000 +0100
@@ -44,6 +44,12 @@
 
 BOFHNOVRFY=0
 
+##NAME: TARPIT:1
+#
+#  Set TARPIT to 0 to disable tarpitting
+
+TARPIT=1
+
 ##NAME: NOADDMSGID:0
 #
 #  The following environment variables keep Courier from adding

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to