On Fri, 2004-03-12 at 19:35, Matti Aarnio wrote: > > Great! Then I'll send another (smallish) patch soon, it makes the > > message "Ask HELP for contact information" customizable (e.g. you could > > put "See http://mailpolicy.example.com/ or ask HELP for contact info" > > there). > > Ok, that is usefull. See attached. I *think* that I found all relevant places but you better check again... > Anyway, config.h.in should (these days) be generated from > configure.in file's AC_DEFINE() macroes .. and configure.in > does contain SPF stuff (that experienced a bit of my macro editing..) Right, that was me who missed ;-) Eugene
Index: man/smtpserver.8.in =================================================================== RCS file: /cvsroot/zmailer/man/smtpserver.8.in,v retrieving revision 1.64 diff -u -r1.64 smtpserver.8.in --- man/smtpserver.8.in 11 Mar 2004 22:54:01 -0000 1.64 +++ man/smtpserver.8.in 12 Mar 2004 17:19:00 -0000 @@ -479,6 +479,13 @@ This allows full customization of the initial greeting message. For details, see the sample configuration below. .RE +.IP "PARAM contact-pointer-message ...." +.RS +This is a final message for many SMTP rejects. By default, it's value is +.B Ask HELP for our contact information. +You may want to put here, e.g., a pointer to a web page with local policy. +See example in the sample configuration below. +.RE .IP "PARAM help ...." .RS This allows adding locally relevant data into the SMTP protocol @@ -715,6 +722,8 @@ # #PARAM hdr220 %H ZMailer ESMTP-server %V running at Yoyodyne Inc. #PARAM hdr220 %H (NO UCE)(NO UBE) our local time is now %T +# +PARAM contact-pointer-message See http://www.yoyodyne.com/mailpolicy.html # PARAM help ------------------------------------------------------ PARAM help This mail-server is at Yoyodyne Propulsion Inc. Index: proto/smtpserver.conf.in =================================================================== RCS file: /cvsroot/zmailer/proto/smtpserver.conf.in,v retrieving revision 1.50 diff -u -r1.50 smtpserver.conf.in --- proto/smtpserver.conf.in 11 Mar 2004 22:54:01 -0000 1.50 +++ proto/smtpserver.conf.in 12 Mar 2004 17:19:00 -0000 @@ -116,6 +116,10 @@ # "EHLO is to be done blindly, server responses are not to be studied for # any possible 'ESMTP' keyword!" # +# Final message for SMTP rejects. You can put a pointer to your policy +# web page or such things. +#PARAM contact-pointer-message Ask HELP for our contact information. +# #PARAM help ============================================================= #PARAM help This mail-server is at Yoyodyne Propulsion Inc. #PARAM help Our telephone number is: +1-234-567-8900, and Index: smtpserver/cfgread.c =================================================================== RCS file: /cvsroot/zmailer/smtpserver/cfgread.c,v retrieving revision 1.50 diff -u -r1.50 cfgread.c --- smtpserver/cfgread.c 11 Mar 2004 22:54:01 -0000 1.50 +++ smtpserver/cfgread.c 12 Mar 2004 17:19:00 -0000 @@ -165,6 +165,12 @@ SASL_Auth_Mechanisms = strdup(str); return; } + if (cistrcmp(name, "contact-pointer-message") == 0) { + param2 = strchr(str, '\n'); + if (param2) *param2 = 0; + contact_pointer_message = strdup(str); + return; + } /* Do '$' expansions on the string */ dollarexpand((unsigned char *)str, size - (str - str0)); Index: smtpserver/smtpserver.c =================================================================== RCS file: /cvsroot/zmailer/smtpserver/smtpserver.c,v retrieving revision 1.155 diff -u -r1.155 smtpserver.c --- smtpserver/smtpserver.c 21 Nov 2003 00:17:34 -0000 1.155 +++ smtpserver/smtpserver.c 12 Mar 2004 17:19:00 -0000 @@ -272,6 +272,7 @@ int detect_incorrect_tls_use; int force_rcpt_notify_never; +const char *contact_pointer_message="Ask HELP for our contact information."; #define LSOCKTYPE_SMTP 0 #define LSOCKTYPE_SSMTP 1 @@ -1385,7 +1386,8 @@ if (childcnt > MaxParallelConnections) { type(&SS, -450, NULL, "Too many simultaneous connections to this server (%d max %d)", childcnt, MaxParallelConnections); - type(&SS, 450, NULL, "Come again later"); + type(&SS, -450, NULL, "Come again later"); + type(&SS, 450, NULL, contact_pointer_message); typeflush(&SS); MIBMtaEntry->ss.MaxParallelConnections ++; close(0); close(1); close(2); @@ -1400,7 +1402,8 @@ } if (sameipcount > MaxSameIpSource && sameipcount > 1) { type(&SS, -450, NULL, "Too many simultaneous connections from same IP address (%d max %d)", sameipcount, MaxSameIpSource); - type(&SS, 450, NULL, "Come again later"); + type(&SS, -450, NULL, "Come again later"); + type(&SS, 450, NULL, contact_pointer_message); typeflush(&SS); MIBMtaEntry->ss.MaxSameIpSourceCloses ++; close(0); close(1); close(2); @@ -2175,12 +2178,13 @@ SS->myhostname); } type(SS, -550, NULL, "If you feel we mistreat you, do contact us."); - type(SS, 550, NULL, "Ask HELP for our contact information."); + type(SS, 550, NULL, contact_pointer_message); } else if ((maxsameip >= 0) && (SS->sameipcount > maxsameip)) { smtp_tarpit(SS); type(SS, -450, NULL, "%s - Too many simultaneous connections from this IP address (%li of %li)", SS->myhostname, SS->sameipcount, maxsameip); - type(SS, 450, NULL, "Come again later"); + type(SS, -450, NULL, "Come again later"); + type(SS, 450, NULL, contact_pointer_message); MIBMtaEntry->ss.MaxSameIpSourceCloses ++; } else #ifdef USE_TRANSLATION @@ -2392,7 +2396,7 @@ SS->carp->cmd != Quit && SS->carp->cmd != Help) { smtp_tarpit(SS); type(SS, -400, "4.7.0", "Policy database problem, code=%d", policystatus); - type(SS, 400, "4.7.0", "With 'HELP' command you can get our contact information."); + type(SS, 400, "4.7.0", contact_pointer_message); typeflush(SS); zsyslog((LOG_EMERG, "smtpserver policy database problem, code: %d", policystatus)); sleep(20); @@ -2402,7 +2406,7 @@ smtp_tarpit(SS); type(SS, -550, NULL, "You are on our reject-IP-address -list, GO AWAY!"); type(SS, -550, NULL, "If you feel we mistreat you, do contact us."); - type(SS, 550, NULL, "With 'HELP' command you can get out contact information."); + type(SS, 550, NULL, contact_pointer_message); typeflush(SS); continue; } Index: smtpserver/smtpserver.h =================================================================== RCS file: /cvsroot/zmailer/smtpserver/smtpserver.h,v retrieving revision 1.87 diff -u -r1.87 smtpserver.h --- smtpserver/smtpserver.h 11 Mar 2004 22:54:01 -0000 1.87 +++ smtpserver/smtpserver.h 12 Mar 2004 17:19:00 -0000 @@ -415,6 +415,7 @@ extern const char *tls_random_source; extern const char *tls_cipherlist; extern const char *SASL_Auth_Mechanisms; +extern const char *contact_pointer_message; extern int tls_loglevel, tls_enforce_tls, tls_ccert_vd, tls_use_scache; extern int tls_ask_cert, tls_req_cert, tls_scache_timeout; extern int log_rcvd_whoson, log_rcvd_ident, log_rcvd_authuser;
This is a digitally signed message part