When using an expiry target mailbox and an IMAP server that does not support move (Dovecot as per nnimap-quirks), messages will be copied, but not deleted after expiry. This was introduced with use of lexical-binding in Gnus and the difference between set and setq. The below patch fixes the problem.