;;
;; Intended for a single-user system
-(import tcp6
+(import tcp6 openssl
(chicken port)
(chicken io)
(chicken string)
"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))