This patch adds a new option to couriermlm: NODSN=flag.
If flag is "1" couriermlm will use a Delivery Status Notification setting
of "never" when it sends confirmation requests and help messages: this
should reduce the amount of useless failure notifications generated when
couriermlm dutifully replies to spam received by the mailing list
administrative addresses, i.e. -(un)subscribe and -help.
If flag is "0" (the default), a DSN setting of "fail" will be used. This is
what couriermlm does currently.
The patch is against courier 0.53.3 as packaged by Debian; it should apply
cleanly to the original sources. I hope you'll find it useful. I've been
using it in production for a few months now and I can tell you it's a
pleasure to stop getting a few bogus DSNs in your inbox every day.
--
Flavio Stanchina
Informatica e Servizi
Trento - Italy
diff --git a/courier/cmlm3.C b/courier/cmlm3.C
index 65336dd..ca6ad7c 100644
--- a/courier/cmlm3.C
+++ b/courier/cmlm3.C
@@ -442,9 +442,10 @@ pid_t p2;
//
// Run sendmail with the -bcc flag, requesting only FAIL notices.
+// If 'nodsn' is set, request no delivery status notices at all.
//
-int sendmail_bcc(pid_t &p, const char *from)
+int sendmail_bcc(pid_t &p, const char *from, int nodsn)
{
const char *argvec[7];
@@ -453,7 +454,7 @@ const char *argvec[7];
argvec[2]="-f";
argvec[3]=from;
argvec[4]="-N";
- argvec[5]="fail";
+ argvec[5]=nodsn?"never":"fail";
argvec[6]=0;
return (sendmail(argvec, p));
}
diff --git a/courier/cmlm.C b/courier/cmlm.C
index 0ad9904..9d85296 100644
--- a/courier/cmlm.C
+++ b/courier/cmlm.C
@@ -1052,7 +1052,8 @@ struct stat sb;
close(open(vaddr, O_RDWR|O_CREAT, 0755));
CString owner=get_verp_return("owner", 0);
-afxopipestream ack(sendmail_bcc(p, owner));
+int nodsn= (cmdget("NODSN") == "1");
+afxopipestream ack(sendmail_bcc(p, owner, nodsn));
ack << "From: " << myname() << " <" << owner << ">" << endl
<< "To: " << addr << endl
diff --git a/courier/cmlm.h b/courier/cmlm.h
index 4746a8d..df2d43a 100644
--- a/courier/cmlm.h
+++ b/courier/cmlm.h
@@ -137,7 +137,7 @@ void addrlower(char *);
int isfound(const char *, size_t);
int sendmail(const char **, pid_t &);
int wait4sendmail(pid_t);
-int sendmail_bcc(pid_t &, const char *);
+int sendmail_bcc(pid_t &, const char *, int nodsn = 0);
int goodconfirm(CString);
diff --git a/courier/cmlmsubunsubmsg.C b/courier/cmlmsubunsubmsg.C
index f9cc576..8e3c06d 100644
--- a/courier/cmlmsubunsubmsg.C
+++ b/courier/cmlmsubunsubmsg.C
@@ -330,7 +330,8 @@ CString buf;
}
pid_t p;
-afxopipestream ack(sendmail_bcc(p, owner));
+int nodsn= (cmdget("NODSN") == "1");
+afxopipestream ack(sendmail_bcc(p, owner, nodsn));
ack << "Bcc: " << sendto << endl;
diff --git a/courier/doc/couriermlm.1.in b/courier/doc/couriermlm.1.in
index 482e495..3cc2d45 100644
--- a/courier/doc/couriermlm.1.in
+++ b/courier/doc/couriermlm.1.in
@@ -490,6 +490,16 @@ not attempt to block misdirected subscri
to the mailing list's posting address. If flag is "1" (the default), those
kinds of messages will be bounced appropriately.
.TP
+\fBNODSN=\fIflag\fB\fR
+If flag is "1" \fBcouriermlm\fR will
+use a Delivery Status Notification setting of "never"
+when it sends confirmation requests and help messages:
+this should reduce the amount of useless failure notifications generated
+when \fBcouriermlm\fR dutifully replies to spam received by the mailing
+list administrative addresses, i.e. -(un)subscribe and -help.
+If flag is "0" (the default), a DSN setting of "fail" will be used.
+Please see sendmail(1)'s -n option for more details on the DSN setting.
+.TP
\fBPOST=\fIoption\fB\fR
Set posting options. \fIoption\fR is
one of three values: "subscribers" - only subscribers may
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users