Hi Sam,
Here's a patch that allows Courier to handle wildcard DNS. The problem came down to the config_islocal function not checking for ".domain.com" entries while the esmtp module was; meaning that the mail server would accept messages for anything.domain.com but not treat them as local (hence redelivery on esmtp and "MX loops to myself" error).
This change allows for users to add ".domain.com" entries in the hosteddomains file. Given a hostname "some.funky.domain.com", this patch adds checks for ".funky.domain.com", ".domain.com", and ".com", in that order. Are you willing to add this into the main branch?
best, Jeff
---------------------------------
Index: ChangeLog
===================================================================
--- ChangeLog Tue Nov 18 18:21:39 2003
+++ ChangeLog Fri Nov 21 17:07:14 2003
@@ -1,2 +1,7 @@
+2003-11-21 Jeff Potter <[EMAIL PROTECTED]>
+
+ * courier/libs/islocal.c: Added .domain.com checks so that hosteddomain
+ entries can support wildcard DNS.
+
2003-11-18 Tim Rice <[EMAIL PROTECTED]>
Index: courier/libs/islocal.c
===================================================================
--- courier/libs/islocal.c Tue Jan 16 01:01:47 2001
+++ courier/libs/islocal.c Fri Nov 21 16:51:03 2003
@@ -79,6 +79,9 @@
*v=tolower((int)(unsigned char)*v);- v=dbobj_fetch(&db, k, kl, &vl, "");
- free(k);
+ char *lcaddress = k;
+ while ((v=dbobj_fetch(&db, k, kl, &vl, "")) == NULL && (k = strchr(k+1,'.')) != NULL)
+ kl = strlen(k);
+ address += k-lcaddress;
+ free(lcaddress);
if (!v) return (0);
---------------------------------
wildcard-dns.patch
Description: Binary data
