From: plugd Date: Thu, 3 Nov 2022 08:46:18 +0000 (+0100) Subject: Working on starttls implementation. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=7c7bf55c3a51913cd0b9a8e94941e3177af943fe;p=lambdamail.git Working on starttls implementation. --- diff --git a/lambdamail.scm b/lambdamail.scm index 7d37b30..7caf27e 100644 --- a/lambdamail.scm +++ b/lambdamail.scm @@ -2,7 +2,7 @@ ;; ;; Intended for a single-user system -(import tcp6 +(import tcp6 openssl (chicken port) (chicken io) (chicken string) @@ -118,8 +118,18 @@ "250-" (config-host config) " Hello " (smtp-command-args "ehlo" line)) (smtp-session 'send "250 AUTH PLAIN") - ;; (smtp-session 'send "250 STARTTLS") + (smtp-session 'send "250 STARTTLS") (loop mmsg received-messages)) + ((smtp-command? "starttls" line) + (let ((args (smtp-command-args "starttls" line))) + (if (= 0 (string-length args)) + (smtp-session 'send "501 Syntax error (no parameters allowed)") + (begin + (smtp-session 'send "220 Ready to start TLS") + + ;; TODO: initiate TLS handshake using (ssl-start*) + + )))) ((smtp-command? "auth plain" line) (let* ((auth-string (smtp-command-args "auth plain" line)) (auth-decoded (base64-decode auth-string))