summaryrefslogtreecommitdiff
path: root/libproto/dotmail/tests/append.at
diff options
context:
space:
mode:
Diffstat (limited to 'libproto/dotmail/tests/append.at')
-rw-r--r--libproto/dotmail/tests/append.at174
1 files changed, 169 insertions, 5 deletions
diff --git a/libproto/dotmail/tests/append.at b/libproto/dotmail/tests/append.at
index 91d9d5635..7bb5e760b 100644
--- a/libproto/dotmail/tests/append.at
+++ b/libproto/dotmail/tests/append.at
@@ -1,5 +1,5 @@
# GNU Mailutils -- a suite of utilities for electronic mail
-# Copyright (C) 2019 Free Software Foundation, Inc.
+# Copyright (C) 2019-2024 Free Software Foundation, Inc.
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
-DM_MESG([append],
+m4_pushdef([INBOX],
[Received: (from hare@wonder.land)
by wonder.land id 3301
for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100
@@ -51,7 +51,10 @@ Return-Path: hare@wonder.land
There isn't any
.
-],
+])
+
+DM_MESG([append],
+[INBOX],
[AT_DATA([msg],
[Received: (from alice@wonder.land)
by wonder.land id 3304
@@ -62,11 +65,12 @@ Message-Id: <200207292200.3304@wonder.land>
To: March Hare <hare@wonder.land>
Subject: Re: Invitation
Return-Path: alice@wonder.land
+Status: O
X-UID: 1034
Then it wasn't very civil of you to offer it
])],
-[dm_mesg count],
+[mbop count],
[# Append new message
append msg
# Select it
@@ -74,6 +78,7 @@ append msg
# Check if it is scanned and loaded
env_date
env_sender
+attr
headers
body_text
],
@@ -82,6 +87,7 @@ body_text
4 current message
4 env_date: Mon Jul 29 21:00:09 2002
4 env_sender: alice@wonder.land
+4 attr: -
4 headers: Received:(from alice@wonder.land) by wonder.land id 3304 for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
Date:Mon, 29 Jul 2002 22:00:04 +0100
From:Alice <alice@wonder.land>
@@ -95,6 +101,103 @@ Return-Path:alice@wonder.land
count: 4
])
+DM_MESG([append with changed status],
+[INBOX],
+[AT_DATA([msg],
+[Received: (from alice@wonder.land)
+ by wonder.land id 3304
+ for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
+Date: Mon, 29 Jul 2002 22:00:04 +0100
+From: Alice <alice@wonder.land>
+Message-Id: <200207292200.3304@wonder.land>
+To: March Hare <hare@wonder.land>
+Subject: Re: Invitation
+Return-Path: alice@wonder.land
+Status: O
+X-UID: 1034
+
+Then it wasn't very civil of you to offer it
+])],
+[mbop count],
+[# Append new message
+append -attr FRP msg
+# Select it
+4
+# Check if it is scanned and loaded
+env_date
+env_sender
+attr
+headers
+body_text
+],
+
+[append: OK
+4 current message
+4 env_date: Mon Jul 29 21:00:09 2002
+4 env_sender: alice@wonder.land
+4 attr: FPR
+4 headers: Received:(from alice@wonder.land) by wonder.land id 3304 for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
+Date:Mon, 29 Jul 2002 22:00:04 +0100
+From:Alice <alice@wonder.land>
+Message-Id:<200207292200.3304@wonder.land>
+To:March Hare <hare@wonder.land>
+Subject:Re: Invitation
+Return-Path:alice@wonder.land
+Status:FPR
+
+4 body_text: Then it wasn't very civil of you to offer it
+
+count: 4
+])
+
+DM_MESG([append with changed status and envelope],
+[INBOX],
+[AT_DATA([msg],
+[Received: (from alice@wonder.land)
+ by wonder.land id 3304
+ for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
+Date: Mon, 29 Jul 2002 22:00:04 +0100
+From: Alice <alice@wonder.land>
+Message-Id: <200207292200.3304@wonder.land>
+To: March Hare <hare@wonder.land>
+Subject: Re: Invitation
+Return-Path: alice@wonder.land
+
+Then it wasn't very civil of you to offer it
+])],
+[mbop count],
+[# Append new message
+append -sender gray@gnu.org -date 'Sat, 4 Dec 2021 08:00:00 UTC' -attr FRP msg
+# Select it
+4
+# Check if it is scanned and loaded
+env_date
+env_sender
+attr
+headers
+body_text
+],
+
+[append: OK
+4 current message
+4 env_date: Sat Dec 4 08:00:00 2021
+4 env_sender: gray@gnu.org
+4 attr: FPR
+4 headers: Received:from localhost by localhost; Sat, 4 Dec 2021 08:00:00 +0000
+Received:(from alice@wonder.land) by wonder.land id 3304 for hare@wonder.land; Mon, 29 Jul 2002 22:00:09 +0100
+Date:Mon, 29 Jul 2002 22:00:04 +0100
+From:Alice <alice@wonder.land>
+Message-Id:<200207292200.3304@wonder.land>
+To:March Hare <hare@wonder.land>
+Subject:Re: Invitation
+Return-Path:gray@gnu.org
+Status:FPR
+
+4 body_text: Then it wasn't very civil of you to offer it
+
+count: 4
+])
+
DM_MESG([append with uid],
[Received: (from hare@wonder.land)
by wonder.land id 3301
@@ -151,7 +254,7 @@ X-UID: 1034
Then it wasn't very civil of you to offer it
])],
-[dm_mesg count\; uidvalidity\; uidnext],
+[mbop count\; uidvalidity\; uidnext],
[# Append new message
append msg
# Select it
@@ -230,3 +333,64 @@ Return-Path:hare@wonder.land
1 body_text: Have some wine
])
+#
+# Test whether UIDs are updated in append mode.
+#
+AT_SETUP([append mode])
+AT_DATA([inbox],
+[Received: (from hare@wonder.land)
+ by wonder.land id 3301
+ for alice@wonder.land; Mon, 29 Jul 2002 22:00:06 +0100
+Date: Mon, 29 Jul 2002 22:00:01 +0100
+From: March Hare <hare@wonder.land>
+Message-Id: <200207292200.3301@wonder.land>
+To: Alice <alice@wonder.land>
+Subject: Invitation
+Return-Path: hare@wonder.land
+X-IMAPbase: 10 3
+X-UID: 1
+
+Have some wine
+.
+Received: (from alice@wonder.land)
+ by wonder.land id 3302
+ for hare@wonder.land; Mon, 29 Jul 2002 22:00:07 +0100
+Date: Mon, 29 Jul 2002 22:00:02 +0100
+From: Alice <alice@wonder.land>
+Message-Id: <200207292200.3302@wonder.land>
+To: March Hare <hare@wonder.land>
+Subject: Re: Invitation
+Return-Path: alice@wonder.land
+X-UID: 2
+
+I don't see any wine
+.
+])
+AT_DATA([msg],
+[Received: (from hare@wonder.land)
+ by wonder.land id 3303
+ for alice@wonder.land; Mon, 29 Jul 2002 22:00:08 +0100
+Date: Mon, 29 Jul 2002 22:00:03 +0100
+From: March Hare <hare@wonder.land>
+Message-Id: <200207292200.3303@wonder.land>
+To: Alice <alice@wonder.land>
+Subject: Re: Invitation
+Return-Path: hare@wonder.land
+
+There isn't any
+])
+AT_CHECK([mbop -a -m inbox append msg],
+[0],
+[append: OK
+])
+AT_CHECK([grep X-UID inbox],
+[0],
+[X-UID: 1
+X-UID: 2
+X-UID: 3
+])
+AT_CHECK([grep X-IMAPbase inbox | tr -s ' '],
+[0],
+[X-IMAPbase: 10 4
+])
+AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.