the search_mods param contained some bad information, specifically:
s:5:"INBOX";a:9:{s:1:"*";i:1;s:4:"Sent";i:1;s:6:"Drafts";i:1;s:5:"INBOX";i:1;s:4:"Junk";i:1;s:21:"INBOX.PR.Sent objects";i:1;s:7:"subject";i:1;s:4:"from";i:1;s:2:"to";i:1;}
it should only contain search fields, not folder names.
I have no idea who it could have got in there.