summaryrefslogtreecommitdiff
path: root/src/qmail-remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmail-remote.c')
-rw-r--r--src/qmail-remote.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/qmail-remote.c b/src/qmail-remote.c
index a6ef155..5440a22 100644
--- a/src/qmail-remote.c
+++ b/src/qmail-remote.c
@@ -389,13 +389,13 @@ void blast()
while ((r = buffer_get(&bi,inbuf,sizeof(inbuf)))) { // read into buffer
if (r == -1) temp_read();
- for (in = out = 0; in < r;) {
+ for (in = out = 0; in <= r;) {
if (eom && inbuf[in] == '.') {
tmpbuf[out++] = '.';
tmpbuf[out++] = inbuf[in++];
}
eom = 0;
- while (in < r) {
+ while (in <= r) {
if (inbuf[in] == '\r') { in++; continue; } // CR is DKIM input
if (inbuf[in] == '\n') {
eom = 1;
@@ -946,7 +946,12 @@ void qmtp()
/* the following code was substantially taken from serialmail's serialqmtp.c */
- scan_ulong(msgsize,&len);
+ if (msize)
+ len = msize;
+ else {
+ out("DMessage for: "); outhost(); out(" has zero bytes. Giving up.\n");
+ }
+
buffer_put(&bo,num,fmt_ulong(num,len + 1));
buffer_put(&bo,":\n",2);
while (len > 0) {
@@ -1339,7 +1344,7 @@ int main(int argc,char **argv)
if (port == PORT_QMTPS) flagtls += 20;
}
- if (flagtls == 8) flagverify = -1;
+ if (flagtls == 8 || flagtls == 18 || flagtls == 28) flagverify = -1; /* no TLSA */
if (!flagtls && qmtpsend == 2) flagtls = 20; /* QMTPS */