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

Re: set alias for mail folder



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday, October 13 at 08:05 PM, quoth Percy Foreman:
> I'm trying to figure out how to alias a mail folder so I can type 
> '@folder' instead of '/home/test/mail/inbox' when trying to change.
>
> I tried putting
> alias folder '/home/test/mail/inbox'
> into muttrc, but mutt responds with
> opening _home_test_mail_inbox
> Of course he can't find it, so I don't know.

I think you're misunderstanding the documentation. I'm guessing that 
you looked in the manual under "Mailbox Shortcuts" and found:

     @alias -- refers to the default save folder as determined by the
     address of the alias

But that doesn't mean you specify '@folder' to mean some folder. 
Here's how it works: let's say you have a friend named Bob. So you 
establish an alias for him:

     alias bob Bob <bob@xxxxxxxxxxx>

Then, because you want to keep email from him in a folder, you set up 
a save-hook:

     save-hook '~f bob@xxxxxxxxxxx' +BobMail

Thereafter, you can use "@bob" as an alias for "+BobMail" (do you know 
what the + in front of that means?).

To be a bit more explicit: the "@alias" notation relies on save-hooks 
(and fcc-save-hooks). The "alias" keyword in your muttrc is (if you 
check your manual) exclusively for defining names for email addresses. 
It is not a general-purpose shorthand mechanism.

So, strictly speaking, you *could* achieve what you want by making a 
"folder" alias for a garbage email address and then establishing a 
save-hook for that garbage email address, like so:

     alias folder <folder-12345678909@xxxxxxxxxxx>
     save-hook '~f folder-12345678909@xxxxxxxxxxx' /home/test/mail/inbox

Thereafter, "@folder" will be considered a shortcut for 
"/home/test/mail/inbox". That's going a little out of your way, I 
think, but you *can* do that.

Generally, though, you *usually* don't need to specify full paths. The 
easiest thing to do is to specify a $folder:

     set folder=/home/test/mail/inbox

Once you do that, you can use + or = to refer to 
"/home/test/mail/inbox". Your sub-folders can even be easily referred 
to when you do that. For example, with the above setting, "+BobMail" 
would refer to "/home/test/mail/inboxBobMail" (note that there's no 
separator between "inbox" and "BobMail", so if you want one, you need 
to insert it, either at the end of $folder or in your use of the + 
shortcut, like so: "+/BobMail").

~Kyle
- -- 
What progress we are making. In the Middle Ages they would have burned 
me. Now they are content with burning my books.
                                                       -- Sigmund Freud
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iEYEARECAAYFAkjzlrIACgkQBkIOoMqOI17GZgCfas5uwJp1rjKXkdlUV/FdlAWZ
tIUAnA4ZEv4yJZIflqXnB0V/8b4Z4O65
=YyVp
-----END PGP SIGNATURE-----