* PATCH: Not me too
@ 2010-01-25 10:56 Ben Schmidt
2010-01-25 11:08 ` Ben Schmidt
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Ben Schmidt @ 2010-01-25 10:56 UTC (permalink / raw)
To: mlmmj
[-- Attachment #1: Type: text/plain, Size: 2376 bytes --]
The attached patch adds a 'not me too' feature to mlmmj, where post senders are
excluded from the post distribution so people don't get copies of their own mail.
A number of people, particularly those who aren't familiar with traditional email
mailing lists, prefer this. It applies on top of the tunables patch I emailed
earlier (which I neglected to mention applies over 1.2.17).
Some info and design decisions:
I decided a simple boolean tunable would suffice for this, at least in the short
term, and quite probably long term, too. For now, people who really want
confirmation their mail has arrived on the list can always subscribe a nomail
email to post from. I will devote my mind to how this could neatly be extended
later if it seems warranted.
Thanks to Franky for getting me started on this. The from address in those low
level sending functions is the envelope sender, so based on the list address, not
the sender of the mail, though. The sender of the mail is parsed with the other
mail headers in mlmmj-process. This means I needed to communicate that information
from mlmmj-process to mlmmj-send. Commandline paramaters seemed the way most
consistent with the rest of the program, so I added an option.
I also had to decide whether the tunable should be tested in mlmmj-process or
mlmmj-send. I opted for mlmmj-process, as that's where most decisions about
whether and where to send mail are made, and as a general rule it's best if
commandline arguments can override tunables rather than be affected by them. Thus
I added an '-o' option to omit a specified address. The alternative is making the
option specify an originator address, and testing the tunable in mlmmj-send to see
whether or not to omit them from the distribution.
I decided to do an extra pass through the recipients list in main() to do the
filtering rather than modify the lower level functions, as the functions are used
in numerous locations, but this filtering is only required once, so an interface
change doesn't seem warranted, and iterating the recipients shouldn't be too slow,
even for large lists.
Comments? Questions?
I have tested it and it works fine for me.
Could this be included in mlmmj?
The patch includes updating the php and perl web admin interfaces' tunables.pl
file. Should I be CCing people of that code specifically?
Cheers,
Ben.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mlmmj-notmetoo.patch --]
[-- Type: text/x-patch; name="mlmmj-notmetoo.patch", Size: 6380 bytes --]
diff -ru mlmmj-1.2.17/TUNABLES mlmmj-1.2.17-mod/TUNABLES
--- mlmmj-1.2.17/TUNABLES 2010-01-25 02:27:05.000000000 +1100
+++ mlmmj-1.2.17-mod/TUNABLES 2010-01-25 02:23:14.000000000 +1100
@@ -217,3 +217,9 @@
The content of this file is appended to mail sent to the list.
+ ��� notmetoo (boolean)
+
+ If this file is present, mlmmj attempts to exclude the sender of a post
+ from the distribution list for that post so people don't receive copies
+ of their own posts.
+
diff -ru mlmmj-1.2.17/contrib/web/perl-admin/conf/tunables.pl mlmmj-1.2.17-mod/contrib/web/perl-admin/conf/tunables.pl
--- mlmmj-1.2.17/contrib/web/perl-admin/conf/tunables.pl 2010-01-25 02:27:05.000000000 +1100
+++ mlmmj-1.2.17-mod/contrib/web/perl-admin/conf/tunables.pl 2010-01-25 02:22:59.000000000 +1100
@@ -205,3 +205,9 @@
"Footer",
"The content of this option is appended to mail sent to the list.");
+mlmmj_boolean("notmetoo",
+ "Not me too",
+ "If this is set, mlmmj attempts to exclude the sender of a post ".
+ "from the distribution list for that post so people don't receive copies ".
+ "of their own posts.");
+
diff -ru mlmmj-1.2.17/contrib/web/php-admin/conf/tunables.pl mlmmj-1.2.17-mod/contrib/web/php-admin/conf/tunables.pl
--- mlmmj-1.2.17/contrib/web/php-admin/conf/tunables.pl 2010-01-25 02:27:05.000000000 +1100
+++ mlmmj-1.2.17-mod/contrib/web/php-admin/conf/tunables.pl 2010-01-25 02:23:18.000000000 +1100
@@ -205,3 +205,9 @@
"Footer",
"The content of this option is appended to mail sent to the list.");
+mlmmj_boolean("notmetoo",
+ "Not me too",
+ "If this is set, mlmmj attempts to exclude the sender of a post ".
+ "from the distribution list for that post so people don't receive copies ".
+ "of their own posts.");
+
diff -ru mlmmj-1.2.17/man/mlmmj-send.1 mlmmj-1.2.17-mod/man/mlmmj-send.1
--- mlmmj-1.2.17/man/mlmmj-send.1 2008-10-31 07:06:33.000000000 +1100
+++ mlmmj-1.2.17-mod/man/mlmmj-send.1 2010-01-25 02:05:35.000000000 +1100
@@ -1,11 +1,11 @@
-.TH mlmmj-send "1" "September 2004" mlmmj-send
+.TH mlmmj-send "1" "January 2010" mlmmj-send
.SH NAME
mlmmj-send \- send mail to a mailinglist or similar
.SH SYNOPSIS
.B mlmmj-send
[\fI-L\fR /path/to/list | \fI-l\fR listctrl] \fI\-m\fR /path/to/mail
-[\fI-a\fR] [\fI-D\fR] [\fI-F\fR] [\fI-h\fR] [\fI-r\fR] [\fI-R\fR] [\fI-s\fR]
-[\fI-T\fR] [\fI-V\fR]
+[\fI-a\fR] [\fI-D\fR] [\fI-F\fR] [\fI-h\fR] [\fI-o\fR] [\fI-r\fR] [\fI-R\fR]
+[\fI-s\fR] [\fI-T\fR] [\fI-V\fR]
.HP
\fB\-a\fR: Don't archive the mail
.HP
@@ -21,6 +21,8 @@
.HP
\fB\-m\fR: Full path to mail file
.HP
+\fB\-o\fR: Address to omit from distribution (normal mail only)
+.HP
\fB\-r\fR: Relayhost IP address (defaults to 127.0.0.1)
.HP
\fB\-R\fR: What to use as Reply-To: header
diff -ru mlmmj-1.2.17/src/mlmmj-process.c mlmmj-1.2.17-mod/src/mlmmj-process.c
--- mlmmj-1.2.17/src/mlmmj-process.c 2010-01-11 00:40:57.000000000 +1100
+++ mlmmj-1.2.17-mod/src/mlmmj-process.c 2010-01-25 02:23:23.000000000 +1100
@@ -336,6 +336,7 @@
int maxmailsize = 0;
int notoccdenymails = 0, noaccessdenymails = 0, nosubonlydenymails = 0;
int nomaxmailsizedenymails = 0;
+ int notmetoo = 0;
char *listdir = NULL, *mailfile = NULL, *headerfilename = NULL;
char *footerfilename = NULL, *donemailname = NULL;
char *randomstr = NULL, *mqueuename;
@@ -946,7 +950,14 @@
exit(EXIT_SUCCESS);
}
- execlp(mlmmjsend, mlmmjsend,
+ notmetoo = statctrl(listdir, "notmetoo");
+ if (notmetoo)
+ execlp(mlmmjsend, mlmmjsend,
+ "-L", listdir,
+ "-o", fromemails.emaillist[0],
+ "-m", donemailname, (char *)NULL);
+ else
+ execlp(mlmmjsend, mlmmjsend,
"-L", listdir,
"-m", donemailname, (char *)NULL);
log_error(LOG_ARGS, "execlp() of '%s' failed", mlmmjsend);
diff -ru mlmmj-1.2.17/src/mlmmj-send.c mlmmj-1.2.17-mod/src/mlmmj-send.c
--- mlmmj-1.2.17/src/mlmmj-send.c 2008-11-01 02:43:37.000000000 +1100
+++ mlmmj-1.2.17-mod/src/mlmmj-send.c 2010-01-25 02:06:18.000000000 +1100
@@ -672,9 +672,9 @@
static void print_help(const char *prg)
{
- printf("Usage: %s [-L /path/to/list || -l listctrl] \n"
- " -m /path/to/mail [-a] [-D] [-F] [-h] [-r] [-R] "
- "[-s] [-T] [-V]\n"
+ printf("Usage: %s [-L /path/to/list || -l listctrl] \n"
+ " -m /path/to/mail [-a] [-D] [-F] [-h] [-o] [-r] [-R] "
+ "[-R] [-s] [-T] [-V]\n"
" -a: Don't archive the mail\n"
" -D: Don't delete the mail after it's sent\n"
" -F: What to use as MAIL FROM:\n"
@@ -689,6 +689,7 @@
" '7' means 'digest'\n"
" -L: Full path to list directory\n"
" -m: Full path to mail file\n"
+ " -o: Address to omit from distribution (normal mail only)\n"
" -r: Relayhost IP address (defaults to 127.0.0.1)\n"
" -R: What to use as Reply-To: header\n"
" -s: Subscribers file name\n"
@@ -704,7 +705,7 @@
int deletewhensent = 1, sendres = 0, archive = 1, digest = 0;
int ctrlarchive, res;
char *listaddr = NULL, *listdelim = NULL;
- char *mailfilename = NULL, *subfilename = NULL;
+ char *mailfilename = NULL, *subfilename = NULL, *omit = NULL;
char *replyto = NULL, *bounceaddr = NULL, *to_addr = NULL;
char *relayhost = NULL, *archivefilename = NULL, *tmpstr;
char *listctrl = NULL, *subddirname = NULL, *listdir = NULL;
@@ -737,7 +738,7 @@
if(sigaction(SIGTERM, &sigact, NULL) < 0)
log_error(LOG_ARGS, "Could not install SIGTERM handler!");
- while ((opt = getopt(argc, argv, "aVDhm:l:L:R:F:T:r:s:")) != -1){
+ while ((opt = getopt(argc, argv, "aVDhm:l:L:R:F:T:r:s:o:")) != -1){
switch(opt) {
case 'a':
archive = 0;
@@ -760,6 +761,9 @@
case 'm':
mailfilename = optarg;
break;
+ case 'o':
+ omit = optarg;
+ break;
case 'r':
relayhost = optarg;
break;
@@ -1179,6 +1183,22 @@
do {
res = getaddrsfromfd(&stl, subfd,
maxverprecips);
+ if(omit != NULL && maxverprecips > 1) {
+ for(i = 0; i < stl.count; i++) {
+ if(strcmp(stl.strs[i], omit)
+ == 0) {
+ myfree(stl.strs[i]);
+ stl.count--;
+ while (i < stl.count) {
+ stl.strs[i] =
+ stl.strs[i+1];
+ i++;
+ }
+ stl.strs[stl.count] = NULL;
+ break;
+ }
+ }
+ }
if(stl.count == maxverprecips) {
initsmtp(&sockfd, relay, smtpport);
if(verp) {
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Not me too
2010-01-25 10:56 PATCH: Not me too Ben Schmidt
@ 2010-01-25 11:08 ` Ben Schmidt
2010-01-25 11:49 ` Franky Van Liedekerke
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Ben Schmidt @ 2010-01-25 11:08 UTC (permalink / raw)
To: mlmmj
That bit about testing being successful...might need to change that... It doesn't
work for moderated mail; my test of that just got clogged somewhere in the
Internet and didn't arrive for a while!
Still feel free to offer any comments about the patch, or suggestions regarding
implementing this for moderated mail, but also feel free to disregard it until I
come back with something a bit more functional.
Cheers,
Ben.
On 25/01/10 9:56 PM, Ben Schmidt wrote:
> The attached patch adds a 'not me too' feature to mlmmj, where post
> senders are excluded from the post distribution so people don't get
> copies of their own mail. A number of people, particularly those who
> aren't familiar with traditional email mailing lists, prefer this. It
> applies on top of the tunables patch I emailed earlier (which I
> neglected to mention applies over 1.2.17).
>
> Some info and design decisions:
>
> I decided a simple boolean tunable would suffice for this, at least in
> the short term, and quite probably long term, too. For now, people who
> really want confirmation their mail has arrived on the list can always
> subscribe a nomail email to post from. I will devote my mind to how this
> could neatly be extended later if it seems warranted.
>
> Thanks to Franky for getting me started on this. The from address in
> those low level sending functions is the envelope sender, so based on
> the list address, not the sender of the mail, though. The sender of the
> mail is parsed with the other mail headers in mlmmj-process. This means
> I needed to communicate that information from mlmmj-process to
> mlmmj-send. Commandline paramaters seemed the way most consistent with
> the rest of the program, so I added an option.
>
> I also had to decide whether the tunable should be tested in
> mlmmj-process or mlmmj-send. I opted for mlmmj-process, as that's where
> most decisions about whether and where to send mail are made, and as a
> general rule it's best if commandline arguments can override tunables
> rather than be affected by them. Thus I added an '-o' option to omit a
> specified address. The alternative is making the option specify an
> originator address, and testing the tunable in mlmmj-send to see whether
> or not to omit them from the distribution.
>
> I decided to do an extra pass through the recipients list in main() to
> do the filtering rather than modify the lower level functions, as the
> functions are used in numerous locations, but this filtering is only
> required once, so an interface change doesn't seem warranted, and
> iterating the recipients shouldn't be too slow, even for large lists.
>
> Comments? Questions?
>
> I have tested it and it works fine for me.
>
> Could this be included in mlmmj?
>
> The patch includes updating the php and perl web admin interfaces'
> tunables.pl file. Should I be CCing people of that code specifically?
>
> Cheers,
>
> Ben.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Not me too
2010-01-25 10:56 PATCH: Not me too Ben Schmidt
2010-01-25 11:08 ` Ben Schmidt
@ 2010-01-25 11:49 ` Franky Van Liedekerke
2010-01-25 13:37 ` Ben Schmidt
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Franky Van Liedekerke @ 2010-01-25 11:49 UTC (permalink / raw)
To: mlmmj
[-- Attachment #1: Type: text/plain, Size: 3283 bytes --]
Well, since I promised a patch but didn't get around doing it, I feel so
guilty that I will test your patch as well, maybe I can help to figure out
where the moderated problem thingie is.
Franky
On Mon, Jan 25, 2010 at 12:08 PM, Ben Schmidt <mail_ben_schmidt@yahoo.com.au
> wrote:
> That bit about testing being successful...might need to change that... It
> doesn't work for moderated mail; my test of that just got clogged somewhere
> in the Internet and didn't arrive for a while!
>
> Still feel free to offer any comments about the patch, or suggestions
> regarding implementing this for moderated mail, but also feel free to
> disregard it until I come back with something a bit more functional.
>
> Cheers,
>
> Ben.
>
>
>
>
> On 25/01/10 9:56 PM, Ben Schmidt wrote:
>
>> The attached patch adds a 'not me too' feature to mlmmj, where post
>> senders are excluded from the post distribution so people don't get
>> copies of their own mail. A number of people, particularly those who
>> aren't familiar with traditional email mailing lists, prefer this. It
>> applies on top of the tunables patch I emailed earlier (which I
>> neglected to mention applies over 1.2.17).
>>
>> Some info and design decisions:
>>
>> I decided a simple boolean tunable would suffice for this, at least in
>> the short term, and quite probably long term, too. For now, people who
>> really want confirmation their mail has arrived on the list can always
>> subscribe a nomail email to post from. I will devote my mind to how this
>> could neatly be extended later if it seems warranted.
>>
>> Thanks to Franky for getting me started on this. The from address in
>> those low level sending functions is the envelope sender, so based on
>> the list address, not the sender of the mail, though. The sender of the
>> mail is parsed with the other mail headers in mlmmj-process. This means
>> I needed to communicate that information from mlmmj-process to
>> mlmmj-send. Commandline paramaters seemed the way most consistent with
>> the rest of the program, so I added an option.
>>
>> I also had to decide whether the tunable should be tested in
>> mlmmj-process or mlmmj-send. I opted for mlmmj-process, as that's where
>> most decisions about whether and where to send mail are made, and as a
>> general rule it's best if commandline arguments can override tunables
>> rather than be affected by them. Thus I added an '-o' option to omit a
>> specified address. The alternative is making the option specify an
>> originator address, and testing the tunable in mlmmj-send to see whether
>> or not to omit them from the distribution.
>>
>> I decided to do an extra pass through the recipients list in main() to
>> do the filtering rather than modify the lower level functions, as the
>> functions are used in numerous locations, but this filtering is only
>> required once, so an interface change doesn't seem warranted, and
>> iterating the recipients shouldn't be too slow, even for large lists.
>>
>> Comments? Questions?
>>
>> I have tested it and it works fine for me.
>>
>> Could this be included in mlmmj?
>>
>> The patch includes updating the php and perl web admin interfaces'
>> tunables.pl file. Should I be CCing people of that code specifically?
>>
>> Cheers,
>>
>> Ben.
>>
>
>
>
>
>
>
>
[-- Attachment #2: Type: text/html, Size: 4040 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Not me too
2010-01-25 10:56 PATCH: Not me too Ben Schmidt
2010-01-25 11:08 ` Ben Schmidt
2010-01-25 11:49 ` Franky Van Liedekerke
@ 2010-01-25 13:37 ` Ben Schmidt
2010-01-25 13:40 ` Ben Schmidt
2010-01-30 20:14 ` Morten Shearman Kirkegaard
4 siblings, 0 replies; 6+ messages in thread
From: Ben Schmidt @ 2010-01-25 13:37 UTC (permalink / raw)
To: mlmmj
[-- Attachment #1: Type: text/plain, Size: 3064 bytes --]
Attached is a second version of this patch. The comments below all
still apply (and I have added another regarding this second part).
> The attached patch adds a 'not me too' feature to mlmmj, where post
> senders are excluded from the post distribution so people don't get
> copies of their own mail. A number of people, particularly those who
> aren't familiar with traditional email mailing lists, prefer this. It
> applies on top of the tunables patch I emailed earlier (which I
> neglected to mention applies over 1.2.17).
>
> Some info and design decisions:
>
> I decided a simple boolean tunable would suffice for this, at least in
> the short term, and quite probably long term, too. For now, people who
> really want confirmation their mail has arrived on the list can always
> subscribe a nomail email to post from. I will devote my mind to how this
> could neatly be extended later if it seems warranted.
>
> Thanks to Franky for getting me started on this. The from address in
> those low level sending functions is the envelope sender, so based on
> the list address, not the sender of the mail, though. The sender of the
> mail is parsed with the other mail headers in mlmmj-process. This means
> I needed to communicate that information from mlmmj-process to
> mlmmj-send. Commandline paramaters seemed the way most consistent with
> the rest of the program, so I added an option.
>
> I also had to decide whether the tunable should be tested in
> mlmmj-process or mlmmj-send. I opted for mlmmj-process, as that's where
> most decisions about whether and where to send mail are made, and as a
> general rule it's best if commandline arguments can override tunables
> rather than be affected by them. Thus I added an '-o' option to omit a
> specified address. The alternative is making the option specify an
> originator address, and testing the tunable in mlmmj-send to see whether
> or not to omit them from the distribution.
>
> I decided to do an extra pass through the recipients list in main() to
> do the filtering rather than modify the lower level functions, as the
> functions are used in numerous locations, but this filtering is only
> required once, so an interface change doesn't seem warranted, and
> iterating the recipients shouldn't be too slow, even for large lists.
To make it work for moderated mail, it saves a <cookie>.orig
filealongside the file in $LISTDIR/moderation in which it writes the
address extracted from the From: header if it is to be omitted from the
distribution. listcontrol() picks this up and adds the -o argument to
mlmmj-send when the mail is approved. mlmmj-maintd should remove these
extra files along with their counterparts as they will be the same age,
though this has not yet been tested.
> Comments? Questions?
>
> I have tested it and it works fine for me.
>
> Could this be included in mlmmj?
>
> The patch includes updating the php and perl web admin interfaces'
> tunables.pl file. Should I be CCing people of that code specifically?
And also the php-moderation script now.
Cheers,
Ben.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mlmmj-notmetoo-2.patch --]
[-- Type: text/x-patch; name="mlmmj-notmetoo-2.patch", Size: 10173 bytes --]
diff -ru mlmmj-1.2.17/TUNABLES mlmmj-1.2.17-mod/TUNABLES
--- mlmmj-1.2.17/TUNABLES 2010-01-26 00:12:06.000000000 +1100
+++ mlmmj-1.2.17-mod/TUNABLES 2010-01-25 02:23:14.000000000 +1100
@@ -217,3 +217,9 @@
The content of this file is appended to mail sent to the list.
+ ��� notmetoo (boolean)
+
+ If this file is present, mlmmj attempts to exclude the sender of a post
+ from the distribution list for that post so people don't receive copies
+ of their own posts.
+
diff -ru mlmmj-1.2.17/contrib/web/perl-admin/conf/tunables.pl mlmmj-1.2.17-mod/contrib/web/perl-admin/conf/tunables.pl
--- mlmmj-1.2.17/contrib/web/perl-admin/conf/tunables.pl 2010-01-26 00:12:06.000000000 +1100
+++ mlmmj-1.2.17-mod/contrib/web/perl-admin/conf/tunables.pl 2010-01-25 22:16:57.000000000 +1100
@@ -205,3 +205,9 @@
"Footer",
"The content of this option is appended to mail sent to the list.");
+mlmmj_boolean("notmetoo",
+ "Not me too",
+ "If this is set, mlmmj attempts to exclude the sender of a post ".
+ "from the distribution list for that post so people don't receive copies ".
+ "of their own posts.");
+
diff -ru mlmmj-1.2.17/contrib/web/php-admin/conf/tunables.pl mlmmj-1.2.17-mod/contrib/web/php-admin/conf/tunables.pl
--- mlmmj-1.2.17/contrib/web/php-admin/conf/tunables.pl 2010-01-26 00:12:06.000000000 +1100
+++ mlmmj-1.2.17-mod/contrib/web/php-admin/conf/tunables.pl 2010-01-25 22:17:02.000000000 +1100
@@ -205,3 +205,9 @@
"Footer",
"The content of this option is appended to mail sent to the list.");
+mlmmj_boolean("notmetoo",
+ "Not me too",
+ "If this is set, mlmmj attempts to exclude the sender of a post ".
+ "from the distribution list for that post so people don't receive copies ".
+ "of their own posts.");
+
diff -ru mlmmj-1.2.17/contrib/web/php-moderation/mlmmj-moderation.php mlmmj-1.2.17-mod/contrib/web/php-moderation/mlmmj-moderation.php
--- mlmmj-1.2.17/contrib/web/php-moderation/mlmmj-moderation.php 2010-01-26 00:11:50.000000000 +1100
+++ mlmmj-1.2.17-mod/contrib/web/php-moderation/mlmmj-moderation.php 2010-01-25 23:57:55.000000000 +1100
@@ -116,6 +116,7 @@
if (is_dir($mod_dir)) {
if ($dh = opendir($mod_dir)) {
while (($file = readdir($dh)) !== false) {
+ if( !ereg("^([0-9a-f]+)\$",$file) ) continue;
$full_path = $mod_dir . "/" . $file;
if(filetype($full_path) == "file"){
if(FALSE === ($input = file_get_contents($full_path))){
Only in mlmmj-1.2.17-mod/listtexts: Makefile
diff -ru mlmmj-1.2.17/man/mlmmj-send.1 mlmmj-1.2.17-mod/man/mlmmj-send.1
--- mlmmj-1.2.17/man/mlmmj-send.1 2010-01-26 00:11:50.000000000 +1100
+++ mlmmj-1.2.17-mod/man/mlmmj-send.1 2010-01-25 02:05:35.000000000 +1100
@@ -1,11 +1,11 @@
-.TH mlmmj-send "1" "September 2004" mlmmj-send
+.TH mlmmj-send "1" "January 2010" mlmmj-send
.SH NAME
mlmmj-send \- send mail to a mailinglist or similar
.SH SYNOPSIS
.B mlmmj-send
[\fI-L\fR /path/to/list | \fI-l\fR listctrl] \fI\-m\fR /path/to/mail
-[\fI-a\fR] [\fI-D\fR] [\fI-F\fR] [\fI-h\fR] [\fI-r\fR] [\fI-R\fR] [\fI-s\fR]
-[\fI-T\fR] [\fI-V\fR]
+[\fI-a\fR] [\fI-D\fR] [\fI-F\fR] [\fI-h\fR] [\fI-o\fR] [\fI-r\fR] [\fI-R\fR]
+[\fI-s\fR] [\fI-T\fR] [\fI-V\fR]
.HP
\fB\-a\fR: Don't archive the mail
.HP
@@ -21,6 +21,8 @@
.HP
\fB\-m\fR: Full path to mail file
.HP
+\fB\-o\fR: Address to omit from distribution (normal mail only)
+.HP
\fB\-r\fR: Relayhost IP address (defaults to 127.0.0.1)
.HP
\fB\-R\fR: What to use as Reply-To: header
diff -ru mlmmj-1.2.17/src/listcontrol.c mlmmj-1.2.17-mod/src/listcontrol.c
--- mlmmj-1.2.17/src/listcontrol.c 2010-01-26 00:11:50.000000000 +1100
+++ mlmmj-1.2.17-mod/src/listcontrol.c 2010-01-25 23:58:33.000000000 +1100
@@ -105,7 +105,8 @@
const char *mlmmjbounce, const char *mailname)
{
char *bouncenr, *tmpstr;
- char *param = NULL, *conffilename, *moderatefilename;
+ char *param = NULL, *conffilename, *moderatefilename, *omitfilename;
+ char *omit = NULL;
char *c, *archivefilename, *sendfilename;
const char *subswitch;
struct stat stbuf;
@@ -604,7 +605,6 @@
}
sendfilename = concatstr(2, moderatefilename, ".sending");
-
if(stat(moderatefilename, &stbuf) < 0) {
myfree(moderatefilename);
/* no mail to moderate */
@@ -620,12 +620,33 @@
exit(EXIT_FAILURE);
}
+ omitfilename = concatstr(2, moderatefilename, ".omit");
+ if(stat(omitfilename, &stbuf) == 0) {
+ tmpfd = open(omitfilename, O_RDONLY);
+ if(tmpfd < 0) {
+ log_error(LOG_ARGS, "Could not open %s",
+ omitfilename);
+ } else {
+ omit = mygetline(tmpfd);
+ close(tmpfd);
+ chomp(omit);
+ }
+ unlink(omitfilename);
+ myfree(omitfilename);
+ }
+
log_oper(listdir, OPLOGFNAME, "%s moderated %s",
fromemails->emaillist[0], moderatefilename);
myfree(moderatefilename);
- execlp(mlmmjsend, mlmmjsend,
- "-L", listdir,
- "-m", sendfilename, (char *)NULL);
+ if (omit != NULL)
+ execlp(mlmmjsend, mlmmjsend,
+ "-L", listdir,
+ "-o", omit,
+ "-m", sendfilename, (char *)NULL);
+ else
+ execlp(mlmmjsend, mlmmjsend,
+ "-L", listdir,
+ "-m", sendfilename, (char *)NULL);
log_error(LOG_ARGS, "execlp() of '%s' failed",
mlmmjsend);
exit(EXIT_FAILURE);
diff -ru mlmmj-1.2.17/src/mlmmj-process.c mlmmj-1.2.17-mod/src/mlmmj-process.c
--- mlmmj-1.2.17/src/mlmmj-process.c 2010-01-26 00:11:50.000000000 +1100
+++ mlmmj-1.2.17-mod/src/mlmmj-process.c 2010-01-26 00:05:34.000000000 +1100
@@ -331,14 +331,15 @@
int main(int argc, char **argv)
{
int i, j, opt, noprocess = 0, moderated = 0;
- int hdrfd, footfd, rawmailfd, donemailfd;
+ int hdrfd, footfd, rawmailfd, donemailfd, omitfd;
int subonlypost = 0, addrtocc = 1, intocc = 0, modnonsubposts = 0;
int maxmailsize = 0;
int notoccdenymails = 0, noaccessdenymails = 0, nosubonlydenymails = 0;
int nomaxmailsizedenymails = 0;
+ int notmetoo = 0;
char *listdir = NULL, *mailfile = NULL, *headerfilename = NULL;
char *footerfilename = NULL, *donemailname = NULL;
- char *randomstr = NULL, *mqueuename;
+ char *randomstr = NULL, *mqueuename, *omitfilename;
char *mlmmjsend, *mlmmjsub, *mlmmjunsub, *mlmmjbounce;
char *bindir, *subjectprefix, *discardname, *listaddr, *listdelim;
char *listfqdn, *listname, *fromaddr;
@@ -920,6 +923,8 @@
}
}
+ notmetoo = statctrl(listdir, "notmetoo");
+
if(!moderated)
moderated = statctrl(listdir, "moderated");
if(moderated) {
@@ -934,6 +939,27 @@
exit(EXIT_FAILURE);
}
myfree(donemailname);
+ if (notmetoo) {
+ omitfilename = concatstr(2, mqueuename, ".omit");
+ omitfd = open(omitfilename, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR);
+ if (omitfd < 0) {
+ log_error(LOG_ARGS, "could not open %s",
+ omitfilename);
+ myfree(mqueuename);
+ myfree(omitfilename);
+ exit(EXIT_FAILURE);
+ }
+ myfree(omitfilename);
+ if(writen(omitfd, fromemails.emaillist[0],
+ strlen(fromemails.emaillist[0])) < 0) {
+ log_error(LOG_ARGS,
+ "could not write omit file");
+ myfree(mqueuename);
+ exit(EXIT_FAILURE);
+ }
+ fsync(omitfd);
+ close(omitfd);
+ }
newmoderated(listdir, mqueuename, mlmmjsend, efrom);
return EXIT_SUCCESS;
}
@@ -946,7 +972,13 @@
exit(EXIT_SUCCESS);
}
- execlp(mlmmjsend, mlmmjsend,
+ if (notmetoo)
+ execlp(mlmmjsend, mlmmjsend,
+ "-L", listdir,
+ "-o", fromemails.emaillist[0],
+ "-m", donemailname, (char *)NULL);
+ else
+ execlp(mlmmjsend, mlmmjsend,
"-L", listdir,
"-m", donemailname, (char *)NULL);
log_error(LOG_ARGS, "execlp() of '%s' failed", mlmmjsend);
diff -ru mlmmj-1.2.17/src/mlmmj-send.c mlmmj-1.2.17-mod/src/mlmmj-send.c
--- mlmmj-1.2.17/src/mlmmj-send.c 2010-01-26 00:11:50.000000000 +1100
+++ mlmmj-1.2.17-mod/src/mlmmj-send.c 2010-01-25 02:06:18.000000000 +1100
@@ -672,9 +672,9 @@
static void print_help(const char *prg)
{
- printf("Usage: %s [-L /path/to/list || -l listctrl] \n"
- " -m /path/to/mail [-a] [-D] [-F] [-h] [-r] [-R] "
- "[-s] [-T] [-V]\n"
+ printf("Usage: %s [-L /path/to/list || -l listctrl] \n"
+ " -m /path/to/mail [-a] [-D] [-F] [-h] [-o] [-r] [-R] "
+ "[-R] [-s] [-T] [-V]\n"
" -a: Don't archive the mail\n"
" -D: Don't delete the mail after it's sent\n"
" -F: What to use as MAIL FROM:\n"
@@ -689,6 +689,7 @@
" '7' means 'digest'\n"
" -L: Full path to list directory\n"
" -m: Full path to mail file\n"
+ " -o: Address to omit from distribution (normal mail only)\n"
" -r: Relayhost IP address (defaults to 127.0.0.1)\n"
" -R: What to use as Reply-To: header\n"
" -s: Subscribers file name\n"
@@ -704,7 +705,7 @@
int deletewhensent = 1, sendres = 0, archive = 1, digest = 0;
int ctrlarchive, res;
char *listaddr = NULL, *listdelim = NULL;
- char *mailfilename = NULL, *subfilename = NULL;
+ char *mailfilename = NULL, *subfilename = NULL, *omit = NULL;
char *replyto = NULL, *bounceaddr = NULL, *to_addr = NULL;
char *relayhost = NULL, *archivefilename = NULL, *tmpstr;
char *listctrl = NULL, *subddirname = NULL, *listdir = NULL;
@@ -737,7 +738,7 @@
if(sigaction(SIGTERM, &sigact, NULL) < 0)
log_error(LOG_ARGS, "Could not install SIGTERM handler!");
- while ((opt = getopt(argc, argv, "aVDhm:l:L:R:F:T:r:s:")) != -1){
+ while ((opt = getopt(argc, argv, "aVDhm:l:L:R:F:T:r:s:o:")) != -1){
switch(opt) {
case 'a':
archive = 0;
@@ -760,6 +761,9 @@
case 'm':
mailfilename = optarg;
break;
+ case 'o':
+ omit = optarg;
+ break;
case 'r':
relayhost = optarg;
break;
@@ -1179,6 +1183,22 @@
do {
res = getaddrsfromfd(&stl, subfd,
maxverprecips);
+ if(omit != NULL && maxverprecips > 1) {
+ for(i = 0; i < stl.count; i++) {
+ if(strcmp(stl.strs[i], omit)
+ == 0) {
+ myfree(stl.strs[i]);
+ stl.count--;
+ while (i < stl.count) {
+ stl.strs[i] =
+ stl.strs[i+1];
+ i++;
+ }
+ stl.strs[stl.count] = NULL;
+ break;
+ }
+ }
+ }
if(stl.count == maxverprecips) {
initsmtp(&sockfd, relay, smtpport);
if(verp) {
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Not me too
2010-01-25 10:56 PATCH: Not me too Ben Schmidt
` (2 preceding siblings ...)
2010-01-25 13:37 ` Ben Schmidt
@ 2010-01-25 13:40 ` Ben Schmidt
2010-01-30 20:14 ` Morten Shearman Kirkegaard
4 siblings, 0 replies; 6+ messages in thread
From: Ben Schmidt @ 2010-01-25 13:40 UTC (permalink / raw)
To: mlmmj
Thanks again for the offer of help, Franky. No worries that you didn't get around
to the earlier patch; what you wrote in your email was a pretty good start and
quite detailed, so helpful.
I think I've cracked the moderation thing! Wrote about it in another email.
Extra hands testing are always appreciated, especially because I have a pretty
limited selection of list options in use myself.
Ben.
On 25/01/10 10:49 PM, Franky Van Liedekerke wrote:
> Well, since I promised a patch but didn't get around doing it, I feel so
> guilty that I will test your patch as well, maybe I can help to figure
> out where the moderated problem thingie is.
>
> Franky
>
> On Mon, Jan 25, 2010 at 12:08 PM, Ben Schmidt
> <mail_ben_schmidt@yahoo.com.au <mailto:mail_ben_schmidt@yahoo.com.au>>
> wrote:
>
> That bit about testing being successful...might need to change
> that... It doesn't work for moderated mail; my test of that just got
> clogged somewhere in the Internet and didn't arrive for a while!
>
> Still feel free to offer any comments about the patch, or
> suggestions regarding implementing this for moderated mail, but also
> feel free to disregard it until I come back with something a bit
> more functional.
>
> Cheers,
>
> Ben.
>
>
>
>
> On 25/01/10 9:56 PM, Ben Schmidt wrote:
>
> The attached patch adds a 'not me too' feature to mlmmj, where post
> senders are excluded from the post distribution so people don't get
> copies of their own mail. A number of people, particularly those who
> aren't familiar with traditional email mailing lists, prefer
> this. It
> applies on top of the tunables patch I emailed earlier (which I
> neglected to mention applies over 1.2.17).
>
> Some info and design decisions:
>
> I decided a simple boolean tunable would suffice for this, at
> least in
> the short term, and quite probably long term, too. For now,
> people who
> really want confirmation their mail has arrived on the list can
> always
> subscribe a nomail email to post from. I will devote my mind to
> how this
> could neatly be extended later if it seems warranted.
>
> Thanks to Franky for getting me started on this. The from address in
> those low level sending functions is the envelope sender, so
> based on
> the list address, not the sender of the mail, though. The sender
> of the
> mail is parsed with the other mail headers in mlmmj-process.
> This means
> I needed to communicate that information from mlmmj-process to
> mlmmj-send. Commandline paramaters seemed the way most
> consistent with
> the rest of the program, so I added an option.
>
> I also had to decide whether the tunable should be tested in
> mlmmj-process or mlmmj-send. I opted for mlmmj-process, as
> that's where
> most decisions about whether and where to send mail are made,
> and as a
> general rule it's best if commandline arguments can override
> tunables
> rather than be affected by them. Thus I added an '-o' option to
> omit a
> specified address. The alternative is making the option specify an
> originator address, and testing the tunable in mlmmj-send to see
> whether
> or not to omit them from the distribution.
>
> I decided to do an extra pass through the recipients list in
> main() to
> do the filtering rather than modify the lower level functions,
> as the
> functions are used in numerous locations, but this filtering is only
> required once, so an interface change doesn't seem warranted, and
> iterating the recipients shouldn't be too slow, even for large
> lists.
>
> Comments? Questions?
>
> I have tested it and it works fine for me.
>
> Could this be included in mlmmj?
>
> The patch includes updating the php and perl web admin interfaces'
> tunables.pl <http://tunables.pl> file. Should I be CCing people
> of that code specifically?
>
> Cheers,
>
> Ben.
>
>
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: Not me too
2010-01-25 10:56 PATCH: Not me too Ben Schmidt
` (3 preceding siblings ...)
2010-01-25 13:40 ` Ben Schmidt
@ 2010-01-30 20:14 ` Morten Shearman Kirkegaard
4 siblings, 0 replies; 6+ messages in thread
From: Morten Shearman Kirkegaard @ 2010-01-30 20:14 UTC (permalink / raw)
To: mlmmj
Hi Ben,
On Mon, 2010-01-25 at 21:56 +1100, Ben Schmidt wrote:
> The attached patch adds a 'not me too' feature to mlmmj
I can see that you've sent even more code, but I need to sleep a bit
before I travel to Norway. Don't worry, I will look at it soon.
Morten
--
Morten Shearman Kirkegaard <moki@fabletech.com>
CTO, FableTech
http://fabletech.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-01-30 20:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-25 10:56 PATCH: Not me too Ben Schmidt
2010-01-25 11:08 ` Ben Schmidt
2010-01-25 11:49 ` Franky Van Liedekerke
2010-01-25 13:37 ` Ben Schmidt
2010-01-25 13:40 ` Ben Schmidt
2010-01-30 20:14 ` Morten Shearman Kirkegaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.