Re: My experiences with Mutt to date: Suggestions for overcoming some issues

2021-02-11 Thread David J. Weller-Fahy

* boB Stepp  [2021-02-08 15:44 -0500]:

...


I have setup a crontab job (My first ever!) to run mbsync every five
minutes. Mutt checks the local mail much more frequently. Probably
should make this a similar time interval to the crontab interval. I
was concerned that if there were to be a network interruption or when
my router reboots at 3 AM that mbsync would hang, but after one day
of this it did not. I do have a question about this though.

The original crontab command to run was:

killall mbsync &>/dev/null; /usr/bin/mbsync -a -qq


...


mbsync -a -qq

and everything has been working.


...

I recently revamped my mbsync crontab jobs, and now have three
separate jobs (fast, medium, and slow). I used an article about
converting from offlineimap to mbsync [1] as inspiration.

[1]: https://people.kernel.org/mcgrof/replacing-offlineimap-with-mbsync

For your information, my crontab looks like the following:

#v+
* * * * * flock -nx ~/.mbsync-lock-fast mbsync google-fast-cycle
*/5 * * * * flock -nx ~/.mbsync-lock-medium mbsync google-medium-cycle
*/15 * * * * flock -nx ~/.mbsync-lock-slow mbsync google-slow-cycle
#v-

I hope that helps!

Regards,
  -dave


signature.asc
Description: PGP signature


Re: Question about saving sent mail to current mailbox

2018-04-25 Thread David J. Weller-Fahy

* David J. Weller-Fahy <l.mutt-us...@dave.caterva.org> [2018-04-25 21:38 -0400]:

I've been dealing with an error whenever mutt starts for a few years
now, and finally decided to ask how others have fixed the issue.

#v+
folder-hook . "set record=^"
#v-


Sigh... apparently inspiration required that I send an email to a mailing list 
before figuring this out.  The error was NOT the line quoted above, but the 
folder-hook two lines below it that did not escape the ^.  One should look at 
the ones place in the line number, not just the tens place, when verifying that 
the line one thinks is causing the error is indeed the line causing the error.

Apologies for the noise.

-dave

--
dave [ please don't CC me ]


signature.asc
Description: PGP signature


Question about saving sent mail to current mailbox

2018-04-25 Thread David J. Weller-Fahy

I've been dealing with an error whenever mutt starts for a few years
now, and finally decided to ask how others have fixed the issue.

I have all my sent email saved in the current mailbox.  I do this using
the following setting in my muttrc (per
https://gitlab.com/muttmua/mutt/wikis/MuttFaq/Folder).

#v+
folder-hook . "set record=^"
#v-

As a result, every time I start mutt I get the following errors.

#v+
Error in /home/dave/.mutt/general.muttrc, line 25: current mailbox shortcut '^' 
is unset
Error in /home/dave/.mutt/muttrc, line 3: source: errors in 
/home/dave/.mutt/general.muttrc
source: errors in /home/dave/.mutt/muttrc
#v-

I would like to be able to have the same behavior (record gets set to
the current mailbox in every mailbox I visit), but without the error or
enumerating all mailboxes in folder-hooks.

What are you (the wider mutt community) doing about those errors?  If
you're not seeing the errors, then what am I doing wrong?

Regards,
--
dave [ please don't CC me ]


signature.asc
Description: PGP signature


Re: Exiting Mutt from browser menu

2015-08-29 Thread David J. Weller-Fahy

* Joe joe.on.l...@gmail.com [2015-08-25 09:32 -0400]:

2- I'd like to isolate a whole thread from the rest of messages/threads
  opening it in a new clean screen containing just that thread.
  Same behaviour of tin newsreader:
  - topics of a newsgroup are listed one per line


So this would be threads collapsed to only show the parent
email... that's doable (AFAIK) with mutt.


  - let's open a topic contains more than one message by typing
right arrow key


A binding of the right arrow key to uncollapse the thread...



  - tin shows on a new screen the opened topic with all threaded
articles.


plus other things (possibly).


  In this screen other topics are hidden (we are in a menu that Mutt
  doesn't seem to provide), could call it thread menu.  - from there
  we can open single articles and then return to the topic menu.


You may want to check out the thread with the subject, temporarily
modifying thread display in the index?  In that thread a macro was
posted [1] that does something similar to what you want.  The goal of
the macro was to view a sub-thread alone on screen without the
surrounding context of the original thread and with the indentation
adjusted as if the sub-thread were the only part of the thread.

While this is not exactly what you want, if you use the macro listed and
select the thread instead of the sub-thread, and chain that with the
uncollapse command bound to the right arrow key, then I believe you'd
have the behavior you want.

[1]: http://marc.info/?l=mutt-usersm=135819127711700

Anyway, that's what struck me when I read your email.  Hope that helps.

Regards,
--
dave [ please don't CC me ]


signature.asc
Description: PGP signature


Re: deleting attachments in signed emails

2015-04-05 Thread David J. Weller-Fahy

* Brian Salter-Duke brian.james.d...@gmail.com [2015-04-05 16:35 -0400]:

While you are fixing these problems, could one of you look at a problem
I reported a few weeks ago.


Hrm... what's the ticket number?  I just checked and couldn't find the
bug report.


   http://www.kurokatta.org/hacks/src/mutt-1.5.13-rmattach.patch

It was meant for PGP-encrypted messages; hopefully it works for S/MIME as
well.


I looked at the patch, which seems to be trivial, but I'm not familiar
enough with the code to divine the side-effects of the single change.

Kevin, thoughts?

Regards,
--
dave [ please don't CC me ]


signature.asc
Description: PGP signature


Re: Two private SMIME certificates conundrum

2015-04-05 Thread David J. Weller-Fahy

* Dave Dodge dodo...@dododge.net [2015-04-04 18:30 -0400]:

Some formal key infrastructures managed by corporations, government
departments, etc. will issue you two distinct private keys, each with
its own X.509 certificate.  One is only to be used for digital
signatures, and the other is only to be used for data encryption.


That's exactly the situation I'm dealing with.


Last I checked (admittedly this was a couple years ago) it only let you
specify a single private key to be used for both signing outgoing mail
and decrypting incoming mail.  Which is not sufficient.  I had to patch
in some more variables.


This time I was able to get it to work minimally by hard-coding some
certificates/keys, so there were no patches needed to get it to
minimally work.  If I had to deal with multiple S/MIME certificates
(say, a personal and work) then it would get messy quickly.

See http://marc.info/?l=mutt-usersm=142825894618747 for the solution.


Unfortunately the changes I made are on a corporate network where I
can't share them.  I don't recall it being very complicated, though.
The next time I get a chance I'll review the patches, and I might at
least be able to describe how I did it.


Thanks!  If you happen to get the changes out I'd appreciate a look: I'm
going to see if I can figure out how to add a single
smime_default_signature_key option, which should be sufficient to make
things work the way I would expect.

Regards,
--
dave [ please don't CC me ]


signature.asc
Description: PGP signature


Two private SMIME certificates conundrum

2015-04-03 Thread David J. Weller-Fahy

After much frustration I discovered why mutt wouldn't work with the
SMIME keys issued at work: there are two of the private keys (one for
signature, one for encryption), and a single public key.  As I have an
employer that is more than willing to let me use mutt (if I can get it
to work properly) I am inclined to do whatever I can to get signing and
encryption functional!

I've always used GPG for email encryption and am not familiar with SMIME
use in mutt, so I have some questions:

Is this a supported configuration?  If so, does anyone have an example
configuration they'd like to share?

If it is not a supported configuration, does anyone have a work around
they've used successfully?

To be clear, what I'd like is the following:

1) Mutt signs outgoing messages (if told to sign) with the signature
key.

2) Mutt encrypts outgoing messages (if told to encrypt) with the
encryption key.

If it isn't a supported configuration, I suppose I'll have to dig into
the code... it can't be *that* hard, right? ;)

Regards,
--
dave [ please don't CC me ]


signature.asc
Description: PGP signature


Re: Some fairly simple-minded questions about using mutt with IMAP

2014-12-08 Thread David J. Weller-Fahy

* Chris Green c...@isbd.net [2014-12-08 17:09 -0500]:

Doesn't anyone use IMAP?  I must admit when I tried it (a few times
over the years, but not very recently) it never felt quite as easy and
transparent as using mutt on a local mail spool.


I stopped using IMAP directly a while ago, and started using offlineimap 
to sync to local.  I believe (at the time) it was just too slow trying 
to access my IMAP mail from the middle-east when my server was in the 
US.  Offline IMAP was a much better solution to that, and I never 
changed it when I returned.


I may give it a try now that I've settled down a bit, but I'll need the 
ability to work off-line at any time, and I'm not sure mutt'll do that.


Regards,
--
dave [ please don't CC me ]


pgpJiyd9znc_4.pgp
Description: PGP signature


Re: folder-hook for sending to lists

2014-02-02 Thread David J. Weller-Fahy
* glphvgacs darwinsker...@gmail.com [2014-02-02 14:28 -0600]:
  ++ 02/02/14 14:05 -0500 - glphvgacs:
  when starting the Mail composition in mutt, is there a way skip the
  'To:' header by filling it up based on a given pattern?
 
 is there a way to add the '\n' there?

I didn't find a way to add the '\n', instead I looked for another way to
skip that prompt entirely.  For each mailing list you want to use in
this way, do the following.

#v+
folder-hook .   unset autoedit; set edit_headers=yes
folder-hook '=lists\.mutt-users'set autoedit=yes; set edit_headers=yes
folder-hook .   unmy_hdr To:
folder-hook '=lists\.mutt-users'my_hdr To: mutt-users@mutt.org
#v-

Note that both set autoedit=yes and set edit_headers=yes together
are what gets you to the message without setting the recipient first.
Also note that the folder-hook to execute in all other folders is based
on my defaults, change to suit.  Also, also note that the folder name is
based on my folder layout, not yours, so that'll have to change.

See section 3.18. autoedit in TFM.

Regards,
-- 
dave [ please don't CC me ]


pgp4rUExapHvG.pgp
Description: PGP signature


Re: folder-hook for sending to lists

2014-02-02 Thread David J. Weller-Fahy
* glphvgacs darwinsker...@gmail.com [2014-02-02 18:25 -0600]:
 now that is what i'm talking about. great stuff, thanks.

You're welcome.

 and this to hooks:
   folder-hook to:mutt-users@mutt.org '\
 set autoedit=yes
 my_hdr To:'
   folder-hook to:mutt-users@mutt.org '\ 
 my_hdr To:mutt-users@mutt.org'

FYI, you may be able to merge those into one folder-hook.

 np, i use mutt-kz and folder are actually vfolder and easy grep (Get
 with rexp)

Ah: I'll have to check that out at some point.

  See section 3.18. autoedit in TFM.
 
 a 'see also' pointer to that from mailing list section would be nice.

Hrm... I may have to put together a patch for that... have to gather
enough round tuits first. ;)

Regards,
-- 
dave [ please don't CC me ]


pgpsq1LtfaXZC.pgp
Description: PGP signature


Re: folder-hook for sending to lists

2014-02-02 Thread David J. Weller-Fahy
* glphvgacs darwinsker...@gmail.com [2014-02-02 18:25 -0600]:
 and this to hooks:
   folder-hook to:mutt-users@mutt.org '\
 set autoedit=yes
 my_hdr To:'
   folder-hook to:mutt-users@mutt.org '\ 
 my_hdr To:mutt-users@mutt.org'

By the way, you may want to check your hooks thoroughly, as a second
address seems to have crept into your response.  The second address
includes a trailing single quote (').  The To: header I received from
you via the mailing list is below.

#v+
To: mutt-users@mutt.org, mutt-users@mutt.org'
#v-

This may or may not be related to the trailing space I noticed in your
hooks (the trailing space i on the first line of the second folder-hook
in the quoted content above).

Regards,
-- 
dave [ please don't CC me ]


pgpX4Q4t4oxJ3.pgp
Description: PGP signature


Re: temporarily modifying thread display in the index?

2013-01-14 Thread David J. Weller-Fahy
* Will Fiveash will.five...@oracle.com [2013-01-14 14:22 -0500]:
 Indeed, with hide_top_limited=yes I can limit the display of a
 subthread in the desired way.  I'm now using this index macro:
 
 macro index _S tag-subthreadlimit~T\ntag-subthread Display only 
 subthread
 
 with hide_top_limited=yes in my .muttrc.  Thanks for posting that tip.

No worries, thanks for putting up the resulting macro... I may just be
using that soon.

-- 
dave [ please don't CC me ]


pgpJZh0Ntq7mW.pgp
Description: PGP signature


Re: Setting default address breaks reverse_name

2013-01-13 Thread David J. Weller-Fahy
* Marco net...@lavabit.com [2013-01-13 07:17 -0500]:
 How do I correctly set a default address which does not break
 reverse_name?

Try using set from=u...@example.com instead of my_hdr.

See section 3.75 in TFM.

Regards,
-- 
dave [ please don't CC me ]


pgpe4uMBj9fU2.pgp
Description: PGP signature


Re: Setting default address breaks reverse_name

2013-01-13 Thread David J. Weller-Fahy
* Marco net...@lavabit.com [2013-01-13 11:13 -0500]:
 On 2013–01–13 David J. Weller-Fahy wrote:
 
  * Marco net...@lavabit.com [2013-01-13 07:17 -0500]:
   How do I correctly set a default address which does not break
   reverse_name?
  
  Try using set from=u...@example.com instead of my_hdr.
  
  See section 3.75 in TFM.
 
 Using “from” instead of “my_hdr From:” works. Thanks.

No worries, glad I could help.

-- 
dave [ please don't CC me ]


pgpijaVBeVEfa.pgp
Description: PGP signature


Re: temporarily modifying thread display in the index?

2013-01-13 Thread David J. Weller-Fahy
* David J. Weller-Fahy dave-lists-mutt-us...@weller-fahy.com [2013-01-11 
12:44 -0500]:
 * Will Fiveash will.five...@oracle.com [2013-01-11 12:35 -0500]:
  On Fri, Jan 11, 2013 at 12:12:01PM -0500, David J. Weller-Fahy wrote:
   
   Hrm... have you tried a combination of 'tag-subthread' and
   'limit'?
   
  That is close but not exactly what I'm looking for.  The indentation
  level of the subtree parent is such with the thread I'm looking at
  that the thread display is still beyond the terminal window.  It would
  be perfect if mutt could also reset the indent level of the subtree
  parent to 0.
 
 Yep, sorry about the red herring: I just checked on a huge thread in
 another list and it is as you say.  It would be useful to have an option
 to reset the indent level.

Ah-hah!  The herring was green!

Try setting hide_top_limited when limiting to a tagged subthread.  I
think that does what you want, and with a little scripting you could
wrap everything into a macro.  Thanks to Marco for inspiring me to
search through the manual for thread. ;)

HTH,
-- 
dave [ please don't CC me ]


pgplxORXlvmdn.pgp
Description: PGP signature


Re: What does the star in the index represent

2013-01-13 Thread David J. Weller-Fahy
* Marco net...@lavabit.com [2013-01-13 11:57 -0500]:
 what does the star in the index view of a thread represent?
 
 ├─
 ├─
 │ └─
 │   └─
 └* --- this is what I'm talking about
   └─
 
 It's probably explained somewhere in the manual, but frankly, I have
 no clue what to search for.

I couldn't find it in the manual, but if I remember correctly that star
indicates the message is part of a pseudo-thread, meaning the message
marked with a star does not have the References and/or In-Reply-To
messages headers set, and thus is only associated with that thread
because the Subject header matches that of the rest of the Thread.  Try
setting strict_threads temporarily - if the starred message jumps to a
new thread then that is probably what it is.

HTH,
-- 
dave [ please don't CC me ]


pgp5lPjVY1JLw.pgp
Description: PGP signature


Re: temporarily modifying thread display in the index?

2013-01-11 Thread David J. Weller-Fahy
* Will Fiveash will.five...@oracle.com [2013-01-10 18:49 -0500]:
 What I'd like is a way to temporarily pull in a subthread so I can
 see the threading.  To put it another way, make some message that's
 the parent of a subthread look like the parent of the entire thread
 causing mutt to hide the rest of the entire thread (if that makes
 sense).  Can mutt do this?

Hrm... have you tried a combination of 'tag-subthread' and 'limit'?

Workflow would be something approximating the following.

- Go to first message in subthread you want to see.
- Execute tag-subthread.
- Limit to pattern ~T.

I just tried it on a subthread of this thread, and it worked, but I
don't have another thread handy which is huge enough to give it a good
workout.

HTH,
-- 
dave [ please don't CC me ]


pgpCEpH9wYUcW.pgp
Description: PGP signature


Re: temporarily modifying thread display in the index?

2013-01-11 Thread David J. Weller-Fahy
* Will Fiveash will.five...@oracle.com [2013-01-11 12:35 -0500]:
 On Fri, Jan 11, 2013 at 12:12:01PM -0500, David J. Weller-Fahy wrote:
  
  Hrm... have you tried a combination of 'tag-subthread' and
  'limit'?
  
 That is close but not exactly what I'm looking for.  The indentation
 level of the subtree parent is such with the thread I'm looking at
 that the thread display is still beyond the terminal window.  It would
 be perfect if mutt could also reset the indent level of the subtree
 parent to 0.

Yep, sorry about the red herring: I just checked on a huge thread in
another list and it is as you say.  It would be useful to have an option
to reset the indent level.

-- 
dave [ please don't CC me ]


pgp93LFQyiQ0M.pgp
Description: PGP signature


Re: Seeing subfolder - dovecot - imap - maildir

2012-11-16 Thread David J. Weller-Fahy
* Linda haniganw...@earthlink.net [2012-11-14 00:04 -0500]:
 I use dovecot with Maildir for the imap server. I can view the inbox fine
 but can't access or list  the subdirectories

I assume you can with other IMAP clients, right?

 Here is the .muttrc lines that would be relevant
 
 set spoolfile=imap://office-mail@star/
 set folder=imap://office-mail@star/
 set record=imap://office-mail@star/Sent
 set imap_user=office-mail
 
 [snips...]
 
 I am pretty sure I need to change ~/maildir to something but don't
 know what to use in its place.  Also I changed mailboxes from Mail to
 Maildir but it doesn't seem to change anything. I also tired a set
 mask command I found in some howtos but then I lost the inbox.

For another technique, you may want to try using one (or both) of the
following two options available for IMAP:

imap_check_subscribed
imap_list_subscribed

When I used dovecot directly (now I use offlineimap with dovecot) I did
not set my mailboxes explicitly, but allowed imap_check_subscribed to do
that for me.  The only settings I had (IMAP related) to make things work
(this was with dovecot 1.2/2.0/2.1) follow.

#v+
set folder=imaps://mx.weller-fahy.com   # default location (value of = or +)
set spoolfile=+INBOX# initial folder (delivery location)
set mbox=+INBOX # read mail from $spoolfile goes here

set imap_user=d...@weller-fahy.com
set imap_idle
set imap_check_subscribed
set imap_headers=X-SPAM-STATUS X-SPAM-LEVEL
unset imap_passive
#v-

So, in your case you may want to try the following.  Note I have removed
the slash at the end of imap://office-mail@star, if that is required
to access your folders, please put it back ;).  Another thing, I noticed
you did not list an explicit INBOX, so I'm assuming there's a reason for
that and not including it.  If, however, there *is* an explicit INBOX in
the IMAP account, make sure you change spoolfile to be +INBOX (and,
possibly, your mbox to +INBOX as well).

#v+
set folder=imap://office-mail@star
set spoolfile=+
set mbox=+
set record=+Sent

set imap_user=office-mail
set imap_check_subscribed
#v-

One last thing that I noticed was the folder setting: Are all your
folders under the INBOX on your IMAP server?  Or are they at the same
level as the INBOX?

Hope that helps or leads you in the right direction.

Regards,
-- 
dave [ please don't CC me ]


pgp5Ei01oa3Et.pgp
Description: PGP signature


Re: Anyone using Mutt on a Mac?

2012-05-13 Thread David J. Weller-Fahy
* Cameron Simpson c...@zip.com.au [2012-05-12 20:26 -0400]:
 On 12May2012 19:10, Jim Graham spooky1...@gmail.com wrote:
  Any other thoughts on Mutt + Mac OS X welcome, either here or via
  direct e-mail (using the list is probably better, as it's already
  whitelisted in procmail).
 
 I use the mutt from MacPorts (WELL worth installing - very easy and
 gives you access to a HUGE suite of common UNIX tools).
 
   http://www.macports.org/install.php

I've used both MacPorts and fink (mostly macports), but ended up using
HomeBrew [1] as my primary source of software on the Mac.  Something to
check out if you're not sure which packaging system to use.

[1]: http://mxcl.github.com/homebrew/

They have a Brew for mutt which is 1.5.21, and (for the roll-yer-own
types such as myself) all the requisites to build mutt from source.

Regards,
-- 
dave [ please don't CC me ]


pgp8rTEm96wRq.pgp
Description: PGP signature


Re: Anyone using Mutt on a Mac?

2012-05-13 Thread David J. Weller-Fahy
* Cameron Simpson c...@zip.com.au [2012-05-13 19:55 -0400]:
 I do like the install approach brew uses - I used the type of same
 scheme myself at a former workplace to build third party packages for
 the workstations there:
 
   http://www.cskk.ezoshosting.com/cs/css/syncopt.html

Interesting... I've never had to deal with that many machines, so never
had to solve that problem, but now it's socked away for when I *do*. :)

I think my favorite part of the HomeBrew philosophy is don't include
things the base already includes: It removes all sorts of conflicts
which can otherwise arise.

On the other hand, I found it easier to manually download the
docbook-xml and docbook-xsl archives than to get the information from
HomeBrew or OS X, so (again) not a perfect fit for everything.

-- 
dave [ please don't CC me ]


pgpbok9dAR44N.pgp
Description: PGP signature


Re: Mail folder backtracking [Was: New mail indicator]

2012-05-10 Thread David J. Weller-Fahy
* Diep Pham Van i...@favadi.com [2012-05-10 12:07 -0400]:
 I have many folders start with [Gmail]. :)

Have you tried hitting 'c', then '-', then enter?  That takes you to
your last visited folder.

Regards,
-- 
dave [ please don't CC me ]


pgpGQ58bPvUSJ.pgp
Description: PGP signature


Re: Current mailbox as $record

2012-02-04 Thread David J. Weller-Fahy
* E. Prom e3p...@gmail.com [2012-02-04 19:23 -0500]:
 How can I make mutt to save outgoing mail to the currently opened
 mailbox?

Try the following (from my muttrc):

#v+
folder-hook . set record=^# sent mail gets saved in current mailbox
#v-

 I tried several hooks, but none accepted the sequence %b (while
 others, like %a, worked fine).
 
 Any idea?

Check Table 4.7 in the manual.

Regards,
-- 
dave [ please don't CC me ]


Re: [OT] GPG signature fails

2011-03-15 Thread David J. Weller-Fahy
* Derek Martin inva...@pizzashack.org [2011-03-15 09:42 -0500]:
 Actually, do either of these last two messages (this one, and the one
 I'm replying to) verify correctly?  I upgraded OpenSSL, and now I see
 this:
 
 $ gpg --list-packets foo4.txt
 :signature packet: algo 17, keyid 1C49C048DFBEAD02
 version 3, created 1300199147, md5len 5, sigclass 01
 digest algo 2, begin of digest 57 51
 data: [160 bits]
 data: [160 bits]
 
 Starting to look like an OpenSSL bug after all..

Odd... I see a bad signature as well.  Here's the data I get from this
message (saved to mbox).

#v+
dave@pooh:~$ gpg --list-packets tst.msg
:signature packet: algo 17, keyid 1C49C048DFBEAD02
version 3, created 1300199677, md5len 5, sigclass 0x01
digest algo 2, begin of digest 12 73
data: [160 bits]
data: [158 bits]
#v-

Version information is as follows.

#v+
gpg (GnuPG) 1.4.11
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH, CAMELLIA128, 
CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
#v-

Not sure what other diagnostics to do... suggestions?

Regards,
-- 
dave [ please don't CC me ]


pgpvf3Fn8pb4t.pgp
Description: PGP signature


Re: unified inbox

2011-02-28 Thread David J. Weller-Fahy
* Derek Martin inva...@pizzashack.org [2011-02-27 18:11 -0800]:
 On Thu, Feb 24, 2011 at 02:34:43PM -0600, Puneet Kishor wrote:
  There is much that I have to do to really get comfortable with mutt, but
  I think I am making slow but steady progress. One feature that really
  bothers me because of its absence is a unified mailbox. 
 
 There isn't really any way to do this, except -- as others have said
 already -- to get all your mail somehow delivered to the same folder.
 ...
 The easiest way to deal with multiple accounts with mutt is to deliver
 mail from those accounts into specific folders, and use folder hooks
 to set variables associated with the respective accounts upon entering
 the folder.

I was reading the above message when it occurred to me that using the
hcache functions of mutt might be suitable to implementing a unified
inbox functionality.

For example, if you could define multiple inboxes and their aliases, and
defined each to have the same aliase, then each accounts' messages would
be stored in the same hcache directory, and thus displayed in the same
the mail folder.

Obviously, this is a rough draft and would need more work to be fully
functional... but I think it might be useful and doable.  Of course, it
would need a patch (extensive) to implement... thoughts?
-- 
dave [ please don't CC me ]


pgpuy5sqyfvXT.pgp
Description: PGP signature


Re: hooks and automatically determining from address : complicated way

2010-01-24 Thread David J. Weller-Fahy
* E. Prom e3p...@gmail.com [2010-01-20 23:04 -0400]:
 Ideally, I would then just source `external_program`, where
 external_program returns the name of a mutt conf file changing all
 these variables.

 [snips]

 My problem is that I need to pass this external_program the address
 I'm writing to. And of course, `external_program ~t` does not work.

 Things are getting complicated. Is there a way to do that in mutt, or
 do I have to look for patches?

I was looking for a way to do something similar, but where I'd pass the
current folder name as the argument, and ended up solving the problem
with a ton of friendly list help (Hi Cameron!).

Check http://marc.info/?t=12290851354 and the following email in
that thread http://marc.info/?l=mutt-usersm=124386201828318.

The script I used with that command is in
http://marc.info/?l=mutt-usersm=124386201828319.

The wrapping is a bit ugly, so the solution lines are included below.

#v+
folder-hook . 'set my_oldrecord=$record; set record=^; set my_folder=$record; 
set record=$my_oldrecord'
folder-hook . 'push :\`~/.mutt/listbox-to-email.pl\ $my_folder\`\enter\'
#v-

This probably won't get you all the way there, but at least it
demonstrates how to get information to the command line from inside
mutt.

HTH
-- 
dave [ please don't CC me ]


pgpJa1yDtlsQU.pgp
Description: PGP signature


Re: mutt feeds more to gnupg than it needs, causes invisible/lost

2009-11-29 Thread David J. Weller-Fahy
* Michael Wagner michaeldeb...@web.de [2009-11-29 07:59 -0500]:
 * martin f krafft madd...@madduck.net 29.11.2009
  This *could* be due to gnupg. Do you see the unsigned portions of
  the text if you run
 
gpg  ~/test

I do *not* see the text preceding the digitally signed portion of the
message when I run `gpg  ~/test`.  Odd.

 I can reproduce this behaviour here on my Debian Sid box too. Also
 with the command above 'gpg  ~/test' I can't see the unsigned part of
 the message.

 @David: What version of gnupg do you have?

gpg (GnuPG) 1.4.10

 When you need more information from me to demarcate this bug, ask. Do
 you think this bug belongs to 'mutt' or to 'gnupg'?

Let me know as well, I'll help as I can.

Regards,
-- 
dave [ please don't CC me ]


pgphcZ3oZE23V.pgp
Description: PGP signature


Re: mutt feeds more to gnupg than it needs, causes invisible/lost

2009-11-28 Thread David J. Weller-Fahy
* Todd Zullinger t...@pobox.com [2009-11-27 21:07 -0500]:
 If you call check-traditional-pgp on this message, is this text lost?
 It is for me and I would call it a bug.  It might also be some subtle
 difference between our configurations, gpg versions, etc.

FWIW I copied your message into ~/test, and then opened it using the
latest tip, and the following command-line.

#v+
mutt -n -F usr/share/doc/mutt/samples/gpg.rc -f ~/test
#v-

I then entered ':exec check-traditional-pgp' in mutt, and viewed the
message.  The text preceding the digitally signed portion of the message
was still visible.

My mutt is:

#v+
Mutt 1.5.20 (2009-10-28)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Darwin 10.2.0 (i386)
ncurses: ncurses 5.7.20081102 (compiled with 5.7)
libiconv: 1.11
hcache backend: tokyocabinet 1.4.35
Compile options:
-DOMAIN
+DEBUG
+HOMESPOOL  -USE_SETGID  +USE_DOTLOCK  -DL_STANDALONE  +USE_FCNTL
-USE_FLOCK
-USE_POP  +USE_IMAP  +USE_SMTP
+USE_SSL_OPENSSL  -USE_SSL_GNUTLS  +USE_SASL  -USE_GSS
+HAVE_GETADDRINFO
+HAVE_REGCOMP  -USE_GNU_REGEX
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME
-CRYPT_BACKEND_GPGME
-EXACT_ADDRESS  -SUN_ATTACHMENT
+ENABLE_NLS  -LOCALES_HACK  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET
+HAVE_LANGINFO_YESEXPR
+HAVE_ICONV  -ICONV_NONTRANS  -HAVE_LIBIDN  +HAVE_GETSID  +USE_HCACHE
-ISPELL
SENDMAIL=/usr/sbin/sendmail
MAILPATH=Maildir
PKGDATADIR=/Users/dave/usr/share/mutt
SYSCONFDIR=/Users/dave/usr/etc
EXECSHELL=/bin/sh
-MIXMASTER
To contact the developers, please mail to mutt-...@mutt.org.
To report a bug, please visit http://bugs.mutt.org/.
#v-

I seem to recall this being brought up previously on the mailing list,
but can't find any reference (which may mean it is all in my head).
I'll keep searching, but haven't found anything about this particular
problem yet.

JADP.

Regards,
-- 
dave [ please don't CC me ]


pgpoGNubLzcgO.pgp
Description: PGP signature


Re: use current folder name as argument to abitrary command

2009-07-21 Thread David J. Weller-Fahy
* Cameron Simpson c...@zip.com.au [2009-07-11 19:37 -0500]:
 On 10Jul2009 13:48, Nicolas Rachinsky mutt-user...@ml.turing-complete.org 
 wrote:
 | * Rocco Rutte pd...@gmx.net [2009-07-10 13:44 +0200]:
 |  I don't know if I mentioned this already, but I think I once
 |  hacked support for read-only variables in mutt-ng that would
 |  expose certain internal settings.
 |
 | I think, this could be very useful.

 Me too. Witness the hoop jumping I and others have recently done to
 get that, also the worse hoop jumping to then _use_ that value in an
 external/shell command.

 | Message-ID of the current message, filename of the current message
 | (for maildir/mh folders).

+1 please!  Also, would it be very difficult to make mutt read more than
one line when using backtics?  Actually, that's a different subject and
probably needs its own feature request.

  - setenv ENVVAR mutt-string-with-$mutt-vars
  to get mutt variables available to an external command

This would be really useful.

  - push muttvar new value
pop muttvar
  to make a number of macros much easier to write; currently
  some of my macros must know that I use a particular setting,
  and that in turn means I must know to not alter that setting

Not something I'd thought of... intereseting.

Regards,
-- 
dave [ please don't CC me ]


Re: use current folder name as argument to abitrary command

2009-07-21 Thread David J. Weller-Fahy
A little eye-surgery and suddenly you appreciate being to ready email.
;)

[snips throughout]

* Cameron Simpson c...@zip.com.au [2009-06-26 16:40 -0500]:
 On 25Jun2009 23:50, David J. Weller-Fahy 
 dave-lists-mutt-us...@weller-fahy.com wrote:
 | * Cameron Simpson c...@zip.com.au [2009-06-03 23:56 -0500]:
 |  folder-hook . macro index '\$' \change-folder\$my_folderenter\
 |  folder-hook . 'push :\`cs-mutt-per-folder\ $my_folder\`\enter\'
 |
 | Hrm... so every-time you sync your mailbox, you change folders to the
 | current folder?  Why is that - checking for new mail?

 The first hook does indeed re-enter the folder if I type '$' in the
 index view. ('$' in pager view still does a plain sync.)

 The reason for this is that the sync operation only commits my
 changes (deleted, unread-read transitions etc) to the folder. It does
 not check the folder for new mail. So your surmise is exactly correct.

Hrm... I'm currently using a remap of the '.' key, as follows.

#v+
folder-hook '^imap(s)?://' 'macro index,pager . imap-fetch-mailbuffy-list'
#v-

This works rather handily for me as I use the buffy-list incessently.

 | Now I can clean out my mutt config folder again, and update my
 | master muttrc file.  This will be quite a change to the master
 | muttrc considering the lines made obsolete.

 You have a config folder? How's that work? A bunch of special purpose
 muttrcs that get sourced at need?

Nothing nearly so neat (although I used to have an ssl-enabled perl
script solely to get into my imap server and get a folder list so I
could parse it to get a mailboxes list).  My config folder is simply my
~/.mutt directory.  I keep everything (except my passfile) in a git
repository on my server so I won't have to worry about backing up my
linux configuration when I create a new VM, or switch to a MacBook this
fall/winter (rubbing hands in anticipation).

I have the following rc files.

#v+
d...@eeyore:~/.mutt$ ls | grep -v hcache
cache/
incorporate/
old/
aliases
colors
headers
imap
mailbox-based-ids.pl*
muttrc
passfile
sendmail
signature.afsa
signature.list
signature.normal
#v-

The cache directory is for both body and header caching.  passfile sets
my IMAP password, and is ignored by git.  Most rc files are read one
time on startup.  The incorporate and old directories are rc files from
before I set up the one muttrc to rule them all repository and had
multiple versions scattered between mutt instances.  I have yet to
collect enough round-tuits to comb through them for any nuggets of
wisdom.

So, not rocket science, but it keeps things out of my home directory. ;)

Regards,
-- 
dave [ please don't CC me ]


Re: use current folder name as argument to abitrary command

2009-07-21 Thread David J. Weller-Fahy
* David J. Weller-Fahy dave-lists-mutt-us...@weller-fahy.com [2009-07-21 
23:30 -0500]:
 A little eye-surgery and suddenly you appreciate being to ready email.

being to ready = being able to read

Probably appreciate being able to proof-read, too... grumble.

-- 
dave [ please don't CC me ]


Re: use current folder name as argument to abitrary command

2009-06-25 Thread David J. Weller-Fahy
* Cameron Simpson c...@zip.com.au [2009-06-03 23:56 -0500]:
 On 31May2009 21:29, David J. Weller-Fahy 
 dave-lists-mutt-us...@weller-fahy.com wrote:
 | * Cameron Simpson c...@zip.com.au [2009-05-31 01:41 -0500]:
 [...big snip...]
 | As you suggested, I changed the \\\` to \`, and voilà!  It works without
 | the macro!  I can only plead tired-eye-rushing syndrome, as that's the
 | only way I should have missed trying all the possibilities instead of
 | skipping the one that worked.

 I suggested it deductively, but had the advantage of starting my debug
 from your example.

;) As usual, multiple heads being better than one.

 Thank you, I've adopted exactly this incantation in my own muttrc:

   folder-hook . macro index '\$' \change-folder\$my_folderenter\
   folder-hook . 'push :\`cs-mutt-per-folder\ $my_folder\`\enter\'

Hrm... so every-time you sync your mailbox, you change folders to the
current folder?  Why is that - checking for new mail?

 | Also, I'll attach my little Perl script, as someone might find it handy.

 Wouldn't it be better to set from= always, and merely omit the subscribe
 command for non-lists? That way, if you switch _from_ a lists.* folder
 into a non-lists folder your from= will be repaired for non-list use.
 i.e. replace set wait_key with set from=your-core-address.

That is the problem (apparently) with having a muttrc which evolves with
you.  On one hand it is excellent because you have a muttrc to start
with, on the other hand that muttrc is full of the most interesting
cruft. ;)

It turns out I had a number of legacy methods of setting various knobs
depending on folder, which I've now rolled into the script.  Thanks for
the nudge!  I'm still working on setting the signature based on the
sender of a message (I want particular signature for one of my email
addresses, regardless of folder), but that can wait.

 I think that I rely on the alternates setting to control my fromness.
 (Except that I see there's a set from= in my config too. I shall have
 to check which one wins.)

Yep, I do that as well, but that doesn't help when composing a message
(I'll need to set up macros for that, and macros are low priority right
now).

 my own folder config script is here:
   http://www.cskk.ezoshosting.com/cs/css/bin/cs-mutt-per-folder

 [snips]

Hrm... tucking URL away for future analysis... thanks!

 Anyway, many thanks for the code simplification!

No worries - I'm just glad I've got this solved.  Now I can clean out my
mutt config folder again, and update my master muttrc file.  This will
be quite a change to the master muttrc considering the lines made
obsolete.

Thanks for the brainstorming, as I'm pretty sure it would have taken
infinitely longer on one brain.

Take care,
-- 
dave [ please don't CC me ]


Re: use current folder name as argument to abitrary command

2009-05-31 Thread David J. Weller-Fahy
* Cameron Simpson c...@zip.com.au [2009-05-31 01:41 -0500]:
 On 30May2009 22:20, David J. Weller-Fahy 
 dave-lists-mutt-us...@weller-fahy.com wrote:
 | #v+
 | folder-hook . 'push :\\\`~/.mutt/listbox-to-email.pl\ 
 $my_folder\\\`enter'
 | #v-
 |
 | I do not understand why the macro is required to force mutt to parse
 | that -quoted string, and now I'm wondering if there are any other
 | constructs which would allow the same level of parsing without defining
 | a macro... hrm.  Methinks I need to read more of the source, manual, and
 | wiki to understand, but that may have to wait until I get more
 | round-tuits.

 There are no macros in that command line. Hmm, there are macros in
 mine; I guess removing them is what you're after.

Yep, I probably should have been clear: It struck me as a waste to
generate a macro just so the string can be interpreted as a mutt-level
-string.  I was just trying different things to remove the requirement
for a macro.  It just occurred to me, though, that you might want the
macro so you can re-use the command later?  Not sure, but either way I
figured it out.

 If you get your perl script to log command line arguments to a file,
 what does it show? Is it even run?

The Perl script didn't run, instead I would get the following.
#v+
`~/.mutt/listbox-to-email.pl: unknown command
#v-

I had also tried the following command:
#v+
folder-hook . 'push :\`~/.mutt/listbox-to-email.pl\ $my_folder\`\\\enter\\\'
#v-

Which resulted in the following being left on the mutt command line.
#v+
:`~/.mutt/listbox-to-email.pl =lists.mutt-users`\enter\
#v-

That should have given me the clue-bat you gave me below, as it
indicates the enter (had it worked) would have executed
`~/.mutt/listbox-to-email.pl =lists.mutt-users`, which is what I wanted
to happen.  A... hindsight. ;)

 What if you change:
   \\\`
 into plain
   \`
 at the start and end?

As you suggested, I changed the \\\` to \`, and voilà!  It works without
the macro!  I can only plead tired-eye-rushing syndrome, as that's the
only way I should have missed trying all the possibilities instead of
skipping the one that worked.

For the record the following folder-hooks work to execute a script and
pass the current folder name as the script's first command line
parameter.
#v+
folder-hook +lists* 'set my_oldrecord=$record; set record=^; set 
my_folder=$record; set record=$my_oldrecord'
folder-hook . 'push :\`~/.mutt/listbox-to-email.pl\ $my_folder\`\enter\'
#v-

Also, I'll attach my little Perl script, as someone might find it handy.

 | That is odd, but workable.

 That does seem a little odd, since mutt's ok with blank lines in the
 muttrc.

Yep... another code-dive for another time.  Good timing on the solution,
anyway, as my next semester starts tomorrow. ;)

-- 
dave [ please don't CC me ]


Re: use current folder name as argument to abitrary command

2009-05-31 Thread David J. Weller-Fahy
* David J. Weller-Fahy dave-lists-mutt-us...@weller-fahy.com [2009-05-31 
21:30 -0500]:
 folder-hook +lists* 'set my_oldrecord=$record; set record=^; set 
 my_folder=$record; set record=$my_oldrecord'
  ^^^
That should have been '.', but you get the idea.

And the script is attached... it's apparently been that type of thread.
;)
-- 
dave [ please don't CC me ]


listbox-to-email.pl
Description: Perl program


Re: use current folder name as argument to abitrary command

2009-05-30 Thread David J. Weller-Fahy
* Cameron Simpson c...@zip.com.au [2009-05-26 18:20 -0500]:
 On 25May2009 22:30, David J. Weller-Fahy 
 dave-lists-mutt-us...@weller-fahy.com wrote:
[ ... snips ... ]
 | Brought a tear to my eye!  I just spent ~30 minutes trying to trim
 | away the macro, but I have not been able to yet.  I'm sure my
 | understanding of mutt's quoting levels is insufficient as of yet.

 You probably can't reduce it, given the order in which things need to
 happen.

Yep, I was coming to that conclusion.

[ ... snips ... ]
 |because we need to construct a mutt-level -quoted string, and
 |also it has to happen in the folder hook because we don't have
 |the folder name before then.

 It has to happen inside the folder-hooks because it needs to be
 re-applied if you switch folders. Also, (if you didn't want to update
 on a folder change) I think I established by experiment that the main
 muttrc is sourced before opening your first folder, so you can't ask
 for the folder name then.

I should have been more specific.  I understand why the folder-hook has
to be used, but don't quite get why the mutt-level -quoted string
can't come from something like the following (doesn't work).

#v+
folder-hook . 'push :\\\`~/.mutt/listbox-to-email.pl\ $my_folder\\\`enter'
#v-

I do not understand why the macro is required to force mutt to parse
that -quoted string, and now I'm wondering if there are any other
constructs which would allow the same level of parsing without defining
a macro... hrm.  Methinks I need to read more of the source, manual, and
wiki to understand, but that may have to wait until I get more
round-tuits.

 BTW, something I may raise in another thread: the output of
 cs-mutt-per-folder (or whatever command you put in backticks there)
 _must_ be a single line of text. Mutt reads just the first line and
 closes the pipe, producing a Broken Pipe signal in the script and
 discarding following lines. So the script should produce:

   mutt-cmd; mutt-cmd; ...

That is odd, but workable.  Also I found something to watch out for when
using this method: Make sure your script *always* produces a command
recognizable to mutt when run, otherwise the lack of a command will
cause an error.  For example, when run in my =lists folder my particular
script does not emit anything.  As a result, I receive a ': unknown
command' message on the status bar.  No harm, but it can be prevented.
I used a set wait_key\n just to test, and it prevented the message.

Regardless, this works for me and I'll be using it from now on.

Thanks again!
-- 
dave [ please don't CC me ]


Re: use current folder name as argument to abitrary command

2009-05-25 Thread David J. Weller-Fahy
Before I get into inline response - this works for me: Thanks Cameron!

* Cameron Simpson c...@zip.com.au [2009-05-12 03:27 -0500]:
 On 04May2009 22:25, David J. Weller-Fahy 
 dave-lists-mutt-us...@weller-fahy.com wrote:
[ ... snip-o-lot throughout ... ]
 | So, really the only problem I need to solve to make everything work
 | without having to patch mutt is expanding a my_* variable (perhaps any
 | variable?) within backticks.

 I have finally found some more time to look at this, and spent a few
 hours this morning. You are going to love this charming incantation:

   folder-hook . 'set my_oldrecord=$record; set record=^; set 
 my_folder=$record; set record=$my_oldrecord'
   folder-hook . 'macro index Z :push\ \:\\\`cs-mutt-per-folder\ 
 $my_folder\\\`\\\enterenter; push Z'

Wow.

 Simple and intuitive, eh? (There are just two folder-hook lines there,
 if your mailer folds the lines.)

Brought a tear to my eye!  I just spent ~30 minutes trying to trim away
the macro, but I have not been able to yet.  I'm sure my understanding
of mutt's quoting levels is insufficient as of yet.

[...]

 The method by which this was arrived at is as follows:
   - we need $my_folder expanded in the command
   - mutt vars are not expanded inside backticks (because that would
 mangle shell variable use in the shell command)

Given.

   - thus we need to construct the shell command a little like this:
   \`cs-mutt-per-folder $my_folder\`
 i.e. literal backticks, so we're not inside backticks when
 $my_folder is encountered.

I didn't think of that, good idea!

   - thus we need a string in our muttrc subject to this expansion,
 and we need to get something to use it:
   push :\`cs-mutt-per-folder $my_folder\`enter
 You can see this should push the text:
   :`cs-mutt-per-folder =me`
 if I'm in the folder =me.

Ok, that makes sense.

   - for added fun of course, this has to happen inside the folder-hooks.
 We can't just push stuff directly because we need to construct a
 mutt-level -quoted string, and also it has to happen in the
 folder hook because we don't have the folder name before then.

This part I am unclear on - rather, I am unclear on *why*, not
*whether*, it works that way.  Perhaps (certainly) I don't understand
mutt's quoting levels enough, and will have to dive through the wiki and
documentation again.

   - So we define a macro and then push the macro keystroke.
 That leads directly to the deeply nested quotes shown, which I
 then spent a LONG time fiddling with until it actually worked:-(

Brilliant!  I used your solution in this mutt session, and the from has
been set properly for every mailbox thus far.

Thanks again, Cameron, and I'll mark this solved in the subject for
future searchers. ;)

Regards,
-- 
dave [ please don't CC me ]


Re: use current folder name as argument to abitrary command

2009-05-04 Thread David J. Weller-Fahy
* Cameron Simpson c...@zip.com.au [2009-05-02 23:19 -0500]:
 On 02May2009 14:55, David J. Weller-Fahy 
 dave-lists-mutt-us...@weller-fahy.com wrote:
 | I get two results that I did not expect.
 | 1) I get the any key prompt after the shell command executes.
 | 2) my_revdir is not filled with the current folder name.

 Ok, you've got a few issues.

Always! ;)

 Mutt config commands _are_ executed in series, in the order in the
 config file.

 The keyboard input stream is not consulted until commmands have stopped.
[snips]
 So your wait_key shuffling runs to completion before anything you pushed
 is used. So push is not what you want, at least for what you're trying
 to use it for.

That matches exactly what I saw - it's good to get confirmation.

 I also suggest you utilise the `backtick` syntax. Like the shell, mutt
 will use shell output. For example:
[snips]
 So you can go:

   `muttecho.sh ...`

 in your muttrc. You'll have to escape a little to embed that in a
 folder hook. This avoids a lot of racy mucking around with temp files.

There's the rub, actually - I tried the backticks in an earlier
incarnation (they seemed to be a natural solution), but wasn't able to
get the variable to expand within the backticks.  If you know a way to
do that I'll be all ears, but I've been unable to find a way of escaping
the variable which allows variable expansion to take place within the
backticks.

Here is what I tried:
#v+
folder-hook . 'set my_oldrecord=$record; set record=^; set my_folder=$record; 
set record=$my_oldrecord'
folder-hook . `~/.mutt/muttecho.sh \$my_folder`
#v-

I then tried escaping the '\' before $my_folder (all the way up to six
'\' characters) with no luck.  I tried surrounding the variable with
double-quotes () with no luck.

I just had an idea, though, which could solve the problem, although it
wouldn't be useful to everyone (it would be dependent on their use of
wait_key).  Instead of unsetting wait_key as part of the specific
solution, unset wait_key whenever I'm in my mailing list hierarchy, and
set it to yes whenever I'm not.  That will avoid the restoring saved
state problem, and allow the shell to return without pausing for user
input.

The commands I tried follow.
#v+
folder-hook +lists* set my_oldrecord=\$record; set record=^; set 
my_folder=\$record; set record=\$my_oldrecord
folder-hook +lists* push shell-escape\~/.mutt/listbox-to-email.pl 
\$my_folder\enter
folder-hook +lists* push enter-command\source 
~/.mutt/listbox-to-email.rc\enter
#v-

These commands did not work as I wanted, but they did work somewhat.
They worked for the first mailing list folder I entered, and then
consistently set from to the last mailing list folder entered prior to
the current folder.  For example, if the mailing list folders I entered
(in order) were ml1, ml2, ml3, ml4, ml5; then the from address would be
set to ml1-email in ml1, ml1-email in ml2, ml2-email in ml3, ml3-email
in ml4, and ml4-email in ml5.  Very strange, but indicates the
listbox-to-email.rc file is being loaded before being updated.

Some notes about why those particular commands (so I can be corrected):
1)  I tried both the source and backtick method of the third folder-hook
with no success.
2)  I tried using 'push enter-command' because I thought it would keep
the command being executed and reading the resulting file in
sequence (as I understand the order of execution).

 I'm trying to solve a similar problem to yours, so I'm somewhat
 interested in this discussion.
[snip clever use of folder-hook w/macro]
 The macro is done as a folder hook because it must run _after_ the
 folder-hook that sets $my_folder, and it must set the macro to a
 string that has the value of $my_folder in it. You'll notice that the
 macro does _not_ mention $my_folder:
[snip help text]

Indeed, I've used similar things in the past.  I'd never looked into
exactly what sequence mutt processes the rc files, though, which is why
this particular problem had me confused for a bit.  Thanks for clearing
it up (at least the confusion part).

So, really the only problem I need to solve to make everything work
without having to patch mutt is expanding a my_* variable (perhaps any
variable?) within backticks.  As I have time I'm code-diving through the
sections of init.c dealing with backticks to gain a better understanding
of what happens, and hopefully I'll figure out what I need to do to get
variable expansion within backticks (or find out it is not possible).

Of course, regexp substitution within muttrc would be wonderful, but
isn't showing up any time soon. ;)

So, suggestions anyone?

Regards,
-- 
dave [ please don't CC me ]


Re: use current folder name as argument to abitrary command

2009-05-02 Thread David J. Weller-Fahy
* Noah Sheppard nhshepp...@taylor.edu [2009-05-02 01:56 -0500]:
 On Fri, May 01, 2009 at 11:28:39PM -0500, David J. Weller-Fahy wrote:
  Right now everything works except from never gets set.  I thought
  this might be because of the timing (source happening before the
  link is created), so I added a 0.5 second sleep after list-from
  generation.  Adding the sleep did not fix the problem from never
  gets set because the source command runs before the shell finishes
  creating the link, but I'm not sure.

 Hmm, I implemented a similar thing, and it worked correctly (thanks
 for suggesting the whole using a script to write a mutt command to a
 file and then sourcing it, since I hadn't gotten that far before).

You're welcome, I'm glad it works for you.  My initial attempt was to
have a script which would use the filename of the script as the input,
then create a link to that script which was named =lists.mutt-users
(or whatever the mailbox is).  That seemed overly complicated, though
neat, so I dropped that for command-line parameters.

My mutt runs on a debian install under VirtualBox which is running on a
Vista Host.  That said, my theory is that mutt is going fast enough that
the file is not available in time for mutt to source it on my
installation.  Not sure what to do if that's the case, though.

Here's my mutt -v output just in case there's something screwy.  I'm
following HEAD on a personal install of mutt.
#v+
Mutt 1.5.19 (2009-04-28)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.26-2-686 (i686)
ncurses: ncurses 5.7.20090404 (compiled with 5.7)
libidn: 1.12 (compiled with 1.12)
hcache backend: GDBM version 1.8.3. 10/15/2002 (built Aug 27 2008
09:23:18)
Compile options:
-DOMAIN
+DEBUG
+HOMESPOOL  -USE_SETGID  +USE_DOTLOCK  -DL_STANDALONE  +USE_FCNTL
-USE_FLOCK
-USE_POP  +USE_IMAP  -USE_SMTP
+USE_SSL_OPENSSL  -USE_SSL_GNUTLS  -USE_SASL  -USE_GSS
+HAVE_GETADDRINFO
+HAVE_REGCOMP  -USE_GNU_REGEX
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME
-CRYPT_BACKEND_GPGME
-EXACT_ADDRESS  -SUN_ATTACHMENT
+ENABLE_NLS  -LOCALES_HACK  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET
+HAVE_LANGINFO_YESEXPR
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +USE_HCACHE
ISPELL=/usr/bin/ispell
SENDMAIL=/usr/sbin/sendmail
MAILPATH=Maildir
PKGDATADIR=/home/dave/usr/mutt
SYSCONFDIR=/home/dave/usr/etc
EXECSHELL=/bin/sh
-MIXMASTER
To contact the developers, please mail to mutt-...@mutt.org.
To report a bug, please visit http://bugs.mutt.org/.
#v-

 As I said, this works for me, and I don't have any timing issues
 either.  I'm curious, why the push enter-command at the beginning
 of the last folder hook up above?

I was trying to make the source happen later in the sequence of events.
My theory was that pushing the source command onto the stack would force
mutt to wait until after running the shell command to perform the
source.  This does not work (unfortunately), although it does force the
source to happen later in the sequence of events.

 I never knew whether mutt ran hooks in parallel or one after the
 other.  Was it just a hunch you had that mutt doesn't wait for one
 hook to complete before moving on to another, or do you have some
 documentation which indicates this?  I checked the mutt documentation
 but did not see anything to that end.

First, I tried your example and my_revdir did not contain the folder
name, although all the individual steps functioned as advertised.  I
ended up simplifying it a bit by not changing the shell, and simply
including that as the text of the shell-escape command (that way I
don't have to worry about reseting the shell).

The timing idea is a hunch based on a specific behavior I can still
reproduce.  Using the following muttrc commands.
#v+
# previously discussed
folder-hook . set my_oldrecord=\$record
folder-hook . set record=^
folder-hook . set my_curdir=\$record
folder-hook . set record=\$my_oldrecord

# save the state of wait_key
folder-hook . set my_wait_key=\$wait_key
# turn off wait_key
folder-hook . set wait_key=no
# run command to create file to source
folder-hook . push shell-escape\~/.mutt/muttecho.sh \$my_curdir\enter
# set wait_key to saved state
folder-hook . set wait_key=\$my_wait_key
# source the file
folder-hook . push enter-command\source ~/.mutt/muttintest\enter
#v-

And the following muttecho.sh file.
#v+
[ -e ~/.mutt/muttintest ]  rm ~/.mutt/muttintest
echo set my_revdir=$1  ~/.mutt/muttintest
#v-

I get two results that I did not expect.
1) I get the any key prompt after the shell command executes.
2) my_revdir is not filled with the current folder name.

If I move the set wait_key=\$my_wait_key folder-hook below the source
hook, and leave

Re: use current folder name as argument to abitrary command

2009-05-01 Thread David J. Weller-Fahy
First, my goal is to change the from variable based on which mailing
list mailbox I'm in (my non-list email addresses don't change enough to
make this worthwhile for them).  I was using a one-line patch to export
the mailbox name to the shell.  With your solution that should no longer
be necessary, but I'm having trouble getting this to work.  All my list
email addresses are based on the mailing list name so the actual
translation is easy.  I'm almost there.

* Noah Sheppard nhshepp...@taylor.edu [2008-12-15 08:52 -0600]:
 I modified it slightly so that I get the current folder path in a
 variable on its own so I can be free to play with it further:

 folder-hook . set my_oldrecord=\$record
 folder-hook . set record=^
 folder-hook . set my_curdir=\$record
 folder-hook . set record=\$my_oldrecord

Once I had time, this was very helpful - thanks to both you and Kyle.

 The next step is to strip down that name so I have only the folder
 name, not the full path.  The best way I can think to do this would be
 to pass the full path folder variable to a shell command which will
 strip that down, and return the folder name to another variable (or
 the same one, I don't care).  I'm stuck at figuring out how to pass a
 mutt variable to a shell command.

I tried your way for a bit, but was unable to make it work - here's
where I'm at now.

#v+
folder-hook +lists.* set my_oldrecord=\$record
folder-hook +lists.* set record=^
folder-hook +lists.* set my_curdir=\$record
folder-hook +lists.* set record=\$my_oldrecord

folder-hook +lists* set shell=\~/.mutt/gen-set-from.pl \$my_curdir  sleep 
0.5\
folder-hook +lists* push shell-escapeenter
folder-hook +lists* push enter-commandsource ~/.mutt/list-fromenter
#v-

Some explanation is in order.  The gen-set-from.pl script takes the
current mailing list mailbox name (something similar to
=lists.mutt-users) on the command-line, and writes the file list-from
containing the line set from=dave-lists-mutt-us...@weller-fahy.com.

Right now everything works except from never gets set.  I thought this
might be because of the timing (source happening before the link is
created), so I added a 0.5 second sleep after list-from generation.
Adding the sleep did not fix the problem from never gets set because the
source command runs before the shell finishes creating the link, but I'm
not sure.

At this point I've been staring at the problem for too long.  Can anyone
suggest a fix for this?

Regards,
-- 
dave [ please don't CC me ]


Re: fixing email dates

2009-04-30 Thread David J. Weller-Fahy
* Rocco Rutte pd...@gmx.net [2009-04-28 05:02 -0500]:
 It would be nice if you could keep an eye on database file sizes. If
 the db libraries don't reuse freed space (either by deleted or updated
 entries), then we get a growing db file.

I'm running HEAD with your patch, and am running the following commands
at 2330 local every night.

#v+
find ~/.mutt/cache/ -iname *.hcache -printf %p %s\n | sort -u  
~/.mutt/$(date +%F).hcache
diff -uwd ~/.mutt/$(date -d $(date +%Y-%m-)$(($(date +%d)-1)) +%F).hcache 
~/.mutt/$(date +%F).hcache
#v-

I'll review in a few days and see if the header caches for my ham/spam
training folders reduce after I empty them.

Regards,
-- 
dave [ please don't CC me ]


Re: fixing email dates

2009-04-25 Thread David J. Weller-Fahy
* Kyle Wheeler kyle-m...@memoryhole.net [2009-04-23 12:01 -0500]:
  I'm using it since a few days (no imap, only local Maildir), no
  problem so far.

 I've been using it for a few days now too, with IMAP only, and it
 seems to work fine for me.

I have been using it, IMAP only as well, since the 18th of April, and
have had no problems.

-- 
dave [ please don't CC me ]


Re: can not go to the message I want to undelete

2009-04-22 Thread David J. Weller-Fahy
* Chris Jones cjns1...@gmail.com [2009-04-21 21:26 -0500]:
 Nobody I know is able to hit Shift+d by accident.

My cat can... wait, I'm assuming he does that on accident... hrm. ;)

-- 
dave [ please don't CC me ]


Re: can not go to the message I want to undelete

2009-04-21 Thread David J. Weller-Fahy
* Zhengquan Zhang zhang.zhengq...@gmail.com [2009-04-21 19:58 -0500]:
 I accidentally used 'd' on a message and can not go back to it.  I
 tried to use arrow keys to go back to it and use 'u' to undelete it
 but it just failed to do so.

 I have 'set delete=yes' in muttrc. So once I quit mutt, the message
 will be automatically deleted. I don't want this to happen.

Perhaps you could simply select the message by typing its number, then
'C' to copy it, and select the current mailbox as the destination?  That
would result in a duplicate message existing if your undelete efforts
succeed, but even if you lose the original message you'll have the copy.

Regards,
-- 
dave [ please don't CC me ]


Re: Sort by thread, but not by date of first mail

2009-02-19 Thread David J. Weller-Fahy
* Nathan Huesken m...@lonely-star.org [2009-02-19 05:04 -0600]:
 I really like the thread sorted view of mutt. But I would like a
 little change: I would like the threads not to be sorted by the date
 of the first mail but by the date if the most recent mail...

 Is this possible?

Here's what I have in my muttrc file:

#v+
set sort=threads # Set the sort method in the index menu to threads.
set sort_aux=last-date-sent # List the most recent threads last.
#v-

It works for me.

Regards,
-- 
dave [ please don't CC me ]


Re: Setting subscribe/list within muttrc (using IMAP) [SOLVED]

2007-12-20 Thread David J. Weller-Fahy
* Rocco Rutte [EMAIL PROTECTED] [2007-09-06 06:19 -0700]:
 Just a minor note: When does this script get called? I'm asking
 because if it gets called more than once per session, you'll keep
 adding the same lines of folder-hook and subscribe all the time. Or do
 you clear them previously?

Sorry, just noticed this email.

The script gets called every time a new mailbox is entered.  I do not
clear the values, because I assumed that identical values would be
overwritten.  That may be a bad assumption.  I'll have to contemplate my
setup and see if there's a better way to do what I want to do, again. ;]

Regards,
-- 
David J. Weller-Fahy| 'These are the questions that kept me out
largely at innocent dot com |  of the really *good* schools.'
www dot weller-fahy dot com |  - One of The Group


Re: Setting subscribe/list within muttrc (using IMAP) [SOLVED]

2007-08-30 Thread David J. Weller-Fahy
* Michelle Konzack [EMAIL PROTECTED] [2007-08-29 19:12 +0200]:
 Am 2007-08-24 23:49:36, schrieb David J. Weller-Fahy:
  Perhaps I'm looking for a feature that doesn't exist, and I'm almost
  certainly missing something simple, but here's the background:
 snip

 It seems there is no way in mutt...

That is the way it seemed.  However, after digging into the archives a
bit deeper, and playing with a patch I found, I've come up with a
solution that works for me (it does require patching, though).  Details
follow.

Inspiration came from:
http://marc.info/?l=mutt-usersm=99616338121641w=2

The patch exports the current mailbox name to an environment variable,
then I source a shell script as part of a folder hook.  The shell script
parses the mailbox name to determine whether it is a list mailbox, then,
if it is, outputs the muttrc commands I use for lists.  I've tested this
with all the lists I subscribe to, and it works with one caveat:

All my lists are stored in the format =lists.list-name, so
mutt-users is in =lists.mutt-users.  While this makes it easy for my
script to parse the name, it also means that my script/setup may not
work for you.

Hope this helps... I know it doesn't do everything, but it gets me a
little closer. ;]

 I am too using a simplified code sniplet of uw-imap to get all
 directories (and number of NEW/READ messages ) from an imap-server...

Would you mind sharing your sniplet?  It may be a bit better than mine.

Regards,
-- 
dave [ please don't CC me ]
# vim:ft=diff:
This is a patch to place the current mailbox path in an environment variable
whenever a folder-hook is called.  This (trivial) patch was based on a
message[1] on the mutt mailing list:

[1]: http://marc.info/?l=mutt-usersm=99616338121641w=2

In fact, the ONLY differences are the name of the variable, and adding the
patch name to PATCHES. ;]

diff -r f467353f5657 PATCHES
--- a/PATCHES   Sat Mar 31 18:50:39 2007 -0700
+++ b/PATCHES   Wed Aug 29 22:09:38 2007 +0200
@@ -0,0 +1,1 @@
+patch-tip-20070829-env_current_mailbox
diff -r 3f8829e739e9 hook.c
--- a/hook.cTue Aug 28 11:33:52 2007 -0700
+++ b/hook.cThu Aug 30 22:08:56 2007 +0200
@@ -282,6 +282,8 @@ void mutt_folder_hook (char *path)
   BUFFER err, token;
   char buf[STRING];
 
+  setenv( MUTT_CURRENTMAILBOX, path, 1 );
+
   current_hook_type = M_FOLDERHOOK;
   
   err.data = buf;
#!/bin/sh
# .mutt/rc.testforlist.sh

# This will only work if:
# - $MUTT_CURRENTMAILBOX contains the name of the current mailbox in mutt.
# - Your list directory structure looks like the following:
#   lists
#   lists.aklug
#   lists.mutt-users
#   lists.resnet-l
#   lists.[mailing list name]
#
# If your structure is not like the above, then tweak the code heavily.

mailbox=`echo $MUTT_CURRENTMAILBOX | sed -r -e s/^imaps:\/\/[^\/]+\///`
listpfx=`echo $mailbox | cut -d . -f 1`
if test $listpfx = lists ; then
test $mailbox != lists  echo subscribe ${mailbox#lists.}
echo folder-hook +$mailbox set from=dave-$( echo $mailbox | tr '.' '-' 
)@weller-fahy.com
fi


Setting subscribe/list within muttrc (using IMAP)

2007-08-24 Thread David J. Weller-Fahy
Perhaps I'm looking for a feature that doesn't exist, and I'm almost
certainly missing something simple, but here's the background:

I currently use a script to connect to my IMAP server, and get a list of
all mail folders.  I then parse that list to get the mailing list
folders (all named list.mailing-list-name), and use that to generate the
necessary rc commands (subscribe and from).  I would like to remove that
extra connection to the server, and just use rc commands plus a little
shell scripting to do the same thing.

I've searched TFM, and the mailing list via marc.info, but haven't been
able to find anything useful.  I believe I should be able to do what I
need to do if I can figure out how to pass the value of ^ to the shell.

So, is there a way to pass the value of ^ to the shell?  If so, would
someone mind showing me an example?

If there is something about this in the manual/man pages/wiki/mailing
list, a simple scoff and pointer will be sufficient. ;]

Oh, and if there's an easier/better way to do this, please let me know.

Regards,
-- 
dave [ please don't CC me ]


Re: Poll: Quoting behaviour

2007-05-25 Thread David J. Weller-Fahy
* Rocco Rutte [EMAIL PROTECTED] [2007-03-19 22:21 +0100]:
 So the question is how to proceed. The following options are
 available:

   1) Introduce $quote_empty that makes this behaviour configurable
   2) Restore the original behaviour for the f=f handler
   3) Do 1 + 2

 Opinions?

3)

-- 
dave [ please don't CC me ]