The Lambda Lab
/
projects
/
lambdamail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e652fcc
)
Working on starttls implementation.
author
plugd
<plugd@tiny.fimnet>
Thu, 3 Nov 2022 08:46:18 +0000
(09:46 +0100)
committer
plugd
<plugd@tiny.fimnet>
Thu, 3 Nov 2022 08:46:18 +0000
(09:46 +0100)
lambdamail.scm
patch
|
blob
|
history
diff --git
a/lambdamail.scm
b/lambdamail.scm
index
7d37b30
..
7caf27e
100644
(file)
--- a/
lambdamail.scm
+++ b/
lambdamail.scm
@@
-2,7
+2,7
@@
;;
;; Intended for a single-user system
;;
;; Intended for a single-user system
-(import tcp6
+(import tcp6
openssl
(chicken port)
(chicken io)
(chicken string)
(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")
"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))
(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))
((smtp-command? "auth plain" line)
(let* ((auth-string (smtp-command-args "auth plain" line))
(auth-decoded (base64-decode auth-string))