Re: Alternative Identities
On Fri, Jul 25, 2008 at 06:32:51PM -0400, =?ISO-8859-1?Q?Crist=F3bal_Palmer_ wrote: > > My very-lazy-sysadmin solution, in honor of Sysadmin Appreciation Day[0]. > > 1) fire up gnu screen(1) > 2) mutt -F /path/to/some/muttrc > 3) ^ac to open a new screen window > 4) mutt -F /other/account/muttrc > 5) profit > Yep, that's basically what I do now. ;) It'd still be nice to easily access multiple account from one instance of mutt. Dale
Re: Alternative Identities
On Fri, Jul 25, 2008 at 05:59:25PM -0400, Dale Harris wrote: > > Frankly (being an armchair coder here), mutt I think needs to be > re-engineered how it handles multiple accounts, it becoming a real PITA. > There should be separate menu for this and a clean way to have it > configured. This is the one thing that might finally drive me away from > mutt if it isn't fixed. > > Just my 2 cents... My very-lazy-sysadmin solution, in honor of Sysadmin Appreciation Day[0]. 1) fire up gnu screen(1) 2) mutt -F /path/to/some/muttrc 3) ^ac to open a new screen window 4) mutt -F /other/account/muttrc 5) profit Cheers, -- Cristóbal Palmer ibiblio.org systems administrator [0] http://www.sysadminday.com/
Re: Alternative Identities
On Sat, Jul 26, 2008 at 07:44:18AM +1000, Cameron Simpson wrote: > > You can't just make the macros longer? Eg (untested): > > macro index ":source ~/.mutt/profile.default\nc" # "Load > default profile" > > (Note the "c" inserted at the end of the macro.) > -- > Cameron Simpson <[EMAIL PROTECTED]> DoD#743 > http://www.cskk.ezoshosting.com/cs/ Frankly (being an armchair coder here), mutt I think needs to be re-engineered how it handles multiple accounts, it becoming a real PITA. There should be separate menu for this and a clean way to have it configured. This is the one thing that might finally drive me away from mutt if it isn't fixed. Just my 2 cents... -- Dale Harris [EMAIL PROTECTED] [EMAIL PROTECTED] /.-)
Re: Alternative Identities
On 17Jul2008 20:38, Jorge Luis <[EMAIL PROTECTED]> wrote: | On Thu, Jul 17, 2008 at 09:32:46PM +0100, Ken Moffat wrote: | > # macros to invoke a profile | > macro index ":source ~/.mutt/profile.default\n" # "Load default profile" | > macro pager ":source ~/.mutt/profile.default\n" # "Load default profile" | > macro index ":source ~/.mutt/profile.lfs\n" # "Load profile: LFS" | > macro pager ":source ~/.mutt/profile.lfs\n" # "Load profile: LFS" | | I'm using this system now to good effect. There's one minor improvement | I'd like to make, but I'm not sure how to do it. Is there some way to | cause these macros to load the respective mboxes upon execution? As | they stand, I have to call up the mbox listing manually after sourcing | the macros. You can't just make the macros longer? Eg (untested): macro index ":source ~/.mutt/profile.default\nc" # "Load default profile" (Note the "c" inserted at the end of the macro.) -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/
Re: use script output as regex pattern in folder-fook
On Jul 25 11:46, David Champion wrote: > > A more elegant solution could be a config var $configdir or $scriptdir for > > people who > > > > - have more then one script laying around in ~/.mutt (or wherever) > > - don't want to put Mutt-specific scripts in a location on $PATH > > You also can do this in ~/.muttrc: > > source "~/.mutt/muttrc.py|" > > and generate your "real" muttrc programmatically: another way to do > things like macros/variables and search paths, and you also get to > automatically define hooks, lists, etc. based on the contents of your > filesystem. > But once again this only executes at startup -- it doesn't > update itself continuously. > > If you're ambitious enough you could set mutt up to reload much of its > configuration every time you change folders, or something. But I'm > not sure how useful this really is for most people. :) Wow, one could write a research paper on Mutt configuration :) The number of my scripts and vars is greater than one but so far still manageable by hand and some backtick-magic here and there. Thanks! steve
Re: auto-move mails
* Marianne Promberger <[EMAIL PROTECTED]> [2008-07-25 12:17 +0200]: > However, it turns out that even with such as ... > > folder-hook . 'push "~s > test234s\Ca\Ck=isomerica/archive\n"' > > if no message matches "~s test234" it does always save the last > message to the archive, so this would have to be changed to _only_ > apply _if_ any message is tagged (or is there something like > for saving? You can use instead of , this will abort the macro if there are no tagged messages. Nicolas -- http://www.rachinsky.de/nicolas
Re: use script output as regex pattern in folder-fook
> > You can work around this by putting MUTTDIR in your shell environment > > before running mutt. > > Hmm, how do you read my mind? :) :) Well, I actually do this for a few variables -- predating the $my_xyz feature. I should switch where I can though, so I can drop the setenv patch. (Lets me stuff things into the environment from inside mutt.) > A more elegant solution could be a config var $configdir or $scriptdir for > people who > > - have more then one script laying around in ~/.mutt (or wherever) > - don't want to put Mutt-specific scripts in a location on $PATH You also can do this in ~/.muttrc: source "~/.mutt/muttrc.py|" and generate your "real" muttrc programmatically: another way to do things like macros/variables and search paths, and you also get to automatically define hooks, lists, etc. based on the contents of your filesystem. But once again this only executes at startup -- it doesn't update itself continuously. If you're ambitious enough you could set mutt up to reload much of its configuration every time you change folders, or something. But I'm not sure how useful this really is for most people. :) -- -D.[EMAIL PROTECTED]NSITUniversity of Chicago
Re: use script output as regex pattern in folder-fook
On Jul 25 10:36, David Champion wrote: > >>set my_muttdir=$HOME/.mutt > >>folder-hook `$my_muttdir/script.sh` ... > > > >> Here, Mutt doesn't seem to expand $my_muttdir before handing the command > >> over > >> to the shell. Is there a trick to do that? > > > > It doesn't seem so. At least for interactive shell-escape function it's > > documented that these variables aren't expanded... and I assume the same > > is true for backtick expansion. > > You can work around this by putting MUTTDIR in your shell environment > before running mutt. > > sh$ export MUTTDIR=~/.mutt > with > folder-hook `$MUTTDIR/script.sh` > Hmm, how do you read my mind? :) steve
Re: use script output as regex pattern in folder-fook
On Jul 25 17:32, Rocco Rutte wrote: > Hi, > > * Steve S wrote: > >> I have tried > >>set my_muttdir=$HOME/.mutt >>folder-hook `$my_muttdir/script.sh` ... > >> Here, Mutt doesn't seem to expand $my_muttdir before handing the command over >> to the shell. Is there a trick to do that? > > It doesn't seem so. At least for interactive shell-escape function it's > documented that these variables aren't expanded... and I assume the same > is true for backtick expansion. > OK, then I'll set an env var MUTTDIR and do folder-hook `$MUTTDIR/script.sh` ... A more elegant solution could be a config var $configdir or $scriptdir for people who - have more then one script laying around in ~/.mutt (or wherever) - don't want to put Mutt-specific scripts in a location on $PATH My 0.02 $. steve
Re: .muttrc
* Ravi Uday [22.Tem.08 11:31 -0700]: > If there is a way to retrieve your ~/.muttrc from a existing mutt > session, please let me know. That would help too as my > .muttrc is deleted :( Attach gdb to your mutt process with: gdb /proc/$PPID/exe $PPID And inside gdb dump the variables like so: call mutt_dump_variables() Then parse the output. -- ~sertac
Re: robots [ was Re: Alternative Identities ]:wq
> Question for people who post here more frequently than I do - is it > normal to get a challenge/response mail from [EMAIL PROTECTED] when > posting here ? It's typical (I get one every time I post), but it's not normal (in the sense that it shouldn't happen). Challenge/response should never be used for mail that you receive as a list member; it's really, really irritating to other list members. It's understandable (if somewhat annoying) as a posting filter on a list -- just not as a receiving filter on your personal subscription. I'd like to see the subscriber in question removed from the list -- evidently he's not getting list mail anyway. -- -D.[EMAIL PROTECTED]NSITUniversity of Chicago
Re: use script output as regex pattern in folder-fook
>>set my_muttdir=$HOME/.mutt >>folder-hook `$my_muttdir/script.sh` ... > >> Here, Mutt doesn't seem to expand $my_muttdir before handing the command over >> to the shell. Is there a trick to do that? > > It doesn't seem so. At least for interactive shell-escape function it's > documented that these variables aren't expanded... and I assume the same > is true for backtick expansion. You can work around this by putting MUTTDIR in your shell environment before running mutt. sh$ export MUTTDIR=~/.mutt with folder-hook `$MUTTDIR/script.sh` -- -D.[EMAIL PROTECTED]NSITUniversity of Chicago
Re: .muttrc
Hi, * Michelle Konzack wrote: I wish, there was a function which dump the actuell running config... Please add this wish to http://dev.mutt.org/trac/ticket/3064. Maybe it'll be easy to implement another command such as "save" that will print the contents to a file rather then a paged menu. Rocco
Re: use script output as regex pattern in folder-fook
Hi, * Steve S wrote: I have tried set my_muttdir=$HOME/.mutt folder-hook `$my_muttdir/script.sh` ... Here, Mutt doesn't seem to expand $my_muttdir before handing the command over to the shell. Is there a trick to do that? It doesn't seem so. At least for interactive shell-escape function it's documented that these variables aren't expanded... and I assume the same is true for backtick expansion. Rocco
Re: use script output as regex pattern in folder-fook
On Jul 25 08:15, David Champion wrote: > > folder-hook folder1|folder2|folder3 ... > > > > I replaced this with > > > > folder-hook script.sh| ... > > This approach won't work. Here's why, and a possible alternative. > > The "script.sh|" notation for incorporating a script's output into your > muttrc only works where mutt knows that it's looking for a filename or > a format string. Otherwise, "script.sh|" is just a literal string. > In your case, it's a regular expression listing a set of either-or > patterns, and one of these patterns is an empty string, which matches > everything since all strings contain an empty string as a subset. > > As Michael said, you can use `script.sh` instead. This should > work equally well for most purposes. The only difference is that > "script.sh|", when it works, executes the script each time that the > value is evaluated. `script.sh` executes the script only once, at > the time that the muttrc is processed. > > This makes "script.sh|" really useful only when used for "set" variables > that are evaluated multiple times. Hooks are evaluated only once > anyway, so it wouldn't really be meaningful. Thanks for the clarification. I use "script.sh|" in various "set ..." commands, so I naively figured I could use it in a folder-hook too. As I stated in the reply to Michael's message, I'd be happy if something like set $my_path=/some/path folder-hook `$my_path/script.sh` ... would be possible. > If you really need the same kind of dynamic meaning that "script.sh|" > provides over `script.sh` > [...] No, not really. I substituted one for the other so I didn't even know there was some dynamic to use :) steve
Re: .muttrc
Am 2008-07-22 11:31:28, schrieb Ravi Uday: > Just to add to this, > > If there is a way to retrieve your ~/.muttrc from a existing mutt > session, please let me know. That would help too as my > .muttrc is deleted :( I wish, there was a function which dump the actuell running config... Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 +49/177/935194750, rue de Soultz MSN LinuxMichi +33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
Re: auto-move mails
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday, July 24 at 02:16 PM, quoth Ravi Uday: > In mutt 1.5.17 is there a way we can setup a rule where if the > number of emails touches 150 move the first 50 to a specified folder > ? We can then map this rule witha key too ? Well, it's no so much a "rule" as it is a trigger. For example, you could use a folder-hook. If you want to do things based on the *number* of messages, then you're going to have to play some creative games. I can't think of a way to get it to trigger only when there are 150 messages, but I *can* think of a way to make sure that there are only the most-recent 100 messages. Since the concept of "most-recent" relies on the sorting order, we're going to use a combination of changing the sorting order and the ~m matching pattern. For example, we can use a hook that will: 1. Save the current sort order 2. Sort the messages so that the most-recent come first 3. Tag all messages after the 100th message 4. Save all tagged messages into a specified folder 5. Restore the original sort order Such as this: folder-hook . 'set my_savedsort=$sort\ set sort=reverse-date-received\ ~m 101-\ =foo\ \ set sort=$my_savedsort' You can, of course, bind that macro to a key instead of a hook if you prefer. ~Kyle - -- No man should escape our universities without knowing how little he knows. -- J. Robert Oppenheimer -BEGIN PGP SIGNATURE- Comment: Thank you for using encryption! iEYEARECAAYFAkiJ3FcACgkQBkIOoMqOI14w0gCcDs/FOoTBR3KlFG1mmUvQyJEP vf8AoJeV9B2vwfbtxsScIyIi0LU0Gr78 =umeY -END PGP SIGNATURE-
Re: use script output as regex pattern in folder-fook
> folder-hook folder1|folder2|folder3 ... > > I replaced this with > > folder-hook script.sh| ... This approach won't work. Here's why, and a possible alternative. The "script.sh|" notation for incorporating a script's output into your muttrc only works where mutt knows that it's looking for a filename or a format string. Otherwise, "script.sh|" is just a literal string. In your case, it's a regular expression listing a set of either-or patterns, and one of these patterns is an empty string, which matches everything since all strings contain an empty string as a subset. As Michael said, you can use `script.sh` instead. This should work equally well for most purposes. The only difference is that "script.sh|", when it works, executes the script each time that the value is evaluated. `script.sh` executes the script only once, at the time that the muttrc is processed. This makes "script.sh|" really useful only when used for "set" variables that are evaluated multiple times. Hooks are evaluated only once anyway, so it wouldn't really be meaningful. If you really need the same kind of dynamic meaning that "script.sh|" provides over `script.sh`, you might be able to use a compound folder-hook -- something like this: folder-hook . 'folder-hook \`script.sh\` command...' or perhaps: # all other folder-hooks in folder-hooks.mutt folder-hook . 'source folder-hooks.mutt' These are untested, but its intention is that for each folder change, mutt will interpret "folder-hook `script.sh` command..." again. I'm not sure that the second folder-hook would actually be applied to the new (now current) folder, though. It might be necessary to reopen the folder to make the new folder-hook stick, and that's so unusable as to make the whole approach worthless. -- -D.[EMAIL PROTECTED]NSITUniversity of Chicago
Re: use script output as regex pattern in folder-fook
On Jul 25 12:44, Michael Kjorling wrote: > On 25 Jul 2008 14:06 +0200, by [EMAIL PROTECTED] (Steve S): > > I replaced this with > > > > folder-hook script.sh| ... > > > > and script.sh : > > > > echo 'folder1|folder2|folder3' > > Maybe what you want is more along the lines of > > folder-hook `script.sh` ... > Yes, that was my initial attempt. It works if I use folder-hook `/path/to/script.sh` ... I have tried set my_muttdir=$HOME/.mutt folder-hook `$my_muttdir/script.sh` ... Here, Mutt doesn't seem to expand $my_muttdir before handing the command over to the shell. Is there a trick to do that? steve
Re: use script output as regex pattern in folder-fook
On 25 Jul 2008 14:06 +0200, by [EMAIL PROTECTED] (Steve S): > I replaced this with > > folder-hook script.sh| ... > > and script.sh : > > echo 'folder1|folder2|folder3' Maybe what you want is more along the lines of folder-hook `script.sh` ... -- Michael Kjörling .. [EMAIL PROTECTED] .. http://michael.kjorling.se * . No bird soars too high if he soars with his own wings . * * ENCRYPTED email preferred -- OpenPGP key ID: 0x 758F8749 BDE9ADA6 * * ASCII Ribbon Campaign: Against HTML mail, proprietary attachments * signature.asc Description: Digital signature
use script output as regex pattern in folder-fook
Hi I have a folder-hook acting on different folders: folder-hook folder1|folder2|folder3 ... I replaced this with folder-hook script.sh| ... and script.sh : echo 'folder1|folder2|folder3' Now, the pattern matches every folder, i.e. the hook acts on all folders, not just folder1,2,3. Is there a way do actually see what Mutt gets if it executes script.sh (there's nothing in .muttdebug0)? Or doesn't the script get executed at all. steve
Re: auto-move mails
On 24 Jul 2008 14:16 -0700, by [EMAIL PROTECTED] (Ravi Uday): > In mutt 1.5.17 is there a way we can setup a rule where if the number > of emails touches 150 move the first 50 to a specified folder ? > We can then map this rule witha key too ? If you are using maildir (I guess MH could work too, but may take a little more work, and mbox would take the most work), you could rather easily write a short shell script to accomplish this. True, it wouldn't be within mutt, but if you want to you can certainly bind it to a key combination to invoke it from within mutt. Hint: "ls new cur | wc -l" should get you far. -- Michael Kjörling .. [EMAIL PROTECTED] .. http://michael.kjorling.se * . No bird soars too high if he soars with his own wings . * * ENCRYPTED email preferred -- OpenPGP key ID: 0x 758F8749 BDE9ADA6 * * ASCII Ribbon Campaign: Against HTML mail, proprietary attachments * signature.asc Description: Digital signature
Re: auto-move mails
On Friday, 25 July 2008, 11:46 (UTC+0200), Mads Laursen wrote: > On Fri, Jul 25, 2008 at 11:07, Marianne Promberger > <[EMAIL PROTECTED]> wrote: > [snip] > > Something like (not tested, and I'm sure others have better direct > > function names where I use keyboard presses) > > > > folder-hook . 'push "~d > 1ms\Ca\Ck=archive\n$"' > > > > Actually, trying the line above just now it doesn't work; it just tags > > but doesn't save the message to the archive mailbox, not sure why. > > I don't have a terminal with mutt at the moment, but AFAIKS you need a > or ';' in front of your s to make it work. > > If you look closely, it should have saved exactly one message (not > necessarily one of the tagged ones) to =archive - I think. Thanks, this is exactly what happens. I had forgotten about this because I have set 'auto_tag= yes' in the .muttrc However, it turns out that even with such as ... folder-hook . 'push "~s test234s\Ca\Ck=isomerica/archive\n"' if no message matches "~s test234" it does always save the last message to the archive, so this would have to be changed to _only_ apply _if_ any message is tagged (or is there something like for saving? Anyway, I don't want to do this anyway, and not even sure if it's of help to the OP, so no need on my part to pursue this further. m. > > HTH & HAND > > /dossen > -- > This is a personal problem. There are very few personal problems that > cannot be solved through a suitable use of high explosives. This is > not one of those exceptions. -- Marianne Promberger Graduate student in Psychology http://www.psych.upenn.edu/~mpromber
Re: auto-move mails
On Fri, Jul 25, 2008 at 11:07, Marianne Promberger <[EMAIL PROTECTED]> wrote: [snip] > Something like (not tested, and I'm sure others have better direct > function names where I use keyboard presses) > > folder-hook . 'push "~d > 1ms\Ca\Ck=archive\n$"' > > Actually, trying the line above just now it doesn't work; it just tags > but doesn't save the message to the archive mailbox, not sure why. I don't have a terminal with mutt at the moment, but AFAIKS you need a or ';' in front of your s to make it work. If you look closely, it should have saved exactly one message (not necessarily one of the tagged ones) to =archive - I think. HTH & HAND /dossen -- This is a personal problem. There are very few personal problems that cannot be solved through a suitable use of high explosives. This is not one of those exceptions.
Re: auto-move mails
On Friday, 25 July 2008, 10:25 (UTC+0200), Steve S wrote: > On Jul 24 14:16, Ravi Uday wrote: > > Hi, > > > > In mutt 1.5.17 is there a way we can setup a rule where if the number > > of emails touches 150 move the first 50 to a specified folder ? > > We can then map this rule witha key too ? > > > > If you are also satisfied with using the message age as criterion, you could > use something like archivemail and a cronjob to put old mail in a .gz file. To > re-read old mail, do `mutt -f _archive.gz`. If date can be used as a key I'd do something with a folder-hook and "push" and match a "~d > X" pattern. Not sure if this is what the OP wants. Something like (not tested, and I'm sure others have better direct function names where I use keyboard presses) folder-hook . 'push "~d > 1ms\Ca\Ck=archive\n$"' Actually, trying the line above just now it doesn't work; it just tags but doesn't save the message to the archive mailbox, not sure why. m.
Re: auto-move mails
On Jul 24 14:16, Ravi Uday wrote: > Hi, > > In mutt 1.5.17 is there a way we can setup a rule where if the number > of emails touches 150 move the first 50 to a specified folder ? > We can then map this rule witha key too ? > If you are also satisfied with using the message age as criterion, you could use something like archivemail and a cronjob to put old mail in a .gz file. To re-read old mail, do `mutt -f _archive.gz`. steve