Cannot remove mail adress
Hi mlmmj's,
I have a server that uses mlmmj, but now I have the problem, that some email address cannot be deleted.
for instance, I have this problem with my own, but the applikation user has repported that she had th eproblem several times, so people simply can't unsubscribe!
see the following,
/$ sudo mlmmj-list -L /var/spool/mlmmj/nyhedsbrev/ | grep cromozon [email protected]
/$ sudo /usr/bin/mlmmj-unsub -L /var/spool/mlmmj/nyhedsbrev/ -a [email protected] -s
Changing to uid 65534, owner of /var/spool/mlmmj/nyhedsbrev/. /$ sudo mlmmj-list -L /var/spool/mlmmj/nyhedsbrev/ | grep cromozon [email protected]
As you can see, the mail adress is not deleted after the unsub command, but in most cases, it works, what can be wrong?
/Christian
Quoted 17 lines · Christian Gleerup
I have a server that uses mlmmj, but now I have the problem, that some email address cannot be deleted.
for instance, I have this problem with my own, but the applikation user has repported that she had th eproblem several times, so people simply can't unsubscribe!
see the following,
/$ sudo mlmmj-list -L
/var/spool/mlmmj/nyhedsbrev/| grep cromozon [email protected]
/$ sudo/usr/bin/mlmmj-unsub-L/var/spool/mlmmj/nyhedsbrev/-a [email protected] -s
Changing to uid 65534, owner of/var/spool/mlmmj/nyhedsbrev/. /$ sudo mlmmj-list -L/var/spool/mlmmj/nyhedsbrev/| grep cromozon [email protected]
Quoted 2 lines
As you can see, the mail adress is not deleted after the unsub command, but in most cases, it works, what can be wrong?
Have a look at the owner and permissions of the files - it looks to me as if the one in question is owned by someone other than it should.
Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J.
Hi Martin,
can you tell me where to look after the files?
I have tried too look around below /var/spool/mlmmj/nyhedsbrev/, but I can't find any adresses in there.
Den 9/26/2010 9:08 PM, Mads Martin Jørgensen skrev:
Quoted 24 lines
Quoted 17 lines · Christian Gleerup
I have a server that uses mlmmj, but now I have the problem, that some email address cannot be deleted.
for instance, I have this problem with my own, but the applikation user has repported that she had th eproblem several times, so people simply can't unsubscribe!
see the following,
/$ sudo mlmmj-list -L
/var/spool/mlmmj/nyhedsbrev/| grep cromozon [email protected]
/$ sudo/usr/bin/mlmmj-unsub-L/var/spool/mlmmj/nyhedsbrev/-a [email protected] -s
Changing to uid 65534, owner of/var/spool/mlmmj/nyhedsbrev/. /$ sudo mlmmj-list -L/var/spool/mlmmj/nyhedsbrev/| grep cromozon [email protected]Quoted 2 lines
As you can see, the mail adress is not deleted after the unsub command, but in most cases, it works, what can be wrong?
Have a look at the owner and permissions of the files - it looks to me as if the one in question is owned by someone other than it should.
2010/9/28 Christian Gleerup <[email protected]>:
Quoted 5 lines
Hi Martin,
can you tell me where to look after the files?
I have tried too look around below/var/spool/mlmmj/nyhedsbrev/, but I can't find any adresses in there.
Look in:
/var/spool/mlmmj/nyhedsbrev/subscribers.d/
where all files containing emailadresses are subscribers.
Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J.
Have a look at the permissions:
ls -ld /var/spool/mlmmj/nyhedsbrev
ls -ld /var/spool/mlmmj/nyhedsbrev/subscribers.d
ls -l /var/spool/mlmmj/nyhedsbrev/subscribers.d
Do the owners of all the directories and files match? (They should be owned by the user that Mlmmj runs as when invoked by your MTA.) Are they all writeable by the owner?
Commands like
chown -R nobody /var/spool/mlmmj/nyhedsbrev
chmod -R u+rw /var/spool/mlmmj/nyhedsbrev
can be used to set the permissions of everything in the list directory. I've guessed 'nobody' because user ID 65534 is likely to be that user, but you may need to adjust that. Are you using Postfix? If so, and you're using it simply, it is likely that it is correct for 'nobody' to be used.
Hope this helps,
Ben.
Quoted 36 lines · Christian Gleerup
Ok, I see them now, but.
the concerned email adress i can't delete, lives in
/var/spool/mlmmj/nyhedsbrev/subscribers.d/cSee the following:
/$ sudo cat/var/spool/mlmmj/nyhedsbrev/subscribers.d/c| grep cromozon [email protected]
[email protected]/$ sudo
/usr/bin/mlmmj-unsub-L/var/spool/mlmmj/nyhedsbrev/-a [email protected] -s
Changing to uid 65534, owner of/var/spool/mlmmj/nyhedsbrev/.
/$ sudo/usr/bin/mlmmj-unsub-L/var/spool/mlmmj/nyhedsbrev/-a [email protected] -s Changing to uid 65534, owner of/var/spool/mlmmj/nyhedsbrev/./$ sudo cat
/var/spool/mlmmj/nyhedsbrev/subscribers.d/c| grep cromozon [email protected]Note, If I ommit the -s when i unsubscribe, I get an email with the text from unsub-notsubscribed
Den 9/29/2010 8:20 AM, Mads Martin Jørgensen skrev:
Quoted 6 lines
Look in:
/var/spool/mlmmj/nyhedsbrev/subscribers.d/where all files containing emailadresses are subscribers.
I just checked the file, and it indeed contained a whitespace character (\r)
this must have been an error when I made the mass subscribe system, I will look out for this, but it would be nice if the system was a bit more robust, and automatically removed trailing whitespaces :)
I wasn't able to remove the adress by sending a mail either, it said that I was not a member.
after removing the \r, i was able to unsubscribe
many thanks
Christian.
Quoted 11 lines
Also, have you tried unsubscribing through the mail system (assuming it's not a closed list), i.e. by sending mail to nyhedsbrev+unsubscribe@... from the problematic address?
Finally...I should say if it's just this one address, not a recurring problem that you need to fix, it wouldn't hurt to find the line in the subscribers.d/c file and just remove it with a text editor.
It would be good to know if that illusive extra whitespace is there though, regardless, particularly if you know how the address was subscribed, because there may be a bug in Mlmmj we can track down, or
an
Quoted 5 lines
improvement we can make to avoid it happening again.
Smiles,
Ben.
Quoted 6 lines · Christian Gleerup
I just checked the file, and it indeed contained a whitespace character (\r)
this must have been an error when I made the mass subscribe system, I will look out for this, but it would be nice if the system was a bit more robust, and automatically removed trailing whitespaces :)
I believe it does remove trailing whitespaces, but that's not a whitespace, that's a carriage return. We agree that it should be able to handle it, and be more robust, since \r is not a valid emailaddress character.
Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J.
Quoted 6 lines · Mads Martin Jørgensen
Quoted 4 lines · Christian Gleerup
I just checked the file, and it indeed contained a whitespace character (\r)
this must have been an error when I made the mass subscribe system,
In what way did this interface with Mlmmj? Do you know where the carriage return came from in the first place? Would it have appeared in a commandline argument to mlmmj-sub? Or...?
Quoted 5 lines
Quoted 2 lines
I will look out for this, but it would be nice if the system was a bit more robust, and automatically removed trailing whitespaces :)
I believe it does remove trailing whitespaces, but that's not a whitespace, that's a carriage return.
I think that's a whitespace. Non-linear, but still whitespace.
Quoted 2 lines
We agree that it should be able to handle it, and be more robust, since \r is not a valid emailaddress character.
Yep. We all agree it would be nice to guard against this!
Ben.
Quoted 4 lines · Ben Schmidt
Quoted 2 lines
I believe it does remove trailing whitespaces, but that's not a whitespace, that's a carriage return.
I think that's a whitespace. Non-linear, but still whitespace.
According to the ASCII definition:
13 0D CR Carriage return
:-) It's from the old days of typewriters, where to start a new line in your text, you first have to do a newline, and then send the carriage back to the beginning of that line.
$ cat carret.c && gcc -o carret carret.c && ./carret #include <stdio.h>
int main(int ac, char **av) {
printf("ASCII Val: [%d]\n", (int)'\r');
return 0;
}ASCII Val: [13]
Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J.
Quoted 6 lines · Mads Martin Jørgensen
Quoted 4 lines · Ben Schmidt
Quoted 2 lines
I believe it does remove trailing whitespaces, but that's not a whitespace, that's a carriage return.
I think that's a whitespace. Non-linear, but still whitespace.
POSIX as well as perl seem to classify it as whitespace:
http://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classes
Signature · 1 line
Christian Laursen
Quoted 5 lines · Mads Martin Jørgensen
Quoted 3 lines · Ben Schmidt
Quoted 2 lines
I believe it does remove trailing whitespaces, but that's not a whitespace, that's a carriage return.
Quoted 7 lines
Quoted 1 line
I think that's a whitespace. Non-linear, but still whitespace.
According to the ASCII definition:
13 0D CR Carriage return
:-)
Well, yes, it is both.
According to my `man isspace':
The isspace() function tests for the white-space characters. For any locale, this includes the following standard characters:
``\t'' ``\n'' ``\v'' ``\f'' ``\r'' `` ''
:-)
The tab (\t) and space characters are linear whitespace (they appear in a line just as other characters do), and the others are non-linear (they break that rule somehow).
Quoted 3 lines
It's from the old days of typewriters, where to start a new line in your text, you first have to do a newline, and then send the carriage back to the beginning of that line.
Indeed. Though in this case, \n is not newline, but linefeed, semantically. Only on Unix, where \n represents both the carriage return and the line feed, does it really mean newline. And, in fact, even that meaning is not 100% right: it actually means EOL--end of line, for it is used at the very end of a file to mark the end of the last line, even though there is no new line after it. But we are often sloppy in our terminology. :-)
I bought myself a typewriter recently. I have a friend who has one, too, and it allows us to do instant messaging when we go away camping together, just like when we are at home with our computers.
Smiles,
Ben.
Quoted 9 lines · Christian Laursen
Quoted 7 lines · Mads Martin Jørgensen
Quoted 4 lines · Ben Schmidt
I believe it does remove trailing whitespaces, but that's not a
Quoted 2 lines
whitespace, that's a carriage return.
Quoted 8 lines
Quoted 3 lines
Quoted 2 lines
I think that's a whitespace. Non-linear, but still whitespace.
POSIX as well as perl seem to classify it as whitespace:
http://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classesyeah, but "whitespace" is an interpreted thing, I mean it is programmed
into perl to behave like that. C doesn't work that way, unless you can find a similar standard function to search/replace as the one in perl? So: I would say: just remove all illegal characters from the email, but you might want to allow all UTF-8 characters ...
Franky
Hi Ben,
I subscribed from a PHP script using mlmmj-sub.
The input comes from a textarea, where multiple mails are delimeted by 'line changes' (whatever the browser uses. seems like '\r\n')
I split into an array on '\n' and send to command line, to be excact:
$addressA = explode("\n", $_REQUEST['address']);
foreach ($addressA as $a) {
$a = trim($a); // Didn't trim when the bad mail was injected
exec("sudo /usr/bin/mlmmj-sub -L /var/spool/mlmmj/nyhedsbrev/ -a {$a}
-s");
}
By the way, php describes trim like....
This function returns a string with whitespace stripped from the beginning and end of str. Without the second parameter, trim() will strip these characters:
* " " (ASCII 32 (0x20)), an ordinary space.
* "\t" (ASCII 9 (0x09)), a tab.
* "\n" (ASCII 10 (0x0A)), a new line (line feed).
* "\r" (ASCII 13 (0x0D)), a carriage return.
* "\0" (ASCII 0 (0x00)), the NUL-byte.
* "\x0B" (ASCII 11 (0x0B)), a vertical tab.
ons, 06 10 2010 kl. 18:55 +1100, skrev Ben Schmidt:
Quoted 29 lines · Mads Martin Jørgensen
Quoted 6 lines
Quoted 4 lines · Christian Gleerup
I just checked the file, and it indeed contained a whitespace character (\r)
this must have been an error when I made the mass subscribe system,
In what way did this interface with Mlmmj? Do you know where the carriage return came from in the first place? Would it have appeared in a commandline argument to mlmmj-sub? Or...?
Quoted 5 lines
Quoted 2 lines
I will look out for this, but it would be nice if the system was a bit more robust, and automatically removed trailing whitespaces :)
I believe it does remove trailing whitespaces, but that's not a whitespace, that's a carriage return.
I think that's a whitespace. Non-linear, but still whitespace.
Quoted 2 lines
We agree that it should be able to handle it, and be more robust, since \r is not a valid emailaddress character.
Yep. We all agree it would be nice to guard against this!
Ben.
Quoted 1 line
I subscribed from a PHP script using mlmmj-sub.
Great to know.
Quoted 2 lines
The input comes from a textarea, where multiple mails are delimeted by 'line changes' (whatever the browser uses. seems like '\r\n')
It should be, at least if standards are followed. HTML4 defines the linebreak representation for form submission as CRLF. It's the most sensible thing to use, because it means a bunch of translation doesn't have to go on between HTTP's linebreak representation.
I fixed basically the same problem in php-admin recently:
http://mlmmj.org/hg/mlmmj/rev/b37f66e0852b
It was writing to control files, though, not calling programs, and Mlmmj probably chomps the lines in the control files when it reads them and masks the problem, unlike the case you found.
Quoted 8 lines
I split into an array on '\n' and send to command line, to be excact:
$addressA =
explode("\n", $_REQUEST['address']);
foreach ($addressA as $a) {
$a = trim($a); // Didn't trim when the bad mail was injected
exec("sudo/usr/bin/mlmmj-sub-L/var/spool/mlmmj/nyhedsbrev/-a {$a}
-s");
}
Thank you. Bug filed with this as a test case!
Ben.
Quoted 48 lines
By the way, php describes trim like....
This function returns a string with whitespace stripped from the beginning and end of str. Without the second parameter,trim()will strip these characters:* " " (ASCII 32 (
0x20)), an ordinary space.
* "\t" (ASCII 9 (0x09)), a tab.
* "\n" (ASCII 10 (0x0A)), a new line (line feed).
* "\r" (ASCII 13 (0x0D)), a carriage return.
* "\0" (ASCII 0 (0x00)), the NUL-byte.
* "\x0B" (ASCII 11 (0x0B)), a vertical tab.ons, 06 10 2010 kl. 18:55 +1100, skrev Ben Schmidt:
Quoted 29 lines · Mads Martin Jørgensen
Quoted 6 lines
Quoted 4 lines · Christian Gleerup
I just checked the file, and it indeed contained a whitespace character (\r)
this must have been an error when I made the mass subscribe system,
In what way did this interface with Mlmmj? Do you know where the carriage return came from in the first place? Would it have appeared in a commandline argument to mlmmj-sub? Or...?
Quoted 5 lines
Quoted 2 lines
I will look out for this, but it would be nice if the system was a bit more robust, and automatically removed trailing whitespaces :)
I believe it does remove trailing whitespaces, but that's not a whitespace, that's a carriage return.
I think that's a whitespace. Non-linear, but still whitespace.
Quoted 2 lines
We agree that it should be able to handle it, and be more robust, since \r is not a valid emailaddress character.
Yep. We all agree it would be nice to guard against this!
Ben.