# This file is part of GNU Mailutils -*- Autotest -*- # Copyright (C) 2018-2021 Free Software Foundation, Inc. # License GPLv3+: GNU GPL version 3 or later # 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]) dnl Initial mailbox is modified after append (uidvalidity and uid values dnl added). Since the exact number of bytes added to each message cannot dnl be reliably predicted, we remove the line and byte count from comparison. dnl Additionally, the newly added X-UID header is also removed. m4_pushdef([MU_GUILE_OUTPUT_FILTER], [sed -e '/#/>/' \ -e /^X-UID:/d ]) 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, [# # # # # # 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 m4_popdef([MU_GUILE_OUTPUT_FILTER]) dnl depends on: dnl message-print.at dnl message-port-read-2.at dnl mailbox-open.at dnl mailbox-iterate.at dnl