This patch drops the connection on non-resolvable helo with
501 Helo rejected: resolvable hostname required.
Its quite simple (too simple to be integrated into courier...),
but keeps the constantly hammering Sobig off the server for now.
I am planning to move the reject after the MAIL FROM which would
allow to exclude authenticated users but have no time for testing.
BOFHCHECKHELO=1 required in etc/esmtpd
+++ courier/module.esmtp/courieresmtpd.c Wed Aug 27 20:37:40 2003
@@ -38,6 +38,14 @@
#include "numlib/numlib.h"
#include "tcpd/spipe.h"
#include "tcpd/tlsclient.h"
+
+// PATCH: BOFHCHECKDNS: requires rfc1035* and prototype
+#include "rfc1035/rfc1035.h"
+#include "rfc1035/rfc1035mxlist.h"
+static int bofh(const char *bofh);
+
static const char rcsid[]="$Id: courieresmtpd.c,v 1.40 2003/06/30 03:51:44
mrsam Exp $";
static char helobuf[256];
@@ -132,9 +140,23 @@
"250 DSN\r\n";
const char *me=config_me();
+// PATCH: BOFHCHECKHELO
+struct rfc1035_mxlist *mxlist;
+
helobuf[0]=0;
strncat(helobuf, heloname, sizeof(helobuf)-1);
+// PATCH: BOFHCHECKHELO, http://cie.bilkent.edu.tr/RFC/1123/90.htm
+// todo: verify address pointer for unresolved hosts
+if (bofh("BOFHCHECKHELO"))
+{
+ if(rfc1035_mxlist_create(&rfc1035_default_resolver, helobuf, &mxlist)
== RFC1035_MX_HARDERR)
+ {
+ addiovec_error(NULL, "501 Helo rejected: resolvable hostname
required.");
+ exit(1);
+ }
+}
+
if (!extended)
{
addiovec("250 ", 4);
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users