1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
# This file is part of GNU Mailutils -*- Autotest -*-
# Copyright (C) 2018 Free Software Foundation, Inc.
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.
AT_SETUP([mu-mailbox-append-message])
AT_KEYWORDS([mailbox])
WITH_MAILBOX([spool/mbox1],
[MU_GUILE_CHECK([
(use-modules ((ice-9 binary-ports)))
(let ((mbox (mu-mailbox-open "mbox" "rw")))
(mu-mailbox-append-message mbox (test-message))
(mu-mailbox-close mbox))
(let ((mbox (mu-mailbox-open "mbox" "r")))
(do ((msg (mu-mailbox-first-message mbox) (mu-mailbox-next-message mbox)))
((not (mu-mailbox-more-messages? mbox)))
(display msg)(newline))
(let ((port (mu-message-get-port (mu-mailbox-get-message mbox 6) "r" #t)))
(do ((c (get-u8 port) (get-u8 port)))
((eof-object? c))
(put-u8 (current-output-port) c))
(close port)))],
0,
[#<message "foobar@nonexistent.net" "Fri Dec 28 22:18" 44 1254>
#<message "bar@dontmailme.org" "Fri Dec 28 23:28" 13 534>
#<message "gray@example.net" "Sat Jul 13 00:43" 42 1569>
#<message "gray@example.net" "Sat Jul 13 00:50" 84 3399>
#<message "gray@example.net" "Sat Jul 13 00:43" 27 857>
#<message "user@example.org" "Fri Jun 8 14:30" 10 539>
From: user@example.org
To: someone@example.com
Subject: De omnibus rebus et quibusdam aliis
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
])])
AT_CLEANUP
dnl depends on:
dnl message-print.at
dnl message-port-read-2.at
dnl mailbox-open.at
dnl mailbox-iterate.at
dnl
|