This factoid assumes you have weechat, weechat_plugins, a functioning imapd you can access and iset.pl installed in a functioning weechat.
Step 1 /script install imap_status.py
Step 2 configure it for your mailbox.
shows an example of how it should look in iset
typically you need to set the following :
/set plugins.var.python.imap_status.username "${sec.data.imap.user}"
/set plugins.var.python.imap_status.password "${sec.data.imap.pass}"
If configured using secure as in the above link,
you still need to add the settings to sec.conf typically :
/secure set imap.user (replace brackets/this with your imap username)
/secure set imap.pass (replace brackets/this with your imap password)
Step 3 Add imap_status item to a bar of your choosing.
/iset items
on your preferred bar items and insert ,imap sumwhere within the list of items
for example as shown in above link
/set weechat.bar.status.items "time,[buffer_count],buffer_number+:+buffe
r_name+{buffer_nicklist_count}+buffer_filter,[lag],[hotlist],completion,
scroll,bufsize,imap"