diff options
| -rw-r--r-- | imap/ChangeLog | 4 | ||||
| -rw-r--r-- | imap/pop3dcapa.c | 27 | ||||
| -rw-r--r-- | imap/pop3dserver.c | 8 | ||||
| -rw-r--r-- | imap/pop3login.c | 7 |
4 files changed, 45 insertions, 1 deletions
diff --git a/imap/ChangeLog b/imap/ChangeLog index d533530..034db3b 100644 --- a/imap/ChangeLog +++ b/imap/ChangeLog @@ -1,3 +1,7 @@ +2021-04-01 Sam Varshavchik <mrsam@courier-mta.com> + + * pop3d: pro-forma POP3 LANG extension. + 2021-03-28 Sam Varshavchik <mrsam@courier-mta.com> * pop3d-ssl.dist.in (TLS_STARTTLS_PROTOCOL): Remove duplicate entry diff --git a/imap/pop3dcapa.c b/imap/pop3dcapa.c index ca9e12e..b5885b1 100644 --- a/imap/pop3dcapa.c +++ b/imap/pop3dcapa.c @@ -85,6 +85,33 @@ void pop3dcapa() printf("TOP\r\nUSER\r\nLOGIN-DELAY 10\r\n" "PIPELINING\r\nUIDL\r\n" "UTF8 USER\r\n" + "LANG\r\n" "IMPLEMENTATION Courier Mail Server\r\n.\r\n"); fflush(stdout); } + +void pop3dlang(const char *lang) +{ + if (!lang) + { + printf("+OK Language listing follows:\r\n" + "en English\r\n" + "i-default Default language\r\n" + ".\r\n"); + fflush(stdout); + return; + } + + if (strcmp(lang, "*") == 0) + lang="en"; + + if (strcmp(lang, "en") == 0 || + strcmp(lang, "i-default") == 0) + { + printf("+OK %s King's English\r\n", lang); + fflush(stdout); + return; + } + printf("-ERR Language not available.\r\n"); + fflush(stdout); +} diff --git a/imap/pop3dserver.c b/imap/pop3dserver.c index ea5ed99..5e938ad 100644 --- a/imap/pop3dserver.c +++ b/imap/pop3dserver.c @@ -61,6 +61,8 @@ #define LISTVERSION 3 extern void pop3dcapa(); +extern void pop3dlang(const char *); + static void acctout(const char *disc); void rfc2045_error(const char *p) { @@ -1010,6 +1012,12 @@ int c; continue; } + if (strcmp(p, "LANG") == 0) + { + pop3dlang(strtok(NULL, "\r\n")); + continue; + } + if (strcmp(p, "DELE") == 0) { unsigned i; diff --git a/imap/pop3login.c b/imap/pop3login.c index 5a67fda..4d43a62 100644 --- a/imap/pop3login.c +++ b/imap/pop3login.c @@ -1,5 +1,5 @@ /* -** Copyright 1998 - 2020 Double Precision, Inc. +** Copyright 1998 - 2021 Double Precision, Inc. ** See COPYING for distribution information. */ @@ -31,6 +31,7 @@ extern void pop3dcapa(); +extern void pop3dlang(const char *); extern int have_starttls(); extern int tls_required(); extern const char *pop3_externalauth(); @@ -353,6 +354,10 @@ char *q ; { pop3dcapa(); continue; + } else if (strcmp(p, "LANG") == 0) + { + pop3dlang(strtok(0, "\r\n")); + continue; } else if (strcmp(p, "STLS") == 0) { if (!have_starttls()) |
