|
302 | 302 |
|
303 | 303 | )) |
304 | 304 |
|
305 | | - (capability '8bitmime (list |
| 305 | + (capability 'unicode-messages (list |
306 | 306 |
|
307 | 307 | (define smtp-connection '()) |
308 | 308 | (define (connect-smtp-server) |
|
319 | 319 | (define (activate-8bitmime server) |
320 | 320 | (server-set-extensions! server '("8BITMIME"))) |
321 | 321 |
|
322 | | - (capability 'mandatory-options (list |
| 322 | + ; The library can handle unicode messages by using the 8BITMIME extension but users have to set the option explicitly. |
| 323 | + (capability '8bitmime-mandatory-options (list |
323 | 324 |
|
324 | 325 | ; 6152 - Section 3, end of section |
325 | | - (test "non-ascii content in send-message without 8BITMIME support" (lambda () |
326 | | - |
| 326 | + (test "non-ascii content in send-message with 8BITMIME option and without 8BITMIME server support" (lambda () |
327 | 327 | (let |
328 | 328 | ((send-message-responses (sendmail-send-message-with-options |
329 | 329 | smtp-connection "¡a test message containing unicode!" "sender@sender.com" '("user@recipient.com") '("BODY=8BITMIME") '()))) |
330 | 330 | (assert (all? send-error? send-message-responses) "Client should not support sending 8BITMIME body when server does not support it")))) |
331 | 331 |
|
332 | | - (test "non-ascii content in send-message without 8BITMIME support and no option" (lambda () |
333 | | - |
334 | | - (let |
335 | | - ((send-message-responses (sendmail-send-message-with-options |
336 | | - smtp-connection "¡a test message containing unicode!" "sender@sender.com" '("user@recipient.com") '() '()))) |
337 | | - (assert (all? send-error? send-message-responses))))) |
| 332 | + ; TODO: Missing test: use fallback encoding when 8BITMIME options was not set (independent of server support) |
338 | 333 |
|
339 | | - (test "non-ascii content in send-message with 8BITMIME support and option" (lambda () |
| 334 | + (test "non-ascii content in send-message with 8BITMIME option and server support" (lambda () |
340 | 335 | (activate-8bitmime server) |
341 | | - |
342 | 336 | (let |
343 | 337 | ((send-message-responses (sendmail-send-message-with-options |
344 | 338 | smtp-connection "¡a test message containing unicode!" "sender@sender.com" '("user@recipient.com") '("BODY=8BITMIME") '()))) |
345 | 339 | (assert (all? send-success? send-message-responses)) |
346 | 340 | (assert-any-request server "MAIL FROM:<sender@sender.com> BODY=8BITMIME")))) |
347 | | - |
348 | | - (test "non-ascii content in send-message with 8BITMIME support and no option" (lambda () |
349 | | - (activate-8bitmime server) |
350 | | - |
351 | | - (let |
352 | | - ((send-message-responses (sendmail-send-message-with-options |
353 | | - smtp-connection "¡a test message containing unicode!" "sender@sender.com" '("user@recipient.com") '() '()))) |
354 | | - (assert (all? send-error? send-message-responses))))) |
355 | 341 |
|
356 | 342 | )) |
357 | 343 |
|
358 | | - (capability 'automatic-8bitmime-detection (list |
| 344 | + ; The library can handle unicode messages by using the 8BITMIME extension and detects it automatically. |
| 345 | + (capability '8bitmime-automatic-detection (list |
359 | 346 |
|
| 347 | + ; TODO: The following is not useful, as it should also check whether the message body was correctly encoded |
360 | 348 | (test "non-ascii content in send-message without 8BITMIME support" (lambda () |
361 | | - |
362 | 349 | (let |
363 | 350 | ((send-message-responses (sendmail-send-message-with-options |
364 | 351 | smtp-connection "¡a test message containing unicode!" "sender@sender.com" '("user@recipient.com") '() '()))) |
365 | | - (assert (all? send-error? send-message-responses))))) |
| 352 | + (assert-any-request server "MAIL FROM:<sender@sender.com>")))) |
366 | 353 |
|
367 | 354 | (test "non-ascii content in send-message with 8BITMIME support" (lambda () |
368 | 355 | (activate-8bitmime server) |
369 | | - |
370 | 356 | (let |
371 | 357 | ((send-message-responses (sendmail-send-message-with-options |
372 | 358 | smtp-connection "¡a test message containing unicode!" "sender@sender.com" '("user@recipient.com") '() '()))) |
|
377 | 363 |
|
378 | 364 | )) |
379 | 365 |
|
380 | | - (capability 'smtputf8 (list |
| 366 | + (capability 'internationalized-email-addresses (list |
381 | 367 |
|
382 | 368 | (define smtp-connection '()) |
383 | 369 | (define (connect-smtp-server) |
|
397 | 383 | (define (activate-smtputf8 server) |
398 | 384 | (server-set-extensions! server '("SMTPUTF8" "8BITMIME"))) |
399 | 385 |
|
400 | | - (capability 'explicit-options (list |
| 386 | + (capability 'smtputf8-explicit-options (list |
401 | 387 |
|
402 | 388 | ; Recipient |
403 | 389 |
|
|
466 | 452 | (assert (all? send-error? send-message-responses))))) |
467 | 453 | )) |
468 | 454 |
|
469 | | - (capability 'automatic-smtputf8-detection (list |
| 455 | + (capability 'smtputf8-automatic-detection (list |
470 | 456 |
|
471 | 457 | ; Recipient |
472 | 458 |
|
|
0 commit comments