summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
Diffstat (limited to 'pith')
-rw-r--r--pith/send.c56
1 files changed, 56 insertions, 0 deletions
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;