diff options
Diffstat (limited to 'src/qmail-dksign.c')
-rw-r--r-- | src/qmail-dksign.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/qmail-dksign.c b/src/qmail-dksign.c index f5d4895..8a2a2b7 100644 --- a/src/qmail-dksign.c +++ b/src/qmail-dksign.c @@ -9,6 +9,7 @@ #include "buffer.h" #include "error.h" #include "auto_qmail.h" +#include "auto_queue.h" #include "control.h" #include "str.h" #include "exit.h" @@ -28,7 +29,7 @@ #define WHO "qmail-dksign" -#define DOMAINKEYS "ssl/domainkeys/" +#define DOMAINKEYS "/ssl/domainkeys/" /** @file qmail-dksign.c -- generate signature and attach in DKIM header to outgoing message @@ -59,7 +60,7 @@ char outbuf[BUFSIZE_MESS]; buffer bo = BUFFER_INIT(write,1,outbuf,sizeof(outbuf)); void die(int e) { _exit(e); } -void die_write(char *fn) { unlink(fn); die(53); }; +void die_write(char *fn) { unlink(fn); die(62); }; void die_read() { die(54); }; void out(char *s) { if (buffer_puts(&bo,s) == -1) _exit(111); } void zero() { if (buffer_put(&bo,"\0",1) == -1) _exit(111); } @@ -121,7 +122,7 @@ void temp_nosignkey() out(rsakey.s); out(" or "); out(ecckey.s); - out(". (#4.3.0)\n"); + out(". (#4.3.0)\n"); zerodie(); } @@ -202,6 +203,8 @@ void dkim_stage() struct stat st; char tmpbuf[BUFSIZE_MESS + 2]; // intermediate write buffer + if (chdir(auto_queue) == -1) temp_chdir(); + if (!stralloc_ready(&fndkin,FMTQFN)) temp_nomem(); if (!stralloc_ready(&fndkout,FMTQFN)) temp_nomem(); @@ -430,8 +433,6 @@ void dkim_setup() } } } - - return; } int main(int argc,char **args) @@ -470,11 +471,13 @@ int main(int argc,char **args) /* Setup keys: they are composed from selector */ case_lowerb(sender.s,sender.len); // needs to be lowercase - if (!stralloc_copys(&rsakey,DOMAINKEYS)) temp_nomem(); + if (!stralloc_copys(&rsakey,auto_qmail)) temp_nomem(); + if (!stralloc_cats(&rsakey,DOMAINKEYS)) temp_nomem(); if (!stralloc_cats(&rsakey,sender.s)) temp_nomem(); if (!stralloc_cats(&rsakey,"/")) temp_nomem(); - if (!stralloc_copys(&ecckey,DOMAINKEYS)) temp_nomem(); + if (!stralloc_copys(&ecckey,auto_qmail)) temp_nomem(); + if (!stralloc_cats(&ecckey,DOMAINKEYS)) temp_nomem(); if (!stralloc_cats(&ecckey,sender.s)) temp_nomem(); if (!stralloc_cats(&ecckey,"/")) temp_nomem(); |