Re: More on non-ascii chars in headers

2007-09-25 Thread Kai Grossjohann
On Tue, Sep 25, 2007 at 10:03:30AM +0200, Eyolf Østrem wrote:

 Eyolf =?iso-8859-1?Q?=D8strem?= eyolf () oestrem ! com

RFC 2822 (is that the right number?) does not allow non-ascii characters
in headers, and there is another RFC that describes how to encode
non-ascii characters in headers.  The above is your name in that
encoding.

The mailing list thingy doesn't appear to decode the headers according
to this RFC.

Kai


Re: problem viewing mail

2007-09-23 Thread Kai Grossjohann
On Sat, Sep 22, 2007 at 11:06:01PM -0600, Joseph wrote:

 I'm just experimenting with mutt and I have a basic problem.
 I can not see any mail.

You want to use Maildir...

 set mbox_type=Maildir

... but tell Procmail to write files:

 #people we always allow mail from
 :0
 * ^From:.*([EMAIL PROTECTED]|[EMAIL PROTECTED])
 $MAILDIR/friends

You write foo for a file, foo/ for a maildir, and foo/. for an MH
folder.

Kai


Re: SEC:UOutlook 2003 splits URLs over multiple lines when viewed

2007-09-07 Thread Kai Grossjohann
On Fri, Sep 07, 2007 at 04:10:31PM +0800, Wilkinson, Alex wrote:

 Email sent from Outlook-2003
 -~-~-~-~-~-~-~-~-~-~-~-~-~-~
 
 So this proves that outlook marks it up in HTML and does some seriosuly weird
 stuff to the email when it gets sent.

Actually, the HTML generated by OL looks sane.

  PA =
  
 HREF=3Dhttp://www.mathworks.com/support/sysreq/current_release/?parentto=
  pic=3DSystem%20CompatibilityUFONT COLOR=3D#FF SIZE=3D2 =
  FACE=3DCourier =
  
 Newhttp://www.mathworks.com/support/sysreq/current_release/?parenttopic=
  =3DSystem%20Compatibility/FONT/U/A

Each line here ends in =.  The message is qp encoded.  The act of
qp-decoding the message should join a line ending in = with the
following line, removing the = character.  (The = character at the end
of a line in qp encoding works a lot like the \ character at the end of
a sh script line.)

So perhaps the best solution to view this stuff is to view the text/html
variant, rather than the text/plain variant.  Try v to see the
attachments, then hit Return on the text/html one.  If that invokes a
text-mode browser like w3m or links or lynx, then you should be able to
follow the link.

Kai


Re: Terminfo settings et al

2007-09-07 Thread Kai Grossjohann
On Fri, Sep 07, 2007 at 01:05:02PM +0200, Eyolf Østrem wrote:

 Where and how should I set the TERM variable?  I guess there are five
 possible levels here: environment/shell, Xterm, Screen, ncurses, and
 application.
 My distro's wiki (Archlinux) says that it's a bad idea to set the TERM
 variable in .bashrc, but that applications should be able to figure it
 out for themselves.
 
 So, which of these possible values of TERM do I put where?  
 xterm
 xterm-256color
 screen-256color
 screen-256color-s
 screen-256color-bce
 screen-256color-bce-s
 
 Should it be the same everywhere I set it? 

The TERM variable describes how the terminal behaves.  Obviously, this
depends on the terminal in use.  It might not be obvious that several
programs act to the system as if they were terminals.  Here is a list of
possible terminals you might encounter:

  - The Linux text console (accessible via Ctrl-Alt-F1 oder Ctrl-Alt-F2
while you are running X11 -- use Ctrl-Alt-F7 oder somesuch to get
back to X11).

  - Different X11 terminal programs may exhibit different behaviors,
requiring different values of TERM: xterm, rxvt, urxvt, konsole,
gnome-terminal, mlterm, eterm, aterm, ...  There are many, many,
many X11 terminal programs.

  - The program screen also behaves like a terminal.

You can specify the $TERM value for xterm using -tn foo on the command
line, or an X ressource setting.  For example, the following line in
~/.Xdefaults may be equivalent to -tn foo:

XTerm*termName: foo

But this depends on whether ~/.Xdefaults is read in your environment...

To specify $TERM for screen, you can specify -t or -T on the command
line (forget which), or term foo or so in ~/.screenrc.

I lost track of what you already tried.  For the interim, you can
explicitly set $TERM with TERM=foo; export TERM from the shell.  Have
you tried that in various situations and do you now know what the
terminal needs to be?

Kai
 


Append signature on a case-by-case basis

2007-09-07 Thread Kai Grossjohann
I understand that I can set $signature to a file name with my signature.
Then all subsequent outgoing messages will have that signature appended.
Or I can set $signature to something else or remove the file.  Then all
subsequent messages will not have a signature appended.

But what I want is to be able to decide, for each outgoing message: I
want to append a signature to this message.

Is there a way to do this?

Perhaps I want a vim macro that will append the signature to the message
currently being composed?  Does anyone have a ready-made macro?

Kai


Re: web addresses cut with +

2007-09-03 Thread Kai Grossjohann
On Thu, Aug 30, 2007 at 11:59:53AM -0700, William Yardley wrote:

 On Thu, Aug 30, 2007 at 02:52:52PM +0200, tannhauser wrote:
  
  had the same problem. urlview is a very nice workaround:
  
  [quote man page]
  urlview  is  a  screen  oriented  program for extracting URLs from text
  files and displaying a menu from which you may launch a command to view
  a specific item.
 
 Only really useful if you're viewing the URLs on the same machine you're
 reading mail on... for those of us who read mail on a remote machine and
 view webpages on a local machine, this is not so helpful.

I've been thinking about telling urlview to use something like

echo -n $URL | xclip -in

for http and https URLs.

Kai


Re: Subject �üîå

2007-09-03 Thread Kai Grossjohann
On Mon, Sep 03, 2007 at 03:22:31PM -0400, [EMAIL PROTECTED] wrote:

 I seem to have partially sovled the UTF-8 problem.  It turns out that
 the problem was in my muttrc, which wants to see set charset=UTF-8
 instead of =en_US.UTF-8, while the latter is what $LANG wants to
 see.

$LANG contains more information because it specifies more things.
Whereas set charset in .muttrc only specifies the character set /
character encoding to use, $LANG specifies the locale, of which the
character set is only a part.

The locale specifies

  - the language to use for messages printed by the system (error in
English, Fehler in German),

  - the date format (1/15/2007 in the US, 15.1.2007 in Europe)

  - the currency and currency symbol,

  - the decimal point and the thousands delimiter ($1,000.00 in the
US, EUR 1.000,00 in Germany)

and other things.

Kai


Re: Viewing HTML messages with images

2007-08-31 Thread Kai Grossjohann
On Thu, Aug 30, 2007 at 11:34:57PM -0500, Matt Okeson-Harlow wrote:

 w3m can be compiled to display images in an xterm.

Very well.  But how do we convert a multipart/related message with
text/html and image/foo parts into something that w3m can digest?

I believe that some messages have text/html parts that reference real
files or URLs: img src=foo.jpg

But in other cases, it reference the content id: img src=cid:deadbeef

Kai


Re: compose with mutt on a remote server

2007-08-31 Thread Kai Grossjohann
On Fri, Aug 31, 2007 at 08:30:12PM +0200, mess-mate wrote:

 Well..no.
 I've a remote machine were i keep all the email's for all the users
 (virtual).
 From my desktop i connect with courier-imap to the remote server and
 access my mailboxes with mutt. This works very well for reading but
 when i compose or reply to a message my own send-hooks, signature
 etc.. (~/.mutt) of my desktop no longer works.

OK.  Since mutt runs on your desktop, it will read the ~/.mutt file(s)
from your desktop machine.  Copy them over.

And since mutt runs on your desktop, it uses the mailer there.  By
default, mutt invokes sendmail, so you need to configure that to send
mail properly.  Alternatively, you could install msmtp and tell mutt to
use it, and tell msmtp how to send mail.  (Using msmtp is what I do.)
Or you could use the smtp client feature of mutt and configure the
correct smtp server in mutt.  (I've never done this.)

Kai


Re: Viewing HTML messages with images

2007-08-31 Thread Kai Grossjohann
On Fri, Aug 31, 2007 at 10:14:36AM -0700, Gary Johnson wrote:

 On 2007-08-31, Kai Grossjohann [EMAIL PROTECTED] wrote:
  On Thu, Aug 30, 2007 at 11:34:57PM -0500, Matt Okeson-Harlow wrote:
  
   w3m can be compiled to display images in an xterm.
  
  Very well.  But how do we convert a multipart/related message with
  text/html and image/foo parts into something that w3m can digest?
 
 Mutt doesn't know anything about HTML.  Most browsers don't know 
 anything about cid references.  So I think a solution could look 
 like this. [..write it yourself..]

Yes, I agree, that would be a/the solution.  I was merely hoping that
somebody has done it already -- given that I think that this is a fairly
common thing to want.  But maybe I'm just weird and others don't
need/want this.

Kai


Re: compose with mutt on a remote server

2007-08-30 Thread Kai Grossjohann
I understand that you run mutt on two different machines, right?  One is
your home machine, one is the remote mail server?

Then you need to keep ~/.mutt in sync between the two servers.

Kai

On Thu, Aug 30, 2007 at 02:48:37PM +0200, mess-mate wrote:

 Hi,
 i've installed maildir on a remote mail-server.
 I've no problem to access/send with mutt on the mail-server, but when i 
 compose a
 message all my settings from my ~/.mutt (on my machine) as the *hooks* for 
 example
 aren't used.
 I suspect once connected my ~/.mutt is no more followed.
 Is there a way to maintain the home-mutt settings ?
 mess-mate
 


Viewing HTML messages with images

2007-08-30 Thread Kai Grossjohann
Does anyone have a solution for viewing multipart/related messages where
the main part is text/html which references the other parts which are
typically images?

I envision something that saves all parts of separate files in a temp
directory, then either tweaks the filenames so that the links from the
HTML work automatically, or tweaks the links in the HTML so that they
point to the files just written, then invokes Firefox on the result.

(For added credit, one of my mail systems is remote, where I would
rather download the whole temp directory (as a zip file, say), then
invoke Firefox on the local machine.)

tia,
Kai


[Slightly OT] Allow for choosing browser to follow a link

2007-08-29 Thread Kai Grossjohann
Ctrl-b invokes urlview which provides a list of URLs in the current
message and allows me to choose one of them to view it.  This invokes
w3m or elinks.  This is good.

But from time to time I want to invoke other browsers.  Or just copy the
URL to the X11 clipboard.

Is there an alternative to urlview that would allow me to choose the
program to run on a case-by-case basis?

Kai


Re: [Slightly OT] Allow for choosing browser to follow a link

2007-08-29 Thread Kai Grossjohann
On Wed, Aug 29, 2007 at 07:55:18AM -0400, Patrick Shanahan wrote:

 * Kai Grossjohann [EMAIL PROTECTED] [08-29-07 07:36]:
  Ctrl-b invokes urlview which provides a list of URLs in the current
  message and allows me to choose one of them to view it.  This invokes
  w3m or elinks.  This is good.
  
  But from time to time I want to invoke other browsers.  Or just copy the
  URL to the X11 clipboard.
  
  Is there an alternative to urlview that would allow me to choose the
  program to run on a case-by-case basis?
 
 man urlview provides 
 
REGEXP regexp
  urlview uses a regular expression to extract URLs
from the specified text files.  \r, \t, \n and \f
are all converted to their normal printf(3)
meanings.  The default REGEXP is:
 
 (((https?|ftp|gopher)://|(mailto|file|news):)[^' 
 \t]+|(www|web|w3)\.[-a-z0-9.]+)[^' \t.,;:]
 
 ctrlb from .muttrc
 
macro   pager   \cb   |urlview\n   'call urlview to extract URLs out 
 of a message'
 
 
 write your own script putting the regex result into a variable and
 evoke the browser of your choice:  firefox %s
 
 call the different scripts via different key combinations
 
macro   pager   \cc  !script\n   'call firefox to view ...'

I don't understand :-(

  - Should the script search for the regex?  In that case, it would need
to handle multiple occurrences -- which is exactly the job urlview
was designed for...

  - Should I create different config files for urlview, then invoke
urlview with the w3m for one key or with the firefox config file
for the other key?

urlview doesn't provide an argument for the config file; this will
get messy.

Actually, what I want is a list of URLs just like that provided by
urlview, but when selecting an http or https URL I should be able to
choose a browser.  Or perhaps choose a browser globally before selecting
a URL to view.

Kai


Re: Q: View as Windows-1252?

2007-08-27 Thread Kai Grossjohann
On Sat, Aug 25, 2007 at 07:22:36PM +0200, Alain Bench wrote:

 And if we had the magic universal isprint(), well... The practical
 benefit to the auto-sensing guesswork would be much lower than expected.
 iso-8859-1:utf-8 would be possible, but unreliable (some UTF strings
 happen to not contain 128-159 bytes, and would be wrongly sensed as L1).

Try utf-8:iso-8859-1 instead of iso-8859-1:utf-8.  For practical
purposes, no L1 strings decode as UTF-8, imho.

Kai


Re: how not to auto-load attachments?

2007-08-27 Thread Kai Grossjohann
On Sat, Aug 25, 2007 at 02:00:14AM +0200, Michelle Konzack wrote:

 Am 2007-08-24 13:26:29, schrieb Louis-David Mitterrand:
  Hi,
  
  When using imap with mutt-1.5.16 is there a way to not automatically 
  load attachements when viewing the message body? 
 
 No, since the attachments ARE the message body.

This seems to be an oversimplification.  Actually, the message body
consists of multiple parts, and IMAP provides mechanisms to selectively
download some of the parts.  (It also provides mechanisms to get a list
of parts.)

Kai


Re: CC'ing list people but not getting CC'd?

2007-08-21 Thread Kai Grossjohann
On Sun, Aug 19, 2007 at 12:00:24AM +0200, Michelle Konzack wrote:

 Am 2007-08-18 02:02:35, schrieb Kai Grossjohann:
  Which email client does he use?  He claims that MFT is used for
  replies,
  but the name suggests that it should be used for followups, not
  replies.
 
 And whats the difference?

Replies go to the author of a message only, followups additionally go to
the recipients.

Kai


Re: CC'ing list people but not getting CC'd?

2007-08-21 Thread Kai Grossjohann
On Mon, Aug 20, 2007 at 08:56:19AM +0200, martin f krafft wrote:

 also sprach Kai Grossjohann [EMAIL PROTECTED] [2007.08.18.0202 +0200]:
  Which email client does he use?  He claims that MFT is used for replies,
  but the name suggests that it should be used for followups, not replies.
 
 User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)
 
 Sure, MFT implies followup, but isn't that pretty much the same as
 list-reply?

Well, we have three things: followups, list-replies, and replies.
Followups and list-replies are quite similar in most practical
situations, but replies are quite different.

 I think his issue is with:
 
   - you like CCs to the list, so you set MFT on all your mails to
 the list address as well as yours.
   - I see your mail and reply to it, mutt sees the MFT and preserves
 it. It needs not add the list address, and I don't want it to
 add mine, so it copies the MFT header with the list address as
 well as yours to my mail.

If you reply, then it gets sent to me only.

If you followup, then the list address will be added since it is in MFT
(as you say).

   - Someone else replies to *my* mail in the same way, and his
 mailer honours MFT, so no *you* also get CC'd on the reply, even
 though the subject may have diverged and you're not interested
 anymore.

I asked for Ccs, so I got what I deserved.

If I subscribe to a list, then I get all postings, even though I might
only be interested in part of the topics.  That's the same thing, isn't
it?

 I generally don't mind following threads to which I have posted,
 even if they diverge (I have a good thread/subject blacklisting in
 place). However, Junio doesn't, and at least wrt git, he's way more
 active, so I ought to really respect his preferences.

It's not clear to me what Junio wants.  If we wants no Cc's, then he can
just put in an MFT header that excludes himself.  Shouldn't he then be a
great fan of MFT since it allows him to express what he wants?

Sorry, perhaps some of this is bogus, I am quite confused by now.

Also, my Gnus terminology might not map well to a Mutt audience.
Apologies for this.  For example, I don't really know what is a
list-reply, so the above could be wrong.  In Gnus speak, there is only
reply (to author) and followup (to author and all recipiencts, unless
modified by MFT).  (And then there are wide replies and very wide
replies that I never understood.)

Perhaps Mutt users mean something different when they talk about replies
or followups.

Kai


Re: Message-hook problem

2007-08-20 Thread Kai Grossjohann
Type Ctrl-E on the message and replace the charset iso-8859-1 with
Windows-1252.  If the message has multiple parts, hit v then choose the
part that is displayed wrongly, then do Ctrl-E as described above.

Does it help?

Kai



On Sun, Aug 19, 2007 at 12:41:46PM -0700, Breen Mullins wrote:

 I've wrestled with this one for a few days and I'm not getting anywhere.
 It should be simple (and probably is!) but I'm not seeing it.

 I've got a correspondent whose version of Entourage is sending oddly
 broken messages. When she types an apostrophe, MS converts it to a curly 
 one. That's correctly rendered in the text/html version of the message. But 
 in the text/plain portion, the same character is coded as a 0xb9 - a 
 superscript 1. And that's what mutt displays.

 Not the end of the world - I can fix it easily enough in a reply with a
 vim mapping. But it's annoying and I'd like to fix the display. 
 I tried this message-hook:
 message-hook ~f \[EMAIL PROTECTED] \ set display_filter='tr 271  
 047'

 The hook starts off out right - it fires on her emails and attempts the
 replacement at the right spot. But the replacement isn't what I'm
 looking for:

 
 Who\302's coming? Are you bringing a friend? 

 I can't figure out where the \302 is coming from. I'm on a Mac (10.3.9);

 Mutt 1.5.16 (2007-06-09)

 System: Darwin 7.9.0 (Power Macintosh)
 ncurses: ncurses 5.2.20020209 (compiled with 5.2)
 libiconv: 1.9
 Compile options:
 -DOMAIN
 -DEBUG
 -HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  +USE_FCNTL  
 -USE_FLOCK   -USE_INODESORT   -USE_POP  +USE_IMAP  -USE_SMTP  -USE_GSS  
 +USE_SSL_OPENSSL  -USE_SSL_GNUTLS  -USE_SASL  +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=/var/mail
 PKGDATADIR=/sw/share/mutt
 SYSCONFDIR=/sw/etc
 EXECSHELL=/bin/sh
 -MIXMASTER

 charset-hook ^unknown-8bit$   cp1252
 charset-hook ^x-unknown$  cp1252
 charset-hook ^x-user-defined$ cp1252
 charset-hook ^us-ascii$   cp1252
 charset-hook ^iso-8859-1$ cp1252
 charset-hook ^iso-8859-8-i$   iso-8859-8
 charset-hook ^gb2312$ gb18030
 set assumed_charset=cp1252

 tr (GNU coreutils) 5.96

 Can somebody tell me what I'm missing?

 Thanks, Breen
 -- 
 Breen Mullins
 Menlo Park, California

-- 
Kai Großjohann
Leitung Informationstechnik
Die Neue Epoche
Epoch Times Europe GmbH
Schmitthennerstr. 61
69124 Heidelberg
Email: [EMAIL PROTECTED]
Phone: +49 (0)6221 86832-83
Fax:   +49 (0)6221 86832-84
www.DieNeueEpoche.com 

Epochtimes Europe GmbH
Geschäftsführer: Zhongnan Jiang, Man-Yan Ng
Amtsgericht Hamburg, HRB 80404, USt.-Idnr. DE 217 913 863
Sitz: Bundesstraße 20, D-20146 Hamburg


Re: Escape characters in messages

2007-08-18 Thread Kai Grossjohann
On Sat, Aug 18, 2007 at 10:25:21AM +0200, Nicolas wrote:

 But the same problem appears in another mail from the same people, when
 the mail contents isn't in an attachment and when there's this flag in
 the header :
 Content-Type: text/plain; charset=ISO-8859-1
 
 I know the mails come from a Windows box. Could that be a problem on the
 computer from which the mails come ?

Messages from Windows users are often actually in the Windows-1252
character set even though they are labeled ISO-8859-1.  Windows-1252 is
a superset of ISO-8859-1, and the characters you mention are in that
part of Windows-1252 that is not in ISO-8859-1.

As I stated, how about you try to hit Ctrl-E on the message?  (If the
offending bit is in an attachment, then hit v, then select the
appropriate part of the message, then hit Ctrl-E.)  I hope it will be
obvious where to replace ISO-8859-1 with Windows-1252 in the resulting
prompt.

Kai


Re: 3 questions: Renaming folders with hook + browser reverse date

2007-08-18 Thread Kai Grossjohann
On Sat, Aug 18, 2007 at 11:21:08PM +0200, Vim Visual wrote:

 I figured out that it is possible to rename the file where the sent
 emails are stored with
 
 send-hook . set record=~/mail/sent-mail-`date +%Y-%m`
 set record==sent-mail-`date +%Y-%m`
 
 (or similar) by reading the faqs.
 
 Now a very silly question... please feel free to flame and even stone
 me. How do I do the same for the received emails? set record2 ???
 ahem...

When exiting the spool folder, Mutt writes all read messages to the mbox
folder; see variables $mbox and $spoolfile.  Does this do what you want?
If you would like to have a similar behavior for other folders, see the
mbox-hook command.

 I want to see my emails (sent, received) according to their date,
 reversely. I wrote this in my muttrc:
 
 set sort_browser=reverse-date
 
 But it doesn't work. It shows me the emails according to the threads,
 not to the reverse date. How can I fix that?

$sort_browser controls the display of the file browser.  Are you looking
for the variable $sort?

Kai


Re: CC'ing list people but not getting CC'd?

2007-08-17 Thread Kai Grossjohann
On Fri, Aug 17, 2007 at 04:38:30PM +0200, martin f krafft wrote:

 In the mean time, however, I found that Junio, the git maintainer,
 really just dislikes M-F-T:
 
   http://marc.info/?l=gitm=113882569532399w=2

Which email client does he use?  He claims that MFT is used for replies,
but the name suggests that it should be used for followups, not replies.

Kai


Re: Escape characters in messages

2007-08-17 Thread Kai Grossjohann
On Sat, Aug 18, 2007 at 12:52:55AM +0200, Nicolas wrote:

 I use mutt since 3-4 years. Sometimes, I receive messages which contain
 escape characters. Here is what is looks like :
 \222 is displayed while a ' should appear
 \200 is displayed while a insert euro sign here should appear

Looks like the windows-1252 charset.  Are the messages labeled as such?
If not, does it help to Ctrl-E the message and put windows-1252 as the
charset?

Kai


Re: How to organize mail in folders?

2007-08-15 Thread Kai Grossjohann
On Wed, Aug 15, 2007 at 10:39:09AM +0200, M. Fioretti wrote:

 yes, I'm really interested in your all procmail recipes, especially
 the one [that catches Bcc'd messages] (I'm trying to do the same thing
 myself).

Approach it from the opposite end:

Messages with you in the To header go in folder x, messages with you in
Cc go in y, messages from mailing lists go in z.

Then all other messages must be bcc'd to you.

Kai


Re: Q: View as Windows-1252?

2007-08-15 Thread Kai Grossjohann
On Mon, Aug 13, 2007 at 10:13:17AM -0600, Kyle Wheeler wrote:

 How truly bizarre. Any idea what messed-up client sent this?

Wild guess: sqwebmail, possibly in an antique version.

Kai


Re: Does mutt have any concept of where I am now?

2007-08-13 Thread Kai Grossjohann
On Mon, Aug 13, 2007 at 09:35:39AM +0100, Chris G wrote:

 However, taking thought, it should be possible to auto-generate the
 folder-hook commands without to much difficulty a simple shell script
 using 'find' starting at /home/chris/Mail would do what I want and you
 can then use `run the script` in muttrc.

It seems the following does the trick in my environment:

find Mail -type d | while read d; do test -d $d/cur  echo $d; done

I guess I could just replace echo $d with a command that prints the
entire .muttrc line.

Kai


Re: Q: View as Windows-1252?

2007-08-13 Thread Kai Grossjohann
On Mon, Aug 13, 2007 at 05:36:12PM +0200, Kai Grossjohann wrote:

 Here is the entire header listing, as printed by 'h'.  I've replaced the
 values of the irrelevant headers with -snipped-.
 
 Received: -snipped-
 Received: -snipped-
 Delivered-To: -snipped-
 Received: -snipped-
 Message-ID: -snipped-
 From: -snipped-
 To: -snipped-
 Subject: -snipped-
 Date: -snipped-
 Mime-Version: 1.0
 Content-Type: text/plain; format=flowed
 Content-Transfer-Encoding: 8bit

For this message, setting assumed-charset to utf-8 alone did not do the
trick, but charset-hook ^us-ascii$ utf-8 did.

Kai


Re: Q: View as Windows-1252?

2007-08-13 Thread Kai Grossjohann
On Sun, Aug 12, 2007 at 06:24:54PM -0500, Kyle Wheeler wrote:

 On Sunday, August 12 at 11:36 PM, quoth Kai Grossjohann:
 However, it does not help for a message with the following headers:
 
 | Mime-Version: 1.0
 | Content-Type: text/plain; format=flowed
 | Content-Transfer-Encoding: 8bit
 
 It would help to see *all* the headers (except maybe the 
 from/to/received).

Here is the entire header listing, as printed by 'h'.  I've replaced the
values of the irrelevant headers with -snipped-.

Received: -snipped-
Received: -snipped-
Delivered-To: -snipped-
Received: -snipped-
Message-ID: -snipped-
From: -snipped-
To: -snipped-
Subject: -snipped-
Date: -snipped-
Mime-Version: 1.0   
  
Content-Type: text/plain; format=flowed 
  
Content-Transfer-Encoding: 8bit 
  

In this case, the message is in UTF-8 encoding.

Kai


Re: Q: View as Windows-1252?

2007-08-13 Thread Kai Grossjohann
On Mon, Aug 13, 2007 at 05:38:53PM +0200, Kai Grossjohann wrote:

 On Mon, Aug 13, 2007 at 05:36:12PM +0200, Kai Grossjohann wrote:
 
  Here is the entire header listing, as printed by 'h'.  I've replaced the
  values of the irrelevant headers with -snipped-.
  
  Received: -snipped-
  Received: -snipped-
  Delivered-To: -snipped-
  Received: -snipped-
  Message-ID: -snipped-
  From: -snipped-
  To: -snipped-
  Subject: -snipped-
  Date: -snipped-
  Mime-Version: 1.0
  Content-Type: text/plain; format=flowed
  Content-Transfer-Encoding: 8bit
 
 For this message, setting assumed-charset to utf-8 alone did not do the
 trick, but charset-hook ^us-ascii$ utf-8 did.

In fact, charset-hook alone is sufficient.

Kai


Re: Does mutt have any concept of where I am now?

2007-08-13 Thread Kai Grossjohann
On Mon, Aug 13, 2007 at 09:04:20AM -0500, Matt Okeson-Harlow wrote:

 On Mon, Aug 13, 2007 at 03:36:39PM +0200, Kai Grossjohann wrote:
  On Mon, Aug 13, 2007 at 09:35:39AM +0100, Chris G wrote:
  
   However, taking thought, it should be possible to auto-generate the
   folder-hook commands without to much difficulty a simple shell script
   using 'find' starting at /home/chris/Mail would do what I want and you
   can then use `run the script` in muttrc.
  
  It seems the following does the trick in my environment:
  
  find Mail -type d | while read d; do test -d $d/cur  echo $d; done
  
  I guess I could just replace echo $d with a command that prints the
  entire .muttrc line.
  
  Kai
 
 I swiped a bit of code from someone else to build my mailboxes list, you may
 be able to modify it to suit your needs:
 
 http://technomage.net/dotfiles/muttrc/mailboxes.html
 
 mailboxes ! + `\
 for file in ~/Maildir/.*; do \
 if [ -d $file ]; then \
 box=$(/usr/bin/basename $file); \
 if [ ! $box = '.Spam' \
 -a ! $box = '.Trash' \
 -a ! $box = '.junk' \
 -a ! $box = '.' \
 -a ! $box = '..' ]; then \
 echo -n \+$box\ ; \
 fi; \
 fi; \
 done`

This presupposes the extended Maildir layout, I think.  My directory
layout is that I've just got a directory with subdirs, and at various
places in the hierarchy there are normal Maildirs.

Kai


Re: Does mutt have any concept of where I am now?

2007-08-12 Thread Kai Grossjohann
On Sun, Aug 12, 2007 at 08:00:14PM +0100, Chris G wrote:

 Is there any way in mutt to know where one is in a hierarchy of mail?

No, but you can use folder-hook to set the default save folder.  Of
course, this is really a bear because you have to repeat it for every
folder...

For example:

folder-hook =foo/bar save-hook . =archive/foo/bar

This means that in the folder =foo/bar, hitting s defaults to
=archive/foo/bar as the save folder.  (The . in the middle means 'for
all senders, if you wrote carl there then it'd apply only to messages
from carl.)

I think what's needed is a script that produces a list of folder names,
then emits one folder-hook statement for each.

Kai


What do backquotes do?

2007-08-12 Thread Kai Grossjohann
What exactly do backquotes do?  I've seen the uname example in the
manual, but that leaves a number of questions open.

For example, can I only use backquotes for the value?  Or can I also use
it for the name?

| set foo=`echo bar`

This is a somewhat silly way to set the variable foo to the value bar.
But will the following line do the same?

| set `echo foo`=bar

And what about this?

| `echo set` foo=bar

And what if the shell command prints more than one line?

| `echo foo; echo bar`

Will the above do the same as the following two lines?

| foo
| bar

tia,
Kai


Re: Q: View as Windows-1252?

2007-08-12 Thread Kai Grossjohann
Thanks to Kyle's suggestions, I've now got

| set assumed_charset=iso-8859-1:windows-1252

in my muttrc file.  However, it does not help for a message with the
following headers:

| Mime-Version: 1.0
| Content-Type: text/plain; format=flowed
| Content-Transfer-Encoding: 8bit

Note that it does not indicate a charset.  When I do Ctrl-E on this
message, the prompt says charset=us-ascii.  Editing that to
charset=windows-1252 does the trick -- Mutt now shows umlauts as such
instead of as question marks.

tia,
Kai



On Fri, Aug 03, 2007 at 03:37:38PM +0200, Kai Grossjohann wrote:

 I find that I (fairly) often get messages with no charset specified, or
 with the wrong charset specified, so I do Ctrl-E on them and edit the
 charset parameter to windows-1252, which seems to work well for most
 cases.
 
 Is it possble to automate this, so that I only have to press a single
 key?
 
 What makes it difficult (for me) is that Ctrl-E displays a line that
 contains more information than just the charset, and I can't see how to
 automatically go to the right spot in that line.
 
 tia,
 Kai


Q: View as Windows-1252?

2007-08-03 Thread Kai Grossjohann
I find that I (fairly) often get messages with no charset specified, or
with the wrong charset specified, so I do Ctrl-E on them and edit the
charset parameter to windows-1252, which seems to work well for most
cases.

Is it possble to automate this, so that I only have to press a single
key?

What makes it difficult (for me) is that Ctrl-E displays a line that
contains more information than just the charset, and I can't see how to
automatically go to the right spot in that line.

tia,
Kai


Re: Q: View as Windows-1252?

2007-08-03 Thread Kai Grossjohann
On Fri, Aug 03, 2007 at 08:56:57AM -0500, Kyle Wheeler wrote:

 On Friday, August  3 at 03:37 PM, quoth Kai Grossjohann:
  I find that I (fairly) often get messages with no charset specified, or 
  with the wrong charset specified, so I do Ctrl-E on them and edit the 
  charset parameter to windows-1252, which seems to work well for most 
  cases.
 
 What you probably want to do is set up some charset-hooks. For 
 example:
 
 charset-hook none windows-1252
 charset-hook unknown windows-1252
 charset-hook x-unknown windows-1252
 charset-hook unknown-8bit windows-1252
 charset-hook windows-1251 windows-1252

I think this applies to bad charset specifications.  But in my case I
notice that Ctrl-E either shows me charset=utf-8 (where the message is
in Windows-1252), or charset=us-ascii (msg also in Windows-1252).

 I have a bunch of hooks like this to fix known bad charsets. The 
 'assumed_charset' feature is also really really useful:
 
 set assumed_charset=us-ascii:windows-1252:utf-8

I didn't use this because it says only the first content is valid for
the message body.  But I guess it doesn't hurt to try.

Thanks,
Kai


Re: Q: View as Windows-1252?

2007-08-03 Thread Kai Grossjohann
On Fri, Aug 03, 2007 at 10:21:52AM -0500, Kyle Wheeler wrote:

 On Friday, August  3 at 04:55 PM, quoth Kai Grossjohann:
  I think this applies to bad charset specifications.  But in my case 
  I notice that Ctrl-E either shows me charset=utf-8 (where the 
  message is in Windows-1252), or charset=us-ascii (msg also in 
  Windows-1252).
 
 Ahh, interesting. Well, the latter is easily remedied; windows-1252 is 
 *also* a superset of us-ascii (so this hook won't harm anything):
 
 charset-hook us-ascii windows-1252
 
 The other one is... well, downright malicious! Out of curiosity, what 
 mail client is composing messages mislabelled utf8 like that?

I confess that I have no idea.  Actually, I already had a value of
assumed_charset and of charset, perhaps that did it.  I had:

set charset=utf8
set assumed_charset=utf-8:windows-1252:iso-8859-1

Perhaps the order of windows-1252 and iso-8859-1 was reversed.  I
thought that this was a smart move, because if decoding as UTF-8 works,
then it's probably going to be UTF-8.

  I have a bunch of hooks like this to fix known bad charsets. The 
  'assumed_charset' feature is also really really useful:
  
  set assumed_charset=us-ascii:windows-1252:utf-8
 
  I didn't use this because it says only the first content is valid for 
  the message body.  But I guess it doesn't hurt to try.
 
 Hmm, that's a badly worded man-page entry. I think it means one of two 
 things (both of which are, I think, true): either it's saying that 
 only the first charset that is valid for the message will be used 
 (i.e. if windows-1252 is a valid way of interpreting the message, 
 utf-8 will not be tried---this is especially important for asian 
 charsets, where in most cases there's no way to tell if the charset 
 produced random garbage or not),

Hm.  But surely the same thing applies to the header?  So why was it
explicitly talking about the message body?

It seems strange to me to say that it tries all charsets for decoding
the header, even after finding a charset that works.  For then, if more
than one charset works, how would Mutt select one?

 OR it's saying that if your message 
 comes in multiple parts, the charset that is found to be acceptable 
 for the first part will be used for all subsequent parts.

Sounds plausible.

 But this won't work at all for you, I think, because it only applies 
 to parts of the message without any charset indication, and your 
 problem is incorrect charset labelling.

I think I am confused.  Perhaps the situation is this:

The message is sent without a charset indication.  But when I hit
Ctrl-E, a charset is included in the Content-Type header that I can
edit.

And perhaps Mutt was putting utf-8 there after Ctrl-E because that was
the first entry in assumed_charset.

But then, why didn't it try the whole list in the first place?  Then it
would have discovered the correct charset and wouldn't have displayed
question marks for the non-ascii characters.

Very strange situation.  Apologies for not investigating the situation
fully before asking here.

Kai


Re: Q: View as Windows-1252?

2007-08-03 Thread Kai Grossjohann
On Fri, Aug 03, 2007 at 05:10:57PM -0500, Kyle Wheeler wrote:

 Mail clients that have put the time and effort into actually 
 supporting utf-8 tend to be aware of the problem of unlabelled 
 charsets, so it's highly unlikely that you'd find a UTF8-encoded 
 message that was not labelled as UTF-8.

I think that this is a very good point.  So I don't really need to list
UTF-8 in assumed_charsets at all.

Kai


Re: shortcut to mbox

2007-07-21 Thread Kai Grossjohann
On Sat, Jul 21, 2007 at 06:25:33PM +0200, Benjamin Eckenfels wrote:

 I'm looking for other shortcuts like c! for spooldir.

Mutt manual, section 4.7 Mailbox shortcuts.

Kai


Re: How to organize mail in folders?

2007-07-20 Thread Kai Grossjohann
Michelle,

I think there is a misunderstanding.  I wanted to understand how other
people process their email.  You are giving me pointers to programs but
don't describe how you use them.

Here is a potential strategy for handling mail:

  - All incoming mail goes to inbox.
  - I process all mails from inbox.
  - Some messages I read, then delete right away.
  - Other messages I read, then archive by project.
By project means that there is a folder for each project.
  - Some messages I read, then respond to and archive (by project).
  - Some messages I read, decide that I can't handle them right
away, so I put them in the todo folder.  Every morning I go
through my todo folder.
  - Some messages (often those sent by me) are waiting for responses
from others.  I file those in the pending folder.  Every
morning I go through my pending folder to see whether a response
has arrived.

Some of the above steps could be automated.  The strategy does not
handle mailing lists well.  But I hope it shows one possible response
and makes it clear in what way your response differs from what I was
expecting.

(I do not follow the above strategy, if that matters.  Maybe I should.
Or maybe you have a better strategy?)

On to the details of your message:

On Thu, Jul 19, 2007 at 07:26:31PM +0200, Michelle Konzack wrote:

 Am 2007-07-11 17:03:23, schrieb Kai Grossjohann:
  
  What I'm looking for is some suggestions on how else I might organize my
  mail, that fits more with what Mutt offers.  I think most of you face
  the same basic situation as I do:
  
- Receive personal mail and mailing list mail.
 
 fetchmail or getmail

Those do not know the difference between personal mail and mailing list
mail, I think.

- Have different strategies for handling mail depending on the address
  they were sent to (some mailing lists are less important than most
  personal mail, so we don't check for new mail there as often).
 
 procmail or maildrop

Those do not check whether new mail is available that needs to be
processed.

- Want to archive a large portion of mail.
 
 archivemail

This is a good hint.  Thanks a lot!

- Want to have an overview of messages that still need action of some
  type.
 
 ???

I get a message.  It could be something I read and then delete.  Or it
could be something that I read and then archive.  Or I respond right
away and then delete or archive.

These cases are easy.

Then there are messages that mean I need to do something, but I need
longer to do them.  Or I need to get feedback from somewhere.  Or
whatever.  My memory is quite bad, so I like to have the computer store
a list of these open ends so I don't have to remember them.

- Don't want the archive to interfere (too much) with this overview.
 
 ???

Suppose I have a folder for the foo project.  Then which of the messages
in that folder are open ends that still need action, and which of them
are archived messages?

  Right?  So what do you do?
 
 ...its up to you.  :-)

I hope that what _you_ do is not up to _me_.

Kai


Re: How to organize mail in folders?

2007-07-20 Thread Kai Grossjohann
On Fri, Jul 20, 2007 at 03:19:42PM +0100, Chris G wrote:

 The above strategy is a pretty good description of what I actually do.

I wish I was that organized.  It's difficult for me to muster the
self-discipline to actually do this.

 The only difference in my case is that I use a procmail lookalike
 (it's a perl sript) to sort incoming mail, basically into a mailbox
 per mailing list and my main inbox.

Yes, that seems like a good extension.  And easy enough to do.

 Which parts of the above would you automate?

Michelle pointed out archivemail.  This way, I could have an active
folder per project, then automatically move messages to a corresponding
archive folder.

I guess the mbox feature (automatically move read messages from spool
file/folder to mbox on exit of spool folder) could be used to put them
into the todo folder.  Not sure whether that would be workable.

Does anyone have experiences?

 I can't really see what can be automated except, possibly, the
 archive by project.  My archive folders don't really correspond to
 anything that could be gleaned from the E-Mails (except, in some
 cases, the sender) so the ones I save I just save manually.

Suppose that I only have a global inbox and a global todo folder (aside
from the mailing lists).  Then I could tell Mutt to always remember
message ids of refoldered messages together with their target folder.

Then archive by project could look in the References header whether
one of the message ids there is known, then automatically file to the
correct folder.

Kai


Re: Q: Better list of mailboxes?

2007-07-12 Thread Kai Grossjohann
On Tue, Jul 10, 2007 at 02:51:30PM +0200, Kai Grossjohann wrote:
 I have added all my (important) mail folders to the mailboxes list, and
 I am now very fond of y to browse them.  Some small features are
 missing, though, so I thought I'd ask here for ideas:
 
 [...]
 
   - How to show the total number of messages / the number of unread
 messages in each mailbox?
 
   - How to elide information from each line, such as the permissions and
 ownerships of the directories?

I've now adopted an approach using the sidebar patch.  It (almost) gives
me the right feeling, but it seems to be somewhat fragile.  Please do
tell me what you think and keep the suggestions coming :-).

In ~/.mutt/muttrc I have the following:

| # Sidebar
| set sidebar_width=40
| color sidebar_new red default
| bind index B bounce-message
| bind pager B bounce-message
| 
| # This stanza for Gnus-like interface
| macro index b 'enter-commandsource ~/.mutt/sidebar-onenter'
| macro pager b 'enter-commandsource ~/.mutt/sidebar-onenter'

And ~/.mutt/sidebar-on looks like this:

| set sidebar_visible
| bind index j sidebar-next
| bind index k sidebar-prev
| macro index b 'enter-commandsource ~/.mutt/sidebar-offenter'
| macro index space 'enter-commandsource ~/.mutt/sidebar-offenter'
| macro index return 'enter-commandsource ~/.mutt/sidebar-offenter'

So I can navigate the groups with j/k and choose one with space or
return or b.  Finally, ~/.mutt/sidebar-off looks like this:

| exec sidebar-open
| bind index j next-undeleted
| bind index k previous-undeleted
| bind index space display-message
| macro index b 'enter-commandsource ~/.mutt/sidebar-onenter'
| unset sidebar_visible

Functionality-wise, it would feel even more like Gnus with the following
changes:

  - On startup, show the sidebar.
  - In the index, q shows the sidebar.
  - In the pager, q shows the index.
  - In the sidebar, q quits.

Conceptually, that would achieve a three-level hierarchy: (1) list of
folders, (2) list of messages, (3) list of lines in a message.  Mutt
would start in (1), and space always goes from level N to level N+1,
and 'q' always goes from level N+1 back to level N.  And on every level,
j/k navigate down/up.

I don't dare to implement that just yet, though.

Kai


Re: Change into an mbox - like chdir

2007-07-12 Thread Kai Grossjohann
On Thu, Jul 12, 2007 at 05:07:46PM +0100, David Woodfall wrote:
 
 Yes I want to make a macro that will open a mbox and mark all posts as
 read. At them moment I have a macro that marks all post read but needs you
 to manually enter the mbox.

Well, the command is called change-folder, but you used the term cd
into, that is change-directory.  And to Mutt users, a folder is
distinct from a directory...

Does this work?  It is untested:

macro index X 'change-folder/tmp/fooenter'

Instead of X, put the desired key, and instead of /tmp/foo, put the name
of the folder.

Kai


Re: Change into an mbox - like chdir

2007-07-11 Thread Kai Grossjohann
On Tue, Jul 10, 2007 at 06:46:10PM +0100, David Woodfall wrote:
 
 Sorry it's hard to explain what I mean. Basically, I have some keybinds set
 up like this:
 
 macro   browser l   c^u/home/dive/mail/listsreturn
 
 Works fine, but, I want to be able to cd into an mbox. I can't with c
 because I get an error about it not being a folder. So is there a command I
 can use in a macro or bind that will cd to an mbox?

Do you want to open the given mailbox / mail folder?

Kai


Re: How to organize mail in folders?

2007-07-11 Thread Kai Grossjohann
On Wed, Jul 11, 2007 at 12:57:10AM +0200, Kai Grossjohann wrote:

 I used to use Gnus which is a newsreader at heart.  Therefore the method
 to organize mail in folders (groups in Gnus-speak) was different from
 what I think I need with Mutt.
 
 I'd like to get some ideas from you how you organize your mail.

Thank you for all your suggestions how I might achieve the old behavior
with Mutt that I had with Gnus.  They are very useful.  But it's not
what I was looking for, that would be continuing war^H^H^HGnus with
other means.

What I'm looking for is some suggestions on how else I might organize my
mail, that fits more with what Mutt offers.  I think most of you face
the same basic situation as I do:

  - Receive personal mail and mailing list mail.

  - Have different strategies for handling mail depending on the address
they were sent to (some mailing lists are less important than most
personal mail, so we don't check for new mail there as often).

  - Want to archive a large portion of mail.

  - Want to have an overview of messages that still need action of some
type.

  - Don't want the archive to interfere (too much) with this overview.

Right?  So what do you do?

tia,
Kai


Q: Better list of mailboxes?

2007-07-10 Thread Kai Grossjohann
I have added all my (important) mail folders to the mailboxes list, and
I am now very fond of y to browse them.  Some small features are
missing, though, so I thought I'd ask here for ideas:

  - How to navigate to the next/previous mailbox with new mail?

  - How to restrict the list of mailboxes to the ones with new mail?

  - How to show the total number of messages / the number of unread
messages in each mailbox?

  - How to elide information from each line, such as the permissions and
ownerships of the directories?

tia,
Kai


How to organize mail in folders?

2007-07-10 Thread Kai Grossjohann
I used to use Gnus which is a newsreader at heart.  Therefore the method
to organize mail in folders (groups in Gnus-speak) was different from
what I think I need with Mutt.

I'd like to get some ideas from you how you organize your mail.

For reference, here is what I think the problem might be.

I distribute incoming mail across several folders according to the
address they were sent to -- I am subscribed to quite a number of
mailing lists.

For most mailing lists, I want to know which messages are still to do,
and also to keep old messages that have already been processed.

With Gnus, I marked the to-do messages as important (flagged them, in
Mutt-speak, I think).  After it was done, the message was marked as
read.  Gnus would automatically show me both new messages and important
messages, hiding the ones marked as read.

I think Mutt always shows me all messages, so this method cannot be
used.

tia,
Kai