My .muttrc file specifies Gmail for sending and receiving via IMAP:

set folder = "imaps://imap.gmail.com:993"

But I would like to be able to archive both sent and read messages locally, rather than to directories on the Gmail server specified by $folder.

Is there a way to specify different values of $folder depending on what action is being taken?

I'm coming to Mutt from years using Alpine, which allows me to specify both local saved-message and file-carbon-copy folders for any message, regardless of the external account I'm accessing.


In the end I returned to Alpine. Switching between configurations in Mutt seems to require the use of macros, while in Alpine it is possible to access multiple accounts, and to direct received and sent messages to a different server than one uses for actual transmission and reception.

For my purposes, doing local archiving of my received and sent email while reading and sending via a remote server, Alpine seems the better choice.

I mean to look into Sup at some point, too.


The standard mutt macros for saving a file work just fine, but if you save mail to "=archive", mutt will push it to the IMAP folder named archive.

If you remove the "=" so that is it just "archive", then the file will be stored as a local file.

macro index,pager a  "<save-message>archive<enter>"  "mark message as Archived"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.