&%queue_list_requires_admin%& is set false.
+.cmdopt -bpi
+.cindex queue "list of message IDs"
+This option operates like &%-bp%&, but only outputs message ids
+(one per line).
+
+
.cmdopt -bpr
This option operates like &%-bp%&, but the output is not sorted into
chronological order of message arrival. This can speed it up when there are
.cmdopt -bpra
This option is a combination of &%-bpr%& and &%-bpa%&.
+.cmdopt -bpri
+This option is a combination of &%-bpr%& and &%-bpi%&.
+
.cmdopt -bpru
This option is a combination of &%-bpr%& and &%-bpu%&.
int filter_ufd = -1;
int group_count;
int i, rv;
-int list_queue_option = 0;
+int list_queue_option = QL_BASIC;
int msg_action = 0;
int msg_action_arg = -1;
int namelen = argv[0] ? Ustrlen(argv[0]) : 0;
}
if (*argrest == 'r')
- {
- list_queue_option = 8;
- argrest++;
- }
- else list_queue_option = 0;
+ list_queue_option = QL_UNSORTED, argrest++;
+ else
+ list_queue_option = QL_BASIC;
list_queue = TRUE;
/* -bpu: List the contents of the mail queue, top-level undelivered */
- else if (Ustrcmp(argrest, "u") == 0) list_queue_option += 1;
+ else if (Ustrcmp(argrest, "u") == 0) list_queue_option |= QL_UNDELIVERED_ONLY;
/* -bpa: List the contents of the mail queue, including all delivered */
- else if (Ustrcmp(argrest, "a") == 0) list_queue_option += 2;
+ else if (Ustrcmp(argrest, "a") == 0) list_queue_option |= QL_PLUS_GENERATED;
+
+ /* -bpi: List only message IDs */
+
+ else if (Ustrcmp(argrest, "i") == 0) list_queue_option |= QL_MSGID_ONLY;
/* Unknown after -bp[r] */
*/
void
-queue_list(int option, uschar **list, int count)
+queue_list(int option, uschar ** list, int count)
{
int subcount;
int now = (int)time(NULL);
else
qf = queue_get_spool_list(
- -1, /* entire queue */
- subdirs, /* for holding sub list */
- &subcount, /* for subcount */
- option >= 8, /* randomize if required */
- NULL); /* don't just count */
+ -1, /* entire queue */
+ subdirs, /* for holding sub list */
+ &subcount, /* for subcount */
+ option >= QL_UNSORTED, /* randomize if required */
+ NULL); /* don't just count */
-if (option >= 8) option -= 8;
+option &= ~QL_UNSORTED;
/* Now scan the chain and print information, resetting store used
each time. */
-for (;
- qf && (reset_point = store_mark());
- spool_clear_header_globals(), store_reset(reset_point), qf = qf->next
- )
+if (option == QL_MSGID_ONLY) /* Print only the message IDs from the chain */
+ for (; qf; qf = qf->next)
+ fprintf(stdout, "%.*s\n", MESSAGE_ID_LENGTH, qf->text);
+
+else for (;
+ qf && (reset_point = store_mark());
+ spool_clear_header_globals(), store_reset(reset_point), qf = qf->next
+ )
{
int rc, save_errno;
int size = 0;
}
}
- fprintf(stdout, "%s ", string_format_size(size, big_buffer));
- for (int i = 0; i < 16; i++) fputc(qf->text[i], stdout);
+ fprintf(stdout, "%s %.*s",
+ string_format_size(size, big_buffer), MESSAGE_ID_LENGTH, qf->text);
if (env_read && sender_address)
{
{
for (int i = 0; i < recipients_count; i++)
{
- tree_node *delivered =
+ tree_node * delivered =
tree_search(tree_nonrecipients, recipients_list[i].address);
- if (!delivered || option != 1)
+ if (!delivered || option != QL_UNDELIVERED_ONLY)
printf(" %s %s\n",
delivered ? "D" : " ", recipients_list[i].address);
if (delivered) delivered->data.val = TRUE;
}
- if (option == 2 && tree_nonrecipients)
+ if (option == QL_PLUS_GENERATED && tree_nonrecipients)
queue_list_extras(tree_nonrecipients);
printf("\n");
}