diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-18 15:23:02 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-18 15:23:02 +0200 |
commit | 9837632ea985b87eb6aaa7f619a0b859fc6c40f6 (patch) | |
tree | f143461843ba2fdaa8e7499ebf52afda3eb08cd4 /src/qmail-smtpd.c | |
parent | 7b4d3ab22988d021d5f12b81aec746f7e486fa52 (diff) |
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; |