about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--man/mscan.14
-rw-r--r--mscan.c13
2 files changed, 16 insertions, 1 deletions
diff --git a/man/mscan.1 b/man/mscan.1
index 622499d..d9dd9a4 100644
--- a/man/mscan.1
+++ b/man/mscan.1
@@ -135,6 +135,10 @@ Human-readable size of the message (in kilobytes).
 The Maildir folder the message resides in.
 .It Cm "%" Ns Oo Ar wd Oc Ns Cm "R"
 The filename of the message.
+.It Cm "%" Ns Oo Ar wd Oc Ns Cm "I"
+The
+.Sq Li Message-ID
+of the message.
 .El
 .El
 .Sh MESSAGE FLAGS
diff --git a/mscan.c b/mscan.c
index 7d192d5..bd0951c 100644
--- a/mscan.c
+++ b/mscan.c
@@ -455,10 +455,21 @@ oneline(char *file)
 			else
 				wleft -= printf("%s", file);
 			break;
+		case 'I':
+			{
+				char *m = msg ? blaze822_hdr(msg, "message-id") : 0;
+				if (!m)
+					m = "(unknown)";
+				if (w)
+					wleft -= printf("%*.*s", w, w, m);
+				else
+					wleft -= printf("%s", m);
+			}
+			break;
 		default:
 			putchar('%');
 			putchar(*f);
-			wleft -=2;
+			wleft -= 2;
 		}
 	}