about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-11 20:32:54 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-11 20:32:54 +0200
commitd4f72ab52db2cb69b32f0b10de53b46139000cf2 (patch)
treedececb76026a94fd59aee6105cc7ce8a0b84b202
parent2ad6ae80d8512c985fd613e5340c472582225dcd (diff)
downloadmblaze-d4f72ab52db2cb69b32f0b10de53b46139000cf2.tar.gz
mblaze-d4f72ab52db2cb69b32f0b10de53b46139000cf2.tar.xz
mblaze-d4f72ab52db2cb69b32f0b10de53b46139000cf2.zip
mscan: add %I for message-id
-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;
 		}
 	}