When working with a Gmail account in aerc, deleting a message just moves it to [Gmail]/All Mail. In Mutt, we could get around this by having delete move the message to the [Gmail]/Trash imap mailbox 1.
It would be great to have a similar way to configure what the delete command does in aerc.
You can always remap a key to
Aerc does do the right thing (setting the delete flag and expunging) for imap.
You can always remap a key to :move trash.
This is true. The challenge I'm facing is I'm managing multiple accounts with aerc, one of which is Gmail, which needs the special :delete treatment, while the others do not. As far as I know there is no way to configure keybindings within the context of a specific account. I could bind a special key just for Gmail, but it would be great if I could configure something in accounts.conf that allowed my actions to be consistent across accounts.
I've found that Gmail can be configured to behave correctly in response to a message being marked as deleted and expunged from the last visible IMAP folder. The behavior of archiving rather than deleting is the default behavior.
This can be configured by:
Settings > Forwarding and POP/IMAP > IMAP access
Changing Auto-Expunge to off, and then setting "When a message is marked as deleted and expunged from the last visible IMAP folder" to "Move the message to the Trash".
Closing this ticket since it seems clear that aerc is doing the correct thing, and Gmail can be configured to behave correctly.