summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-12-21 23:38:42 +0200
committerSergey Poznyakoff <gray@gnu.org>2020-12-21 23:38:42 +0200
commit317bb197a7f288aa4d36d4af7849e90e14fd7a77 (patch)
tree583771cfe7e614587685e97b8feddd1eb66fbcdd /include
parent35b8dcfbe745d59faa4fde8d76b30c5781d5cd8d (diff)
downloadmailutils-317bb197a7f288aa4d36d4af7849e90e14fd7a77.tar.gz
mailutils-317bb197a7f288aa4d36d4af7849e90e14fd7a77.tar.bz2
MH: provide a mh_profile setting to control assignment of sequence numbers
The "Volatile-uidnext" setting controls how sequence numbers are allocated. By default they increase monotonically. If Volatile-uidnext is set to "true", each new incorporated message is assigned the sequence number equal to that of the last message increased by one. When the last message in the mailbox is deleted, the value of UIDNEXT is recalculated and UIDVALIDITY is increased. This follows the behavior of traditional MH implementations. * doc/texinfo/mu-mh.texi: Document chnges. * include/mailutils/sys/amd.h (MU_AMD_VOLATILE_UIDNEXT): New constant. * libmailutils/base/amd.c (amd_expunge): Reset uidvalidity and uidnext if MU_AMD_VOLATILE_UIDNEXT capability is set and the last message was removed. * libproto/mh/mh.c (_mailbox_mh_init): New mh_profile setting "Volatile-uidnext". If set to true, it instructs mailutils to mimic the traditional MH behavior when assigning sequence number to the new message. * testsuite/mbop.c (main): Use MBOP_PRE_OPEN_HOOK (if defined) as the name of the function to call before opening the mailbox. * libproto/mh/tests/mbop.c (mbop_pre_open_hook): New function. If the MH environment variable is set, take its value as the name of the mh_profile and read settings from it. * libproto/mh/tests/Makefile.am: Add uidvol.at * libproto/mh/tests/atlocal.in: Unset MH. * libproto/mh/tests/testsuite.at: Include uidvol.at * libproto/mh/tests/uidvol.at: New file.
Diffstat (limited to 'include')
-rw-r--r--include/mailutils/sys/amd.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/mailutils/sys/amd.h b/include/mailutils/sys/amd.h
index 2affcba50..34076e11f 100644
--- a/include/mailutils/sys/amd.h
+++ b/include/mailutils/sys/amd.h
@@ -66,7 +66,14 @@ struct _amd_message
};
/* AMD capabilities */
-#define MU_AMD_STATUS 0x01 /* format keeps status flags */
+#define MU_AMD_STATUS 0x01 /* format keeps status flags */
+#define MU_AMD_VOLATILE_UIDNEXT 0x02 /* Reset UIDNEXT and UIDVALIDITY
+ when the last message is removed. This helps implement the traditional
+ MH behavior: sequence number for the new message is computed as that of
+ the last message incremented by one. Normally this behavior is enabled
+ by setting the 'Volatile-uidnext' parameter in mh_profile to 'true'.
+ See _mailbox_mh_init in libproto/mh/mh.c.
+*/
#define MU_AMD_F_INIT_SCAN 0x01 /* Done initial scanning */
#define MU_AMD_F_PROP 0x02 /* prop file existed */

Return to:

Send suggestions and report system problems to the System administrator.