summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-05-23 14:15:12 +0200
committerErich Eckner <git@eckner.net>2021-01-20 19:19:09 +0100
commitd1856db926a2f493b8eabc8b5138d986df068690 (patch)
tree872d0e233f5ce278ef8841586df0227acc6d5664
parent64fd1758e3ad5084e7b168baec8618fa4a72db5b (diff)
downloadalpine-d1856db926a2f493b8eabc8b5138d986df068690.tar.xz
pith/send.c: generating hashes works - but they are not yet stored in headers :-(
-rw-r--r--pith/send.c20
1 files 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);