1# This file is part of GNU Mailutils.
2# Copyright (C) 2007-2021 Free Software Foundation, Inc.
3#
4# GNU Mailutils is free software; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License as
6# published by the Free Software Foundation; either version 3, or (at
7# your option) any later version.
8#
9# GNU Mailutils is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12# General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
16
17INPUT_MSG=$abs_top_srcdir/mda/tests/input.msg
18dumpmail() {
19    case $MU_DEFAULT_SCHEME in
20	mbox)
21	    sed -e '/^From /d'\
22		-e /^X-IMAPbase:/d\
23                -e /^X-UID:/d $1
24	    ;;
25	dotmail)
26	    sed -e '/^\.$/d'\
27		-e /^X-IMAPbase:/d\
28                -e /^X-UID:/d $1
29	    ;;
30	mh)
31	    sed -e /^X-IMAPbase:/d\
32                -e /^X-UID:/d\
33                -e /^X-Envelope-Sender:/d\
34                -e /^X-Envelope-Date:/d $1/1
35	    ;;
36	maildir)
37	    f=$(find $1/new -type f | head -n 1)
38	    if test -n $f; then
39		sed -e /^X-IMAPbase:/d\
40                    -e /^X-UID:/d\
41                    -e /^X-Envelope-Sender:/d\
42                    -e /^X-Envelope-Date:/d $f
43	    fi
44	    ;;
45	*)  # Should not happen
46	    echo >&2 "Default mailbox format is uknown"
47    esac
48}
49