From 5eca7581c72727160de86c5590d4ffbf8c4fefc1 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 27 Feb 2019 15:20:42 +0100 Subject: some begin --- pith/send.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/pith/send.c b/pith/send.c index 8d4d419a..024fc9ac 100644 --- a/pith/send.c +++ b/pith/send.c @@ -1705,6 +1705,62 @@ call_mailer(METAENV *header, struct mail_bodystruct *body, char **alt_smtp_serve return(0); } + /* add hashcash stamps */ + +FILE* log_file; +log_file=fopen("/tmp/alpine.log","a"); + +fprintf(log_file,"a\n"); fflush(log_file); + + int header_count=0; + int addresses_count=0; + for(pf = header->local; pf && pf->name; pf = pf->next) { + header_count++; + if(pf->type == Address && pf->rcptto && pf->addr && *pf->addr) + addresses_count++; + } +fprintf(log_file,"%u %u b\n",header_count,addresses_count); fflush(log_file); + addresses_count=1; // for now + fs_resize((void**)&header->local, (size_t)(header_count+100+addresses_count)*sizeof(PINEFIELD)); +fprintf(log_file,"%u c\n", &header->local); fflush(log_file); +// fs_resize((void**)&header->local, (size_t)header_count*sizeof(PINEFIELD)); +/* + PINEFIELD *hashcashs = &header->local[header_count]; + if (header_count>0) + header->local[header_count-1].next = hashcashs; + memset(hashcashs, 0, (size_t)addresses_count*sizeof(PINEFIELD)); + hashcashs->name = (char*)fs_get((size_t)11*sizeof(char)); + memset(hashcashs->name, 0, (size_t)11*sizeof(char)); + snprintf(hashcashs->name, 10, "X-Hashcash"); + hashcashs->name[10] = '\0'; + hashcashs->type = FreeText; + hashcashs->canedit = 0; + hashcashs->writehdr = 1; + hashcashs->localcopy = 0; + hashcashs->posterr = 0; + hashcashs->textbuf = (char*)fs_get((size_t)16*sizeof(char)); + hashcashs->text = &hashcashs->textbuf; +fprintf(log_file,"d\n"); fflush(log_file); + +// fs_resize(&hashcashs->text, (size_t)2*sizeof(char*)); +// hashcashs->text[1] = hashcashs->textbuf; + memcpy(hashcashs->textbuf, hashcashs->name, 10); +// memcpy(hashcashs->text[1], hashcashs->name+3, 6); + hashcashs->textbuf[11]='\0'; */ +// hashcashs->text[1][6]='\0'; + +fprintf(log_file,"ende\n"); fflush(log_file); +fclose(log_file); + +/* for(pf = header->local; pf && pf->name; pf = pf->next) + * if(pf->type == Address && pf->rcptto && pf->addr && *pf->addr){ + * Inhalt geht nach text (welcher Index?) + * for (ADDRESS *mint_address = *pf->addr; mint_address; mint_address = mint_address -> next){ + * Adressat: mint_address -> mailbox "@" mint_address -> host + * } + * } + */ + #ifdef SMIME if(ps_global->smime && (ps_global->smime->do_encrypt || ps_global->smime->do_sign)){ int result; -- cgit v1.2.3-70-g09d2