diff options
author | unobe <unobe@cpan.org> | 2021-04-17 18:52:11 -0700 |
---|---|---|
committer | unobe <unobe@cpan.org> | 2021-04-17 18:52:11 -0700 |
commit | f7ae890ecb7c90cac69051816211c0cc97cd4c7c (patch) | |
tree | 9c66cb915016cfd7d6db30d746b89542d1623070 | |
parent | 9923ea348c75bf33754508e9d2a61e537e7c79d1 (diff) | |
download | plan9front-f7ae890ecb7c90cac69051816211c0cc97cd4c7c.tar.xz |
patch for imap when imap fails
changeset: 8411:19f6a88ea241
branch: mbp-2011
user: Romano <unobe@cpan.org>
date: Sat Apr 17 14:35:21 2021 -0700
files: sys/src/cmd/upas/fs/imap.c
description:
When an imap fetch fails, it's helpful at times to know the underlying
cause. This provides more details by providing the underlying error
message.
-rw-r--r-- | sys/src/cmd/upas/fs/imap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/src/cmd/upas/fs/imap.c b/sys/src/cmd/upas/fs/imap.c index 7bcc84477..187b1ace9 100644 --- a/sys/src/cmd/upas/fs/imap.c +++ b/sys/src/cmd/upas/fs/imap.c @@ -865,14 +865,16 @@ static int imap4fetch(Mailbox *mb, Message *m, uvlong o, ulong l) { Imap *imap; + char *resp; imap = mb->aux; if(imap->flags & Fgmail) l = gmaildiscount(m, o, l); idprint(imap, "uid fetch %lud (flags body.peek[]<%llud.%lud>)\n", (ulong)m->imapuid, o, l); imap4cmd(imap, "uid fetch %lud (flags body.peek[]<%llud.%lud>)", (ulong)m->imapuid, o, l); - if(!isokay(imap4resp0(imap, mb, m))){ - eprint("imap: imap fetch failed\n"); + resp = imap4resp0(imap, mb, m); + if(!isokay(resp)){ + eprint("imap: imap fetch failed: %s\n", resp); return -1; } return 0; |