You are not logged in.

#1 2010-08-22 15:14:48

samuele.mattiuzzo
Member
From: Treviso, IT
Registered: 2009-10-12
Posts: 307
Website

[SOLVED] Mutt-sidebar and folder hooks with macros

Hi all,
actually on my mutt i'm using 3 imaps account, which i change by 3 folder hooks

macro index \e1 "c imaps://account1"

macro index \e2 "c imaps://account2"
 
macro index \e3 "c imaps://account3"

every hook is configured like this

account-hook imaps://address1:port1 'set imap_user=user1 imap_pass=pass1'
folder-hook imaps://address1:port1 'set folder=imaps://address1:port1/INBOX record=+Sent from="Real Name     <mail1@provider1.asd>"; \
set smtp_url="smtps://smtp1:portsmtp1"; \
set smtp_pass="pass1"'

where, obviously, account, user etc are the real data

having mutt configured like this, i cannot have every account's folder on the sidebar, since they are different an all on different servers. is it possibile to change folder displayed with the sidebar automatically within the hooks?

and last question: is it possible to setu a default hook, to be opened every time mutt starts?

thanks all!

Last edited by samuele.mattiuzzo (2010-08-22 17:50:45)

Offline

#2 2010-08-22 17:45:16

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: [SOLVED] Mutt-sidebar and folder hooks with macros

Use 'mailboxes' to add folders to the sidebar and 'unmailboxes' to remove folders.

I would store your account data in different files and source them when needed:

macro index \e1 "source /path/to/account1.muttrc"
macro index \e2 "source /path/to/account2.muttrc"
macro index \e3 "source /path/to/account2.muttrc"

Each account#.muttrc file would have something like this in it:

set imap_user=user1
set imap_pass=pass1
set folder=imaps://address1:port1/
set record=+Sent
set from="Real Name     <mail1@provider1.asd>"
set smtp_url="smtps://smtp1:portsmtp1"
set smtp_pass="pass1"

unmailboxes *
mailboxes =INBOX =Drafts =Sent =Trash

Your main ~/.muttrc would source one of these files in start (e.g. 'source /path/to/account1.muttrc').

Last edited by Stebalien (2010-08-22 17:45:51)


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#3 2010-08-22 17:49:59

samuele.mattiuzzo
Member
From: Treviso, IT
Registered: 2009-10-12
Posts: 307
Website

Re: [SOLVED] Mutt-sidebar and folder hooks with macros

thanks, now my muttrc is cleaner and it does the same thing as before! thanks a lot!

Offline

#4 2010-08-30 16:25:20

samuele.mattiuzzo
Member
From: Treviso, IT
Registered: 2009-10-12
Posts: 307
Website

Re: [SOLVED] Mutt-sidebar and folder hooks with macros

sorry to bump this thread up again, but i'm having a big problem

when i press esc-1 it doesn't source another account.muttrc file, but ask me to save into "ource~/.mutt/account.muttrc"

59 set header_cache=~/.mutt/cache/headers
 60 set message_cachedir=~/.mutt/cache/bodies
 61 set certificate_file=~/.mutt/certificates
 62 set spoolfile = no
 63 
 64 source ~/.mutt/dsi.muttrc
 65 
 66 macro index \e1 "source ~/.mutt/samumatt.muttrc"
 67 
 68 macro index \e2 "source ~/.mutt/vivosunamela85.muttrc"
 69 
 70 macro index \e3 "source ~/.mutt/dsi.muttrc"
 71 
 72 macro index \e4 "source ~/.mutt/archus.muttrc"

what's wrong? (the default sourcing works, not the macros)

Last edited by samuele.mattiuzzo (2010-08-30 16:25:47)

Offline

#5 2010-08-30 18:40:16

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mutt-sidebar and folder hooks with macros

What happens if you change the lines to:

macro index \e1 ":source ...

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2010-08-31 16:33:32

samuele.mattiuzzo
Member
From: Treviso, IT
Registered: 2009-10-12
Posts: 307
Website

Re: [SOLVED] Mutt-sidebar and folder hooks with macros

it works, halfly... it sources the file, but doesn't change the inbox (so i still see the one before)

Offline

#7 2010-08-31 18:29:16

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mutt-sidebar and folder hooks with macros

I misunderstood what you were after: see my .muttrc for the keybinds I use to move between folders

https://bitbucket.org/jasonwryan/eeepc/ … utt/muttrc


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB