6

I use multiple accounts in mutt, and wish to save sent messages to different $record directories. I am aware of folder-hook; if I compose in different folders, I can change $record depending on the associated account of the initial folder.

However, sometimes, I might want to compose from a different folder, or forward an email to one account from another, or reply from a different account, or change my mind mid-composition (I have set edit_headers=yes). Hence, it makes more sense to save the sent email to a specific directory based on the from field. Is that possible?

I understand that fcc-hook could change $record based on recipients, but I'd like to change it based on sender instead.

1 Answer 1

3

You can use fcc-hook to change the folder depending on all sorts of parameters.

fcc-hook '~f [email protected]' '=foo-folder'
fcc-hook '~f [email protected]' '=bar-folder'

I also use it to depend on the subject (all messages whose subject contains "ISDN" go to my =ISDN folder, for example), use '~s' for that.

5
  • Thanks @wurtel, I'll check it out in the next day or so.
    – Sparhawk
    Commented Oct 5, 2015 at 12:43
  • 1
    Works great! Thank you (+1). One minor quibble: fcc-hook appears to only fire after the first edit of the message. If I try to postpone the editing of the message and re-edit, including changing the "from" address, fcc-hook will not fire again, and I'm stuck with the initial choice. Is there a way to make it fire after every edit of the message?
    – Sparhawk
    Commented Oct 7, 2015 at 11:50
  • It also doesn't work if I complete the first edit of the email, then change the from address with <Esc>, F.
    – Sparhawk
    Commented Oct 7, 2015 at 12:36
  • I don't think you can perform the hooks again, unfortunately.
    – wurtel
    Commented Oct 7, 2015 at 12:50
  • Okay, I thought as much. I'll leave the question open for a few more days to see if anyone else can add something, otherwise I'll accept your answer. Thanks again.
    – Sparhawk
    Commented Oct 7, 2015 at 12:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .