# This file is part of GNU Mailutils. -*- Autotest -*- # Copyright (C) 2010-2012, 2014-2017 Free Software Foundation, Inc. # # GNU Mailutils is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3, or (at # your option) any later version. # # GNU Mailutils is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Mailutils. If not, see . AT_BANNER(forw) m4_pushdef([MH_KEYWORDS],[forw]) m4_pushdef([forwcmd],[forw -editor $abs_top_srcdir/mh/tests/mhed]) MH_CHECK([forw msg],[forw00 forw-msg],[ mkdir Mail/inbox AT_DATA([Mail/inbox/1],[From: gray To: root Subject: test input message body ]) echo quit | forwcmd +inbox 1 | remove_curdir echo == Mail/draft == cat Mail/draft echo == Message == # FIXME: AMD adds this header to the first message. Find a better way. # See also the same sed hacks below. sed '/^X-IMAPbase/d' Mail/inbox/1 ], [0], [-- Editor invocation: Mail/draft -- Input file: To: cc: Subject: -------- ------- Forwarded message From: gray To: root Subject: test input message body ------- End of Forwarded message -- Input file end What now? draft left on "Mail/draft". == Mail/draft == To: cc: Subject: -------- ------- Forwarded message From: gray To: root Subject: test input message body ------- End of Forwarded message Seen by mhed == Message == From: gray To: root Subject: test input message body ]) MH_CHECK([forw -format msg],[forw01 forw-format-msg],[ mkdir Mail/inbox AT_DATA([Mail/inbox/1],[From: gray To: root Subject: test input message body ]) echo quit | forwcmd -format +inbox 1 | remove_curdir echo == Mail/draft == cat Mail/draft echo == Message == # FIXME: AMD adds this header to the first message. Find a better way. # See also the same sed hacks below. sed '/^X-IMAPbase/d' Mail/inbox/1 ], [0], [-- Editor invocation: Mail/draft -- Input file: To: cc: Subject: -------- ------- Forwarded message From: gray To: root Subject: test input message body ------- End of Forwarded message -- Input file end What now? draft left on "Mail/draft". == Mail/draft == To: cc: Subject: -------- ------- Forwarded message From: gray To: root Subject: test input message body ------- End of Forwarded message Seen by mhed == Message == From: gray To: root Subject: test input message body ]) MH_CHECK([forw msgs],[forw02 forw-msgs],[ mkdir Mail/inbox AT_DATA([Mail/inbox/1],[From: gray To: root Subject: test input message body ]) AT_DATA([Mail/inbox/2],[From: gray To: marlow Subject: 2nd message 2nd message body ]) echo quit | forwcmd +inbox 1 2 | remove_curdir echo == Mail/draft == cat Mail/draft echo == Message 1 == sed '/^X-IMAPbase/d' Mail/inbox/1 echo == Message 2 == cat Mail/inbox/2 ], [0], [-- Editor invocation: Mail/draft -- Input file: To: cc: Subject: -------- ------- Forwarded messages ------- Message 1 From: gray To: root Subject: test input message body ------- Message 2 From: gray To: marlow Subject: 2nd message 2nd message body ------- End of Forwarded messages -- Input file end What now? draft left on "Mail/draft". == Mail/draft == To: cc: Subject: -------- ------- Forwarded messages ------- Message 1 From: gray To: root Subject: test input message body ------- Message 2 From: gray To: marlow Subject: 2nd message 2nd message body ------- End of Forwarded messages Seen by mhed == Message 1 == From: gray To: root Subject: test input message body == Message 2 == From: gray To: marlow Subject: 2nd message 2nd message body ]) MH_CHECK([forw -build msg],[forw03 forw-build-msg],[ mkdir Mail/inbox AT_DATA([Mail/inbox/1],[From: gray To: root Subject: test input message body ]) forwcmd -build +inbox 1 | remove_curdir echo == Mail/draft == cat Mail/draft echo == Message == sed '/^X-IMAPbase/d' Mail/inbox/1 ], [0], [== Mail/draft == To: cc: Subject: -------- ------- Forwarded message From: gray To: root Subject: test input message body ------- End of Forwarded message == Message == From: gray To: root Subject: test input message body ]) MH_CHECK([forw -build -mime msgs],[forw04 forw-build-mime-msg],[ mkdir Mail/inbox AT_DATA([Mail/inbox/1],[From: gray To: root Subject: test input message body ]) AT_DATA([Mail/inbox/2],[From: gray To: marlow Subject: 2nd message 2nd message body ]) forwcmd -build -mime +inbox 1 2 | remove_curdir echo == Mail/draft == remove_curdir Mail/draft echo == Message 1 == sed '/^X-IMAPbase/d' Mail/inbox/1 echo == Message 2 == cat Mail/inbox/2 ], [0], [== Mail/draft == To: cc: Subject: -------- #forw [] +Mail/inbox 1 2 == Message 1 == From: gray To: root Subject: test input message body == Message 2 == From: gray To: marlow Subject: 2nd message 2nd message body ]) MH_CHECK([forw -draftfolder],[forw05 forw-draftfolder draftfolder],[ mkdir Mail/inbox mkdir Mail/drafts AT_DATA([Mail/inbox/1],[From: gray To: root Subject: test input message body ]) echo "quit" | forwcmd -draftfolder drafts 1 | remove_curdir echo == Mail/drafts/1 == cat Mail/drafts/1 echo == Message == sed '/^X-IMAPbase/d' Mail/inbox/1 ], [0], [-- Editor invocation: Mail/drafts/1 -- Input file: To: cc: Subject: -------- ------- Forwarded message From: gray To: root Subject: test input message body ------- End of Forwarded message -- Input file end What now? draft left on "Mail/drafts/1". == Mail/drafts/1 == To: cc: Subject: -------- ------- Forwarded message From: gray To: root Subject: test input message body ------- End of Forwarded message Seen by mhed == Message == From: gray To: root Subject: test input message body ]) MH_CHECK([forw -file],[forw06 forw-file],[ AT_DATA([infile],[From: gray To: root Subject: test input message body ]) echo "quit" | forwcmd -file infile | remove_curdir ], [0], [-- Editor invocation: Mail/draft -- Input file: To: cc: Subject: -------- From: gray To: root Subject: test input message body -- Input file end What now? draft left on "Mail/draft". ]) m4_popdef([forwcmd]) m4_popdef([MH_KEYWORDS]) # End of forw.at