Why does Gnus not expire my e-mails?
I had a problem where I was using nnimap in Gnus to browse e-mail. I would be in my inbox group and I would press E to mark an e-mail (an “article” in Gnus terms) as expirable. Then I would press B e ((gnus-summary-expire-articles)) so that they would get deleted. However, nothing would happen - the articles would remain as expirable instead of being deleted through IMAP and marked as cancelled.
The culprit ended up being the fact that my gnus nnimap source looked like this:
(nnimap "personal"
(nnimap-address "imap.mymailprovider.com")
(nnimap-server-port "imaps")
(nnimap-stream ssl)
(nnmail-expiry-target "nnimap+personal:Trash" )
(nnmail-expiry-wait 'immediate)) ;; <------------ WRONG
The fix was to write (nnmail-expiry-wait immediate) (without apostrophe). This is because nnmail-expiry-wait is a defcustom variable, which takes an integer or the symbol immediate or never. Writing 'immediate passes it as a string, not a symbol.
In the code, the condition (eq nnmail-expiry-wait 'immediate) evaulates to nil if you write (nnmail-expiry-wait 'immediate) which is why the expiration doesn’t run.