mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 8228619e05f14b92c6e4583f750af47dab79efe6
parent 7636f0977cff47e152594902b69d99d9f0fc0232
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Fri, 29 Jul 2016 15:55:57 +0200

mshow: allow filters to skip and select multipart parts

Diffstat:
mshow.c | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/mshow.c b/mshow.c @@ -210,12 +210,24 @@ render_mime(int depth, struct message *msg, char *body, size_t bodylen) if (e == 0) { printf(" render=\"%s\" ---\n", cmd); print_ascii(output, outlen); + } else if (e == 63) { // skip filter + free(output); + goto nofilter; } else if (e == 64) { // decode output again printf(" filter=\"%s\" ---\n", cmd); struct message *imsg = blaze822_mem(output, outlen); if (imsg) walk_mime(imsg, depth+1, render_mime); blaze822_free(imsg); + } else if (e >= 65 && e <= 80) { // choose N-64th part + struct message *imsg = 0; + int n = e - 64; + printf(" selector=\"%s\" part=%d ---\n", cmd, n); + while (blaze822_multipart(msg, &imsg)) { + if (--n == 0) + walk_mime(imsg, depth+1, render_mime); + } + blaze822_free(imsg); } else { printf(" filter=\"%s\" FAILED status=%d", cmd, e); free(output);