summaryrefslogtreecommitdiff
path: root/src/qmail-dksign.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-18 15:15:18 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-18 15:15:18 +0200
commit7b4d3ab22988d021d5f12b81aec746f7e486fa52 (patch)
tree651e78e316411a39baadadb1cfaca450e1351c7f /src/qmail-dksign.c
parent25f74781424d5e13f0211c08cce8c2a1d60b9aec (diff)
update to 4.3.09
Diffstat (limited to 'src/qmail-dksign.c')
-rw-r--r--src/qmail-dksign.c17
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();