From d1856db926a2f493b8eabc8b5138d986df068690 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 23 May 2019 14:15:12 +0200 Subject: pith/send.c: generating hashes works - but they are not yet stored in headers :-( --- pith/send.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pith/send.c b/pith/send.c index ba2f709b..dfcaf988 100644 --- a/pith/send.c +++ b/pith/send.c @@ -1716,8 +1716,24 @@ fprintf(log_file,"a\n"); fflush(log_file); int addresses_count=0; for(pf = header->local; pf; pf = pf->next) { header_count++; - if(pf->type == Address && pf->rcptto && pf->addr && *pf->addr) - addresses_count++; + if(pf->type == Address && pf->rcptto && pf->addr) { + for (a = *pf->addr; a; a = a -> next) { + FILE *fp; + char cmd[128]; + char output[1024]; + snprintf(cmd, 128, "/usr/bin/hashcash -mq -r %s@%s",a->mailbox, a->host); + fp = popen(cmd, "r"); + if (fp != NULL) { + while (!feof(fp)) { + if (fgets(output, 1024, fp) != NULL) { +// fprintf(log_file,"'%s'\n", output); fflush(log_file); + addresses_count++; + } + } + pclose(fp); + } + } + } } fprintf(log_file,"%u %u b\n",header_count,addresses_count); fflush(log_file); -- cgit v1.2.3-54-g00ecf