File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 176176 (server-requests-with-command server "MAIL"))
177177 (string-append "Expected client to send empty sender: " (server-requests-with-command server "MAIL"))))))
178178
179- ; TODO: CC and BCC
179+ (test "Send a message to cc recipients" (lambda ()
180+ (let
181+ ((responses (sendmail-send-message-full smtp-connection "message content" "sender@sender.to" '() '("user1@recipient.to") '() (make-hash-table) '() '())))
182+ (assert (all? send-success? responses))
183+ (assert (server-message-contains? "user1@recipient.to"))
184+ (assert
185+ (any?
186+ (lambda (request)
187+ (string-prefix-ci? "TO:<user1@recipient.to>" (first (request-arguments request))))
188+ (server-requests-with-command server "RCPT"))
189+ (string-append "Expected client to send RCPT command for cc recipients: " (server-requests-with-command server "RCPT"))))))
190+
191+ (test "Send a message to bcc recipients" (lambda ()
192+ (let
193+ ((responses (sendmail-send-message-full smtp-connection "message content" "sender@sender.to" '() '() '("user1@recipient.to") (make-hash-table) '() '())))
194+ (assert (all? send-success? responses))
195+ (assert (not (server-message-contains? "user1@recipient.to")))
196+ (assert
197+ (any?
198+ (lambda (request)
199+ (string-prefix-ci? "TO:<user1@recipient.to>" (first (request-arguments request))))
200+ (server-requests-with-command server "RCPT"))
201+ (string-append "Expected client to send RCPT command for bcc recipients: " (server-requests-with-command server "RCPT"))))))
180202
181203 ; TODO
182204 ;(test "Send message with a valid and an invalid recipient" (lambda ()
You can’t perform that action at this time.
0 commit comments