Mercurial > hg > mlmmj
changeset 264:d3ade2c1f058
Make mlmmj-send capable of handling bouncing bounce probes to a local user on
the relay host.
author | mmj |
---|---|
date | Tue, 22 Jun 2004 17:07:10 +1000 |
parents | 5c8d908481bd |
children | f28ab75abba7 |
files | src/mlmmj-bounce.c src/mlmmj-send.c src/prepstdreply.c |
diffstat | 3 files changed, 34 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/mlmmj-bounce.c Tue Jun 22 17:06:32 2004 +1000 +++ b/src/mlmmj-bounce.c Tue Jun 22 17:07:10 2004 +1000 @@ -161,7 +161,8 @@ myfree(probefile); execlp(mlmmjsend, mlmmjsend, - "-l", "1", + "-l", "5", + "-L", listdir, "-T", myaddr, "-F", from, "-m", queuefilename, 0);
--- a/src/mlmmj-send.c Tue Jun 22 17:06:32 2004 +1000 +++ b/src/mlmmj-send.c Tue Jun 22 17:07:10 2004 +1000 @@ -418,7 +418,7 @@ char *replyto = NULL, *bounceaddr = NULL, *to_addr = NULL; char *relayhost = NULL, *archivefilename = NULL, *tmpstr; char *listctrl = NULL, *subddirname = NULL, *listdir = NULL; - char *mlmmjbounce = NULL, *bindir, *mailmap; + char *mlmmjbounce = NULL, *bindir, *mailmap, *probefile, *a; DIR *subddir; struct dirent *dp; struct stat st; @@ -493,10 +493,18 @@ exit(EXIT_FAILURE); } - if(listctrl[0] == '1' || listctrl[0] == '2' || listctrl[0] == '3') + switch(listctrl[0]) { + case '1': + case '2': + case '3': + case '4': + case '5': archive = 0; + default: + break; + } - if(listdir) + if(listdir && listctrl[0] != '5') listaddr = getlistaddr(listdir); /* initialize file with mail to send */ @@ -519,6 +527,7 @@ switch(listctrl[0]) { case '1': /* A single mail is to be sent, do nothing */ + case '5': break; case '2': /* Moderators */ subfilename = concatstr(2, listdir, "/control/moderators"); @@ -626,6 +635,24 @@ else endsmtp(&sockfd); break; + case '5': /* bounceprobe - handle relayhost local users bouncing*/ + initsmtp(&sockfd, relayhost); + sendres = send_mail(sockfd, bounceaddr, to_addr, replyto, + mailmap, st.st_size, listdir, NULL); + endsmtp(&sockfd); + if(sendres) { + /* error, so remove the probefile */ + tmpstr = mystrdup(to_addr); + a = strchr(tmpstr, '@'); + *a = '='; + probefile = concatstr(4, listdir, "/bounce/", tmpstr, + "-probe"); + log_error(LOG_ARGS, "probefile = [%s]", probefile); + unlink(probefile); + myfree(probefile); + myfree(tmpstr); + } + break; default: /* normal list mail */ subddirname = concatstr(2, listdir, "/subscribers.d/"); if((subddir = opendir(subddirname)) == NULL) {
--- a/src/prepstdreply.c Tue Jun 22 17:06:32 2004 +1000 +++ b/src/prepstdreply.c Tue Jun 22 17:07:10 2004 +1000 @@ -64,7 +64,7 @@ myfree(tmp); tmp = random_str(); - retstr = concatstr(3, listdir, "/queue/", random); + retstr = concatstr(3, listdir, "/queue/", tmp); myfree(tmp); outfd = open(retstr, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR); if(outfd < 0) {