archive-mail

Maintains maildir archives synced with current maildirs

git clone https://git.8pit.net/archive-mail.git

 1#!/bin/sh
 2. "${0%/*}/common.sh"
 3
 4mmkdir current1 archive1 expected1 \
 5	current2 archive2 expected2
 6
 7add_mail current2/cur/1:2, archive1/cur/1:2, expected2/cur/1:2, <<-EOF
 8	From: Hans Acker <hans@example.com>
 9	Subject: Moved between maildirs
10	Date: Thu, 23 Mar 2023 15:42:23 +0200
11	Message-Id: <EOH1F3NUOY.2KBVMHSBFATNY@example.org>
12
13	This message was in maildir1 and moved to maildir2.
14EOF
15
16add_mail current1/cur/2:2, archive1/cur/2:2, expected1/cur/2:2, <<-EOF
17	From: Some One <example@example.com>
18	Subject: Unmodified Message v1
19	Date: Mon, 23 Dez 2313 12:23:42 +0200
20	Message-Id: <RADNE23UOY.2KBVMHSBFATNY@example.org>
21
22	This message is already in the archive.
23EOF
24
25add_mail current2/cur/3:2, expected2/cur/3:2, expected2/cur/3:2, <<-EOF
26	From: Some One <example@example.com>
27	Subject: Unmodified Message v2
28	Date: Mon, 23 Dez 2314 12:23:42 +0200
29	Message-Id: <RADNE23UOY.2KBV29410ATNY@example.org>
30
31	This message is already in the archive.
32EOF
33
34"${ARCHIVE_MAIL}" current1→archive1 current2→archive2
35check_maildir archive1 expected1
36check_maildir archive2 expected2