ref: 8d36ca44ac20917a17ec2cf77ae978b76a0c3a0a
parent: d778775476419a5f882d0a9e4bd4d096293079b9
author: unobe <unobe@cpan.org>
date: Sat Apr 17 14:52:11 EDT 2021
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.
--- a/sys/src/cmd/upas/fs/imap.c
+++ b/sys/src/cmd/upas/fs/imap.c
@@ -865,6 +865,7 @@
imap4fetch(Mailbox *mb, Message *m, uvlong o, ulong l)
{Imap *imap;
+ char *resp;
imap = mb->aux;
if(imap->flags & Fgmail)
@@ -871,8 +872,9 @@
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;
--
⑨