Skip to content
Snippets Groups Projects
Commit e2102d19 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Allow the 'in-transit' attribute flag to be removed from msgs in any msgbase

If a msgbase internal code is passed on the command-line, use that msgbase
instead of 'mail' (where the use of the 'in-transit' flag is normally expected
to be seen). For Keyop.
parent 29204587
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
/* notransit.js */ /* notransit.js */
/* Removes MSG_INTRANSIT attribute from messages in mail database */ /* Removes MSG_INTRANSIT attribute from messages in mail (or other) msgbase */
load("sbbsdefs.js"); load("sbbsdefs.js");
mail = new MsgBase("mail"); mail = new MsgBase(argv[0] || "mail");
if(!mail.open()) { if(!mail.open()) {
alert(mail.last_error); alert(mail.last_error);
exit(); exit();
...@@ -12,8 +12,8 @@ if(!mail.open()) { ...@@ -12,8 +12,8 @@ if(!mail.open()) {
var total_msgs = mail.total_msgs; var total_msgs = mail.total_msgs;
var removed = 0; var removed = 0;
for(i=0;i<total_msgs;i++) { for(i=0;i<total_msgs;i++) {
hdr = mail.get_msg_header( /* by_offset: */ true, hdr = mail.get_msg_header( /* by_offset: */ true,
/* offset: */ i, /* offset: */ i,
/* expand_fields: */ false); /* expand_fields: */ false);
printf("#%lu from: %-30s %08lx\r\n",hdr.number,hdr.from,hdr.netattr); printf("#%lu from: %-30s %08lx\r\n",hdr.number,hdr.from,hdr.netattr);
if(hdr && hdr.netattr&MSG_INTRANSIT) { if(hdr && hdr.netattr&MSG_INTRANSIT) {
...@@ -30,4 +30,4 @@ for(i=0;i<total_msgs;i++) { ...@@ -30,4 +30,4 @@ for(i=0;i<total_msgs;i++) {
mail.close(); mail.close();
print(); print();
print(format("Removed %u in-transit flags", removed)); print(format("Removed %u in-transit flags", removed));
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment