diff options
Diffstat (limited to 'src/qmail-smtpd.c')
-rw-r--r-- | src/qmail-smtpd.c | 19 |
1 files changed, 11 insertions, 8 deletions
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; |