summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-06-04 20:47:24 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-06-04 20:47:24 +0000
commit6373687fb1bf6d785ad18581126cc0df0dbc335b (patch)
tree9bde47d67820388782e560c237680d0f4d141a2f /src
parenteb9672690c8cd08572556b689951639d04ff7c63 (diff)
downloadsmtpd-starttls-proxy-6373687fb1bf6d785ad18581126cc0df0dbc335b.tar.xz
Doc, and some important optimizations
Diffstat (limited to 'src')
-rw-r--r--src/smtpd-starttls-proxy/smtpd-starttls-proxy-io.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/smtpd-starttls-proxy/smtpd-starttls-proxy-io.c b/src/smtpd-starttls-proxy/smtpd-starttls-proxy-io.c
index 950b987..74e97ae 100644
--- a/src/smtpd-starttls-proxy/smtpd-starttls-proxy-io.c
+++ b/src/smtpd-starttls-proxy/smtpd-starttls-proxy-io.c
@@ -9,7 +9,6 @@
#include <skalibs/gccattributes.h>
#include <skalibs/posixplz.h>
#include <skalibs/types.h>
-#include <skalibs/bytestr.h>
#include <skalibs/sgetopt.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/buffer.h>
@@ -98,7 +97,7 @@ static int answer_forward (char const *s)
static int answer_ehlo (char const *s)
{
static int needed = 1 ;
- if (needed && s[0] == '2' && case_starts(s+4, "starttls"))
+ if (needed && s[0] == '2' && !strncasecmp(s+4, "starttls", 8))
{
needed = 0 ;
strerr_warni1x("server seems to support STARTTLS natively") ;
@@ -161,7 +160,7 @@ static int do_forward (char const *s)
static int do_badorder (char const *s)
{
(void)s ;
- answer_enqueue("503 MAIL has to come first\r\n") ;
+ answer_enqueue("503 MAIL first. Are you like this with girls too?\r\n") ;
return 0 ;
}
@@ -196,7 +195,7 @@ static int do_notls (char const *s)
static int do_starttls (char const *s)
{
if (buffer_len(&io[0].in))
- answer_enqueue("503 STARTTLS must be the last command in a group\r\n") ;
+ answer_enqueue("503 Stop yammering after saying STARTTLS\r\n") ;
else
{
command_enqueue("RSET\r\n", &trigger_starttls) ;
@@ -233,7 +232,7 @@ static int process_client_line (char const *s)
break ;
}
if (cmd->name) return (*cmd->f)(s) ;
- answer_enqueue("500 SMTP mother!@#$er, do you speak it\r\n") ;
+ answer_enqueue("500 SMTP motherfucker, do you speak it?\r\n") ;
return 0 ;
}