<<< Date Index >>>     <<< Thread Index >>>

How to make mutt execute commands from the command line?



Hello,

I need to migrate with a script lots of mailboxes from one place and format
to another. For several reasons (I *have* looked at mb2md and similar)
mutt seems the best way for me to do it, or at least I'm really
interested to learn if mutt can do it and how.

What I need to do is, more or less, inside a bash loop:

mutt -f $ORIG_MBOX -e "COMMAND_TO_SAVE_ALL_MESSAGES_TO_A_MAILDIR"

where both the original and destination mailbox are calculated on the fly.

I thought the command should be something like 

  <tag-pattern>.<enter><tag-prefix><copy-message>PATH_TO_MAILDIR/<enter>

but if I try to run this at the prompt:

mutt -f test_in -e 
'tag-pattern>.<enter><tag-prefix><copy-message>test_out/<enter>'

all I get is:

Error in command line: 
tag-pattern>.<enter><tag-prefix><copy-message>bingo/<enter>: unknown command

as far as I understand, I am missing something silly like correct quoting or 
similar,
but what is it? I have tried several variations of the command above without 
success.

Or maybe I should launch mutt in a completely different way?

THank you in advance for any feedback,

              Marco