Mercurial > hg > mlmmj
changeset 495:c5e975579329
patch for warning people already subbed they are and same with unsub
author | mmj |
---|---|
date | Sat, 07 May 2005 23:10:49 +1000 |
parents | af9b8c5b81ef |
children | 41f2344e0896 |
files | ChangeLog README.exim4 VERSION listtexts/Makefile.am listtexts/sub-subscribed listtexts/unsub-notsubscribed src/mlmmj-sub.c src/mlmmj-unsub.c |
diffstat | 8 files changed, 106 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed May 04 19:37:54 2005 +1000 +++ b/ChangeLog Sat May 07 23:10:49 2005 +1000 @@ -1,3 +1,5 @@ +1.2.6 + o Add notification mail when subbed people try to sub (Jakob Hirsch) o Install SIGTERM handler in mlmmj-send to allow it to shut down gracefully o Also remove mails when it's a bounce from a person not subbed o Introduce read() wrapper (Stevens)
--- a/README.exim4 Wed May 04 19:37:54 2005 +1000 +++ b/README.exim4 Sat May 07 23:10:49 2005 +1000 @@ -1,4 +1,5 @@ -README.exim4 March 16th 2005 + +README.exim4 May 6th 2005 This is a step-by-step guide to run mlmmj with Exim4. @@ -33,6 +34,8 @@ require_files = MLMMJ_HOME/${lc::$local_part}/index local_part_suffix = +* local_part_suffix_optional + headers_remove = Delivered-To + headers_add = Delivered-To: $local_part$local_part_suffix@$domain transport = mlmmj_transport
--- a/VERSION Wed May 04 19:37:54 2005 +1000 +++ b/VERSION Sat May 07 23:10:49 2005 +1000 @@ -1,1 +1,1 @@ -1.2.6pre3 +1.2.6pre4
--- a/listtexts/Makefile.am Wed May 04 19:37:54 2005 +1000 +++ b/listtexts/Makefile.am Sat May 07 23:10:49 2005 +1000 @@ -5,4 +5,5 @@ notifyunsub-nomail notintocc sub-confirm sub-confirm-digest \ sub-confirm-nomail sub-ok sub-ok-digest sub-ok-nomail subonlypost \ unsub-confirm unsub-confirm-digest unsub-confirm-nomail unsub-ok \ - unsub-ok-digest unsub-ok-nomail listsubs + unsub-ok-digest unsub-ok-nomail listsubs sub-subscribed \ + unsub-notsubscribed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/listtexts/sub-subscribed Sat May 07 23:10:49 2005 +1000 @@ -0,0 +1,17 @@ +Subject: Already subscribed to $listaddr$ + +Hi, this is the mlmmj program managing the mailinglist + +$listaddr$ + +You are already subscribed to this list. + + +To unsubscribe send a message to: + +$listunsubaddr$ + +And for help send a message to: + +$helpaddr$ +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/listtexts/unsub-notsubscribed Sat May 07 23:10:49 2005 +1000 @@ -0,0 +1,17 @@ +Subject: Not subscribed to $listaddr$ + +Hi, this is the mlmmj program managing the mailinglist + +$listaddr$ + +You are not subscribed to this list, so you cannot unsubscribe. + + +To subscribe send a message to: + +$listsubaddr$ + +And for help send a message to: + +$helpaddr$ +
--- a/src/mlmmj-sub.c Wed May 04 19:37:54 2005 +1000 +++ b/src/mlmmj-sub.c Sat May 07 23:10:49 2005 +1000 @@ -240,6 +240,33 @@ exit(EXIT_SUCCESS); } +void generate_subscribed(const char *listdir, const char *listaddr, + const char *subaddr, const char *mlmmjsend) +{ + char *queuefilename, *fromaddr, *listname, *listfqdn; + + listname = genlistname(listaddr); + listfqdn = genlistfqdn(listaddr); + + fromaddr = concatstr(3, listname, "+bounces-help@", listfqdn); + + myfree(listname); + myfree(listfqdn); + + queuefilename = prepstdreply(listdir, "sub-subscribed", "$helpaddr$", + subaddr, NULL, 0, NULL); + MY_ASSERT(queuefilename); + + execlp(mlmmjsend, mlmmjsend, + "-l", "1", + "-T", subaddr, + "-F", fromaddr, + "-m", queuefilename, (char *)NULL); + log_error(LOG_ARGS, "execlp() of '%s' failed", mlmmjsend); + + exit(EXIT_FAILURE); +} + int main(int argc, char **argv) { char *listaddr, *listdir = NULL, *address = NULL, *subfilename = NULL; @@ -431,6 +458,9 @@ unlink(sublockname); myfree(sublockname); + printf("%s is already subscribed to %s.\n", address, listaddr); + generate_subscribed(listdir, listaddr, address, mlmmjsend); + return EXIT_SUCCESS; }
--- a/src/mlmmj-unsub.c Wed May 04 19:37:54 2005 +1000 +++ b/src/mlmmj-unsub.c Sat May 07 23:10:49 2005 +1000 @@ -284,6 +284,34 @@ exit(EXIT_SUCCESS); } +void generate_notsubscribed(const char *listdir, const char *listaddr, + const char *subaddr, const char *mlmmjsend) +{ + char *queuefilename, *fromaddr, *listname, *listfqdn; + + listname = genlistname(listaddr); + listfqdn = genlistfqdn(listaddr); + + fromaddr = concatstr(3, listname, "+bounces-help@", listfqdn); + + myfree(listname); + myfree(listfqdn); + + queuefilename = prepstdreply(listdir, "unsub-notsubscribed", + "$helpaddr$", subaddr, NULL, 0, NULL); + MY_ASSERT(queuefilename); + + execlp(mlmmjsend, mlmmjsend, + "-l", "1", + "-T", subaddr, + "-F", fromaddr, + "-m", queuefilename, (char *)NULL); + + log_error(LOG_ARGS, "execlp() of '%s' failed", mlmmjsend); + exit(EXIT_FAILURE); +} + + int main(int argc, char **argv) { int subread, subwrite, rlock, wlock, opt, unsubres, status, nomail = 0; @@ -400,9 +428,13 @@ } if(is_subbed_in(subddirname, address)) { - /* Address is not subscribed, so exit silently */ + /* Address is not subscribed */ myfree(subddirname); myfree(listaddr); + + printf("%s is not subscribed to %s.\n", address, listaddr); + generate_notsubscribed(listdir, listaddr, address, mlmmjsend); + exit(EXIT_SUCCESS); }