From 9837632ea985b87eb6aaa7f619a0b859fc6c40f6 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Thu, 18 Jul 2024 15:23:02 +0200 Subject: update to 4.3.10 --- INSTALL | 13 ++++++- conf-cc | 2 -- conf-ld | 5 +-- man/qmail-smtpd.8 | 93 ++++++++++++++++++++++++++++--------------------- src/Makefile | 8 ++--- src/condredirect.c | 2 +- src/datetime.c | 34 ++++++++++++++++++ src/datetime_un.c | 35 ------------------- src/headerbody.c | 6 +--- src/include/commands.h | 3 +- src/include/constmap.h | 4 +-- src/include/datetime.h | 4 +-- src/include/qmail.h | 2 ++ src/include/rcpthosts.h | 4 +-- src/qmail-authuser.c | 4 +-- src/qmail-dksign.c | 2 +- src/qmail-qmqpd.c | 10 +++--- src/qmail-qmtpd.c | 26 +++++++------- src/qmail-queue.c | 2 +- src/qmail-remote.c | 13 ++++--- src/qmail-send.c | 12 +++---- src/qmail-smtpd.c | 19 +++++----- src/qmail-todo.c | 2 +- src/rcpthosts.c | 4 +-- src/tls_timeoutio.c | 5 +-- src/trycrypt.c | 4 --- 26 files changed, 170 insertions(+), 148 deletions(-) delete mode 100644 src/datetime_un.c delete mode 100644 src/trycrypt.c diff --git a/INSTALL b/INSTALL index 88838d0..38014a7 100644 --- a/INSTALL +++ b/INSTALL @@ -244,6 +244,7 @@ D) DKIM CONFIGURATION Note: DKIM is inappropriate with QMTP(S) delivery. + E) MISCELLANEOUS 1. s/qmail comes with a full set of updated man-pages. @@ -263,7 +264,17 @@ E) MISCELLANEOUS 8. Start-scripts (for Daemontools) reside in ./service +F) INSTALLATION BUGS + +FreeBSD 14 has a bug not including some C++ headers: + + https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273661 + +A solution is given in that thread. + + + Visit https://www.fehcom.de/sqmail/sqmail.html to access online man-pages and documentation. -Date: February, 5th 2024 (feh) +Date: February, 26th 2024 (feh) diff --git a/conf-cc b/conf-cc index e6d003d..307ccfc 100644 --- a/conf-cc +++ b/conf-cc @@ -3,8 +3,6 @@ cc -O2 -Wall -Wno-narrowing -Iinclude -I`head -1 ../conf-qlibs`/include `head -1 # This will work for both i386 and AMD64 architecture enabling INET6 support. # IDN2 support is NOT enabled by default. You do not have 'libidns2' installed and set: -DIDN2 -# Bare 'Line Feeds' (LF) are accepted by qmail-smtpd setting: -DBARELF in the first line. - # For obfuscation, you can hide the virtual user's local part for VERP addresses; inappropriate for VPOPMAIL: cc -O2 -Wall -Wno-narrowing -Iinclude -I`head -1 ../conf-qlibs`/include `head -1 ../conf-ssl` -DHIDEVIRTUALUSER diff --git a/conf-ld b/conf-ld index 0ce8ac7..bb78ef8 100644 --- a/conf-ld +++ b/conf-ld @@ -4,8 +4,9 @@ cc -s -z noexecstack -m64 # This is for AMD64 architecture; use else: -cc -s +cc -s -lssl -lcrypto -# This will be used to link .o files into an executable. +# This will be used to link .o files into an executable with +# [Open|Libre]SSL in the default lib search path. # Note: UCSPI-SSL's conf-ld needs to use the same architecture! diff --git a/man/qmail-smtpd.8 b/man/qmail-smtpd.8 index 393ec28..09955bd 100644 --- a/man/qmail-smtpd.8 +++ b/man/qmail-smtpd.8 @@ -120,7 +120,8 @@ disables the lookup. .B qmail-smtpd converts the SMTP newline convention into the UNIX newline convention by converting CR LF into LF. -Usually, it returns a temporary error and drops the connection on bare LFs. +Usually, it returns a temporary error and drops the connection +on bare LF, if not adviced otherwise. .B qmail-smtpd accepts messages that contain long lines or non-ASCII characters @@ -331,7 +332,6 @@ with .EX +localaddress@mydomain.com .EE - .TP 5 .I databytes Maximum number of bytes allowed in a message, @@ -609,7 +609,7 @@ is defined and greater than 0 and .I RELAYCLIENT is not set. -.SH "ENVIRONMENT VARIABLES READ" +.SH "ENVIRONMENT VARIABLES RECOGNIZED" Environment variables may be defined globally in the .B qmail-smtpd startup script and/or individually as part of the @@ -633,6 +633,7 @@ as well as Additionally, .B qmail-smtpd may use several environment variables for different purposes. + .P Controlling the SMTP HELO/EHLO: .IP @@ -671,6 +672,7 @@ is 8 bit clean, setting of has no real consequences except for displaying this setting in the log as .IR ESMTP[SA]UTF8 . + .P Controlling the SMTP Mail From: .IP @@ -769,6 +771,15 @@ tarpitdelay is the time in seconds of delay to be introduced after each subsequent Rcpt To:. Smart Rejection Notes: +.TP 5 +.I RECIPIENTS450 +tells +.b qmail-smtpd +to issue a SMTP reply '450' (temporary rejection) +instead the default '550' +in case the recipient was not listed in any +.I recipients +cdb. If .IR TARPITCOUNT is set and @@ -788,15 +799,6 @@ is set and will issue after .IR TARPITCOUNT invalid Rcpt To: a Recipient failure -.TP 5 -.I RECIPIENTS450 -tells -.b qmail-smtpd -to issue a SMTP reply '450' (temporary rejection) -instead the default '550' -in case the recipient was not listed in any -.I recipients -cdb. .P Controlling the email body: @@ -834,7 +836,19 @@ Providing the check is disabled if in addition .IR RELAYCLIENTS are recognized. - +.TP 5 +.I BARELF +If set, +.B qmail-smtpd +will not strictly require the ending delimiter +CRLF for lines in the message header/body, +but rather will accept those with LF only. +If however, +.I BARELF='-' +is set, mails with bare line feeds (LF) are rejected. +Use this option to potentially inverse a global +.I BARELF +environment variable per connection. .TP 5 .I BASE64 tells QHPSI to enable virus checking only if a base64 encoded @@ -847,7 +861,7 @@ see control file .I QHPSI is used by .B qmail-smtpd -to supply the name of the virus scanner and it's path. +to supply the name of the virus scanner and its path. .P Environment variables for SMTP authentication: .IP @@ -914,14 +928,6 @@ Other environment variables used: .I DELIVERTO mail address for special recipients. .TP 5 -.I RBLSMTPD -feed from -.B rblsmtpd -including the information received from the -inquired RBL hosts and displayed as -.I X-RBL-Info: -message header. -.TP 5 .I POSTGREY triggering the call of .B qmail-postgrey @@ -932,7 +938,14 @@ server. If is set to .I - no lookup is performed. - +.TP 5 +.I RBLSMTPD +feed from +.B rblsmtpd +including the information received from the +inquired RBL hosts and displayed as +.I X-RBL-Info: +message header. .SH "CUSTOMIZABLE RETURN MESSAGES" In case of rejected or defered SMTP connections .B qmail-smtpd @@ -941,9 +954,18 @@ which are sandwiched between the reply code and the EMMSC. .B qmail-smtpd recognizes these environment variables: .TP 5 +.I REPLY_BADMAILFROM +following 553 badmail from +.TP 5 +.I REPLY_BADRCPTTO +following 553 badrcpt to +.TP 5 .I REPLY_GREYLISTED following 450 greylisting .TP 5 +.I REPLY_CONTENT +following 554 Message content invalid +.TP 5 .I REPLY_HELO following 550 Bad Helo .TP 5 @@ -953,50 +975,41 @@ following 550 mailbox not existing .I REPLY_MAXSIZE following 552 message size to large .TP 5 -.I REPLY_BADMAILFROM -following 553 badmail from -.TP 5 -.I REPLY_BADRCPTTO -following 553 badrcpt to +.I REPLY_NOGATEWAY +following 553 No gateway .TP 5 .I REPLY_SENDEREXIST following 553 SMTP sender DNS .TP 5 -.I REPLY_NOGATEWAY -following 553 No gateway -.TP 5 .I REPLY_SENDERINVALID following 553 SMTP sender invalid -.TP 5 -.I REPLY_CONTENT -following 554 Message content invalid .SH "ENVIRONMENT VARIABLES SET" By means of the following environment variables, the SMTP session can be interrogated: .TP 5 -.I HELOHOST -the HELO/EHLO greeting of the SMTP client. -.TP 5 .I AUTHPROTOCOL the ESMTPA protocol used for authentication. .TP 5 .I AUTHUSER the supplied username for authentication. .TP 5 +.I HELOHOST +the HELO/EHLO greeting of the SMTP client. +.TP 5 .I MAILFROM containes the received 'Mail From:' address. .TP 5 .I RCPTTO containes all received 'Rcpt To:' addresses separated by blanks. .TP 5 -.I TCP(6)REMOTEINFO -in authentication mode set to the accepted username. -.TP 5 .I SSL_* information from .BR sslserver , if applicable. +.TP 5 +.I TCP(6)REMOTEINFO +in authentication mode set to the accepted username. .SH "SEE ALSO" tcp-environ(5), diff --git a/src/Makefile b/src/Makefile index 2dc256e..1821978 100644 --- a/src/Makefile +++ b/src/Makefile @@ -235,17 +235,13 @@ warn-auto.sh datemail.sh ../conf-home ../conf-break ../conf-split chmod 755 datemail datetime.a: \ -makelib datetime.o datetime_un.o - ./makelib datetime.a datetime.o datetime_un.o +makelib datetime.o + ./makelib datetime.a datetime.o datetime.o: \ compile datetime.c ./compile datetime.c -datetime_un.o: \ -compile datetime_un.c - ./compile datetime_un.c - ddist: \ warn-auto.sh ddist.sh ../conf-home cat warn-auto.sh ddist.sh \ diff --git a/src/condredirect.c b/src/condredirect.c index 2e5cc11..92397bc 100644 --- a/src/condredirect.c +++ b/src/condredirect.c @@ -77,5 +77,5 @@ int main(int argc,char **argv) qmail_to(&qqt,argv[1]); qqx = qmail_close(&qqt); if (*qqx) logmsg(WHO,*qqx == 'D' ? 100 : 111,FATAL,qqx + 1); - logmsg(WHO,0,LOG,B("qp ",num)); + logmsg(WHO,99,INFO,B("qp ",num)); } diff --git a/src/datetime.c b/src/datetime.c index 3db5f7f..9048822 100644 --- a/src/datetime.c +++ b/src/datetime.c @@ -51,3 +51,37 @@ void datetime_tai(struct datetime *dt,datetime_sec t) dt->mon = mon; dt->mday = day + 1; } + +/* roughly 100x faster than mktime() */ + +datetime_sec datetime_untai(struct datetime *dt) +{ + int year; + int day; + int mon; + + year = dt->year + 1900; + + mon = dt->mon; + if (mon >= 2) { mon -= 2; } + else { mon += 10; --year; } + + day = (dt->mday - 1) * 10 + 5 + 306 * mon; + day /= 10; + + if (day == 365) { year -= 3; day = 1460; } + else { day += 365 * (year % 4); } + year /= 4; + + day += 1461 * (year % 25); + year /= 25; + + if (day == 36524) { year -= 3; day = 146096; } + else { day += 36524 * (year % 4); } + year /= 4; + + day += 146097 * (year - 5); + day += 11017; + + return ((day * 24 + dt->hour) * 60 + dt->min) * 60 + dt->sec; +} diff --git a/src/datetime_un.c b/src/datetime_un.c deleted file mode 100644 index e84806d..0000000 --- a/src/datetime_un.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "datetime.h" - -/* roughly 100x faster than mktime() */ - -datetime_sec datetime_untai(struct datetime *dt) -{ - int year; - int day; - int mon; - - year = dt->year + 1900; - - mon = dt->mon; - if (mon >= 2) { mon -= 2; } - else { mon += 10; --year; } - - day = (dt->mday - 1) * 10 + 5 + 306 * mon; - day /= 10; - - if (day == 365) { year -= 3; day = 1460; } - else { day += 365 * (year % 4); } - year /= 4; - - day += 1461 * (year % 25); - year /= 25; - - if (day == 36524) { year -= 3; day = 146096; } - else { day += 36524 * (year % 4); } - year /= 4; - - day += 146097 * (year - 5); - day += 11017; - - return ((day * 24 + dt->hour) * 60 + dt->min) * 60 + dt->sec; -} diff --git a/src/headerbody.c b/src/headerbody.c index 82c5684..069b0e7 100644 --- a/src/headerbody.c +++ b/src/headerbody.c @@ -18,11 +18,7 @@ static int getsa(buffer *b,stralloc *sa,int *match) static stralloc line = {0}; static stralloc nextline = {0}; -int headerbody(b,dohf,hdone,dobl) -buffer *b; -void (*dohf)(); -void (*hdone)(); -void (*dobl)(); +int headerbody(buffer *b,void (*dohf)(),void (*hdone)(),void (*dobl)()) { int match; int flaglineok; diff --git a/src/include/commands.h b/src/include/commands.h index 3fd2cb8..d16a4ea 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -1,5 +1,6 @@ #ifndef COMMANDS_H #define COMMANDS_H +#include "buffer.h" struct commands { char *text; @@ -7,6 +8,6 @@ struct commands { void (*flush)(); } ; -int commands(); +int commands(buffer *,struct commands *); #endif diff --git a/src/include/constmap.h b/src/include/constmap.h index 750702e..30bfde6 100644 --- a/src/include/constmap.h +++ b/src/include/constmap.h @@ -15,7 +15,7 @@ struct constmap { int constmap_init(struct constmap *,char *,int,int); int constmap_init_char(struct constmap *,char *,int,int,char); -void constmap_free(); -char *constmap(); +void constmap_free(struct constmap *); +char *constmap(struct constmap *,char *,int); #endif diff --git a/src/include/datetime.h b/src/include/datetime.h index 68d1618..5f53b36 100644 --- a/src/include/datetime.h +++ b/src/include/datetime.h @@ -14,7 +14,7 @@ struct datetime { typedef long datetime_sec; -void datetime_tai(); -datetime_sec datetime_untai(); +void datetime_tai(struct datetime *,datetime_sec); +datetime_sec datetime_untai(struct datetime *); #endif diff --git a/src/include/qmail.h b/src/include/qmail.h index dd44816..ef68ddb 100644 --- a/src/include/qmail.h +++ b/src/include/qmail.h @@ -7,7 +7,9 @@ #define BUFSIZE_MESS 4096 #define BUFSIZE_LINE 1024 // RFC 5322: 998 chars - why? - SMTP Line #define BUFSIZE_AUTH 512 +#define BUFSIZE_OUT 512 #define BUFSIZE_LOG 256 +#define BUFSIZE_SMALL 128 struct qmail { int flagerr; diff --git a/src/include/rcpthosts.h b/src/include/rcpthosts.h index 0c58797..8ab93a5 100644 --- a/src/include/rcpthosts.h +++ b/src/include/rcpthosts.h @@ -1,7 +1,7 @@ #ifndef RCPTHOSTS_H #define RCPTHOSTS_H -int rcpthosts_init(); -int rcpthosts(); +int rcpthosts_init(void); +int rcpthosts(char *,int); #endif diff --git a/src/qmail-authuser.c b/src/qmail-authuser.c index ff0891b..dea5647 100644 --- a/src/qmail-authuser.c +++ b/src/qmail-authuser.c @@ -78,7 +78,7 @@ stralloc shell = {0}; cram-md5/apop: (1,5) **/ -void exit(int fail) +static void exit(int fail) { int i; @@ -150,7 +150,7 @@ int auth_unix(char *user,char* response) { char *encrypted = 0; char *stored = 0; - int r = -1; + int r = 111; pw = getpwnam(user); if (pw) { diff --git a/src/qmail-dksign.c b/src/qmail-dksign.c index 8a2a2b7..4eef40e 100644 --- a/src/qmail-dksign.c +++ b/src/qmail-dksign.c @@ -503,7 +503,7 @@ int main(int argc,char **args) fdin = open_read(fndkout.s); if (fdin == -1) die_read(); } else { - fdin = fndkin.s; // DKIM key failed to sign + fdin = open_read(fndkin.s); // DKIM key failed to sign } } else temp_nosignkey(); diff --git a/src/qmail-qmqpd.c b/src/qmail-qmqpd.c index 4a2bc66..fc994c9 100644 --- a/src/qmail-qmqpd.c +++ b/src/qmail-qmqpd.c @@ -101,7 +101,6 @@ void identify() } char buf[BUFSIZE_LINE]; // sender/recipient buffer -char bufd[BUFSIZE_MESS]; // temporary data buffer char strnum[FMT_ULONG]; int getbuf() @@ -130,7 +129,7 @@ int main() char *result; unsigned long qp; unsigned long len; - unsigned long dlen; + char ch; sig_pipeignore(); sig_alarmcatch(resources); @@ -146,10 +145,9 @@ int main() identify(); while (len > 0) { /* XXX: could speed this up; done */ - dlen = (len < BUFSIZE_LINE) ? len : BUFSIZE_LINE; - buffer_get(&bi,bufd,dlen); - qmail_put(&qq,bufd,dlen); - len -= dlen; + getbyte(&ch); + --len; + qmail_put(&qq,&ch,1); } getcomma(); diff --git a/src/qmail-qmtpd.c b/src/qmail-qmtpd.c index 6478e21..b4a1c17 100644 --- a/src/qmail-qmtpd.c +++ b/src/qmail-qmtpd.c @@ -16,22 +16,25 @@ #include "received.h" #include "ip.h" #include "byte.h" +#include "timeout.h" +#include "error.h" #define PORT_QMTPS "6209" // string compare -#define QMTP_SIZE 200000000 // 190 MB transfer limit +#define QMTP_SIZE 200000000 // 23 MB transfer limit #define QMTP_TIMEOUT 3600 // 1 hour /** @file qmail-qmtpd.c -- QMTP/QMTPS server @brief requires sslserver */ +int timeout = QMTP_TIMEOUT; void badproto() { _exit(100); } void resources() { _exit(111); } ssize_t safewrite(int fd,char *buf,int len) { int r; - r = write(fd,buf,len); - if (r <= 0) _exit(0); + r = timeoutwrite(timeout,fd,buf,len); + if (r <= 0) _exit(1); return r; } @@ -42,8 +45,9 @@ ssize_t saferead(int fd,char *buf,int len) { int r; buffer_flush(&bo); - r = read(fd,buf,len); - if (r <= 0) _exit(0); + r = timeoutread(timeout,fd,buf,len); + if (r == -1) if (errno == ETIMEDOUT) { buffer_flush(&bo); _exit(1); } + if (r <= 0) _exit(1); return r; } @@ -75,8 +79,7 @@ unsigned int bytestooverflow = 0; struct qmail qq; char buf[BUFSIZE_LINE]; // sender/recipient buffer -char bufd[2 * BUFSIZE_MESS]; // temporary data buffer -char buf2[BUFFER_SMALL]; // QMTP message buffer +char buf2[BUFFER_SMALL]; char *remotehost; char *remoteinfo; @@ -149,7 +152,6 @@ int main() char ch; int i; unsigned long biglen; - unsigned long dlen; unsigned long len; int flagdos; int flagsenderok; @@ -243,11 +245,11 @@ int main() qmail_fail(&qq); } while (len > 0) { /* XXX: DJB: could speed this up, obviously; FEH: done */ - dlen = (len < BUFSIZE_LINE) ? len : BUFSIZE_LINE; - buffer_get(&bi,bufd,dlen); - qmail_put(&qq,bufd,dlen); - len -= dlen; + buffer_get(&bi,&ch,1); + --len; + qmail_put(&qq,&ch,1); } + } getcomma(); diff --git a/src/qmail-queue.c b/src/qmail-queue.c index 57f1224..a430f0e 100644 --- a/src/qmail-queue.c +++ b/src/qmail-queue.c @@ -248,7 +248,7 @@ int main() switch (buffer_copy(&bo,&bi)) { case -2: die_read(); - case -3: die_write(); + case -3: die_write(); // usual suspicious } if (buffer_flush(&bo) == -1) die_write(); if (fsync(messfd) == -1) die_write(); 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 */ diff --git a/src/qmail-send.c b/src/qmail-send.c index e8b9de6..b58a727 100644 --- a/src/qmail-send.c +++ b/src/qmail-send.c @@ -147,7 +147,7 @@ int getinfo(stralloc *sa,datetime_sec *dt,unsigned long id) struct stat st; static stralloc line = {0}; int match; - char buf[BUFFER_SMALL]; + char buf[BUFSIZE_SMALL]; buffer b; fnmake_info(id); @@ -578,8 +578,8 @@ int injectbounce(unsigned long id) int r; int fd; buffer bi; - char buf[BUFFER_SMALL]; - char inbuf[BUFFER_SMALL]; + char buf[BUFSIZE_SMALL]; + char inbuf[BUFSIZE_SMALL]; static stralloc sender = {0}; static stralloc quoted = {0}; datetime_sec birth; @@ -724,7 +724,7 @@ unsigned int concurrency[CHANNELS] = { 10, 20 }; unsigned int concurrencyused[CHANNELS] = { 0, 0 }; struct del *d[CHANNELS]; stralloc dline[CHANNELS]; -char delbuf[BUFSIZE_MESS]; +char delbuf[2048]; void del_status() { @@ -926,7 +926,7 @@ struct int fd; /* defined if id; reading from {local,remote} */ seek_pos mpos; /* defined if id; mark position */ buffer b; - char buf[BUFFER_SMALL]; + char buf[BUFSIZE_SMALL]; } pass[CHANNELS]; @@ -1142,7 +1142,7 @@ void pass_do() /* this file is too long ------------------------------------- EXTERNAL TODO */ stralloc todoline = {0}; -char todobuf[BUFSIZE_MESS]; +char todobuf[2048]; int todofdin; int todofdout; int flagtodoalive; diff --git a/src/qmail-smtpd.c b/src/qmail-smtpd.c index f01cbee..ba6a69d 100644 --- a/src/qmail-smtpd.c +++ b/src/qmail-smtpd.c @@ -157,6 +157,7 @@ char *local; char *localport; char *relayclient; int flagutf8 = 0; +int flaglf = 0; stralloc protocol = {0}; stralloc helohost = {0}; @@ -454,6 +455,10 @@ void setup() x = env_get("UTF8"); if (x) flagutf8 = 1; + x = env_get("BARELF"); + if (x) flaglf = 1; + if (flaglf && !case_diffs(x,"-")) flaglf = 0; + if (!stralloc_copys(&helohost,"")) die_nomem(); // helohost is initially empty if (!stralloc_0(&helohost)) die_nomem(); fakehelo = 0; @@ -1294,9 +1299,7 @@ void blast(int *hops) int flagmaybex; /* 1 if this line might match RECEIVED, if fih */ int flagmaybey; /* 1 if this line might match \r\n, if fih */ int flagmaybez; /* 1 if this line might match DELIVERED, if fih */ -#ifdef BARELF - int seencr = 0; -#endif + int seencr = 0; /* only required if flaglf is set */ state = 1; *hops = 0; @@ -1304,12 +1307,12 @@ void blast(int *hops) pos = 0; flagmaybex = flagmaybey = flagmaybez = 1; for (;;) { buffer_get(&bi,&ch,1); -#ifdef BARELF - if (ch == '\n') { - if (seencr == 0) { buffer_seek(&bi,-1); ch = '\r'; } + if (flaglf) { + if (ch == '\n') { + if (seencr == 0) { buffer_seek(&bi,-1); ch = '\r'; } + } + if (ch == '\r') seencr = 1; else seencr = 0; } - if (ch == '\r') seencr = 1; else seencr = 0; -#endif if (flaginheader) { if (pos < 9) { if (ch != "delivered"[pos]) if (ch != "DELIVERED"[pos]) flagmaybez = 0; diff --git a/src/qmail-todo.c b/src/qmail-todo.c index 09a5006..05a34c9 100644 --- a/src/qmail-todo.c +++ b/src/qmail-todo.c @@ -342,7 +342,7 @@ int flagtododir; /* if 0, have to opendir again */ readsubdir todosubdir; stralloc todoline = {0}; char todobuf[BUFSIZE_MESS]; -char todobufinfo[BUFSIZE_MESS]; +char todobufinfo[BUFSIZE_OUT]; char todobufchan[CHANNELS][BUF_CHANNELS]; void todo_init(void) diff --git a/src/rcpthosts.c b/src/rcpthosts.c index 2242249..d4a5c27 100644 --- a/src/rcpthosts.c +++ b/src/rcpthosts.c @@ -19,7 +19,7 @@ static int fdmrh; static struct cdb cdb; -int rcpthosts_init() +int rcpthosts_init(void) { flagrh = control_readfile(&rh,"control/rcpthosts",0); if (flagrh != 1) return flagrh; @@ -32,7 +32,7 @@ int rcpthosts_init() static stralloc host = {0}; -int rcpthosts(char *buf, int len) +int rcpthosts(char *buf,int len) { int j; int r; diff --git a/src/tls_timeoutio.c b/src/tls_timeoutio.c index c5f40a2..87aaec0 100644 --- a/src/tls_timeoutio.c +++ b/src/tls_timeoutio.c @@ -7,8 +7,9 @@ #include "ucspissl.h" #include "tls_timeoutio.h" -int tls_timeoutio(int (*fun)(), - int t, int rfd, int wfd, SSL *ssl, char *buf, int len) +// this function pointer needs to be replaced + +int tls_timeoutio(int (*fun)(),int t,int rfd,int wfd,SSL *ssl,char *buf,int len) { int n; const datetime_sec end = (datetime_sec)t + now(); diff --git a/src/trycrypt.c b/src/trycrypt.c deleted file mode 100644 index c32bd40..0000000 --- a/src/trycrypt.c +++ /dev/null @@ -1,4 +0,0 @@ -int main() -{ - ; -} -- cgit v1.2.3