Re: Console HTML view with picture using W3M or other

2021-08-01 Thread David Champion
I do roughly the same, though I use a wrapper script that lets me choose an
inline (sixel) or external viewer. Sometimes I want to view the image while
walking mutt on to another task, and in that case the wrapper script
handles the lifecycle of the temporary file thus needed.

# -i or -e, or neither for a choice
image/*; mutt-view-image -i %s


case "$1" in
-i) mode=inline; shift;;
-e) mode=external; shift;;
*)  : ;;

if [ "$mode" = "" ]; then
normal=$(stty -g)
printf "Do you want to view (i)nline or (e)xternal? "
trap "stty $normal" 1 2 3 15
stty raw -echo

c=$(dd if=/dev/stdin bs=1 count=1 2>/dev/null)
stty $normal

case "$c" in
i*) mode=inline;;
e*) mode=external;;

if [ "$mode" = "inline" ]; then
view="img2sixel %s 2>/dev/null"

elif [ "$mode" = "external" ]; then
view="xopen %s; sleep 10"

xopen () {
# External open
d=$(dirname "$1")
f=$(basename "$1")
ln "$1" "$fn"
at now + 5 minutes &1
# This opens on Linux or MacOS
(xdg-open "$fn" || open "$fn") 2>/dev/null

cmd=$(printf "$view" "$1")
eval $cmd
if $pause; then
restore=$(stty -g)
trap "stty $restore" 1 2 3 15
echo "Press any key to continue..."
stty raw -echo
dd if=/dev/stdin bs=1 count=1 of=/dev/null
stty $restore

On Sun, Aug 1, 2021 at 3:58 PM Tavis Ormandy  wrote:

> On 2021-08-01, Patrick Shanahan wrote:
> > * Jude DaShiell  [07-31-21 23:34]:
> >> If memory serves, w3m can use av package if installed to allow it to
> view
> >> pictures.  I've only read about this never having been able to look at
> >> pictures.
> >> On Sat, 31 Jul 2021, D.J.J. Ring, Jr. wrote:
> >> > Has anyone succesfully configured mutt to give a roughly equivalent
> >> > view of html emails using w3m or other
> >> > browser in text console with direct-fb or other?
> > w3m is configuragle to display images, "auto_image=TRUE"
> Not exactly what was asked, but I use this mailcap to view image
> attachments:
> image/png; img2sixel -- %s | less -r; nametemplate=%s.png; needsterminal
> It uses the sixel support in xterm (or any other terminal that supports
> sixels) to display images in the terminal. I think you just need
> something like this in .Xresources to enable it in xterm:
> XTerm*decTerminalID: vt382
> Tavis.
> --
>  _o)$ lynx
>  /\\  _o)  _o)  $ finger
> _\_V _( ) _( )  @taviso

Re: Assigning multiple labels (X-Label) to a message

2020-12-20 Thread David Champion
* On 20 Dec 2020, Cameron Simpson wrote: 
> David, does the comma flavoured version trim whitespace on the results?  
> I ask because my mail filing has been using ", " in X-Label in strict 
> adherence to nothing whatsoever. OTOH, I can change that.

Yes. :)

David Champion •

Re: Piping Mail to external script stopped working

2020-12-16 Thread David Champion
* On 16 Dec 2020, Orm Finnendahl wrote: 
> Hi,
>  trying to pass the mail text from the index or pager to an external
> script (e.g. using the "|" keystroke on a mail in the index) it seems,
> it's not the text which gets piped, but rather the string
> "HASH(0x5652badff508)".

That looks like something printed from a perl program. Is the program
you're piping to a perl program? Possible that it's doing something
wrong with your input, and just printing an internal value?

David Champion •

Re: Assigning multiple labels (X-Label) to a message

2020-12-16 Thread David Champion
Sorry for top-posting, the quoted stuff below is relevant but I don't want
to respond point by point.

As Kevin mentioned, I have some patches that work to resolve this
stuff. They're up to date as of Mutt 2.0, and I hope to work on merging
over the next few weeks (winter break in the US).

A quick summary of status and expectation:

* Mutt was the first mailer to support "tagging" that I know of, with
  X-Label. That's why it's nonstandard: there were no standards at the
  time. X-label is supported in all mutt backends. (There's a reason
  that gmail calls them "labels" and not "tags" or "keywords")

* Upcoming code supports X-Label, X-Keywords, X-Mozilla-Keys, and

* Mutt will read keywords from any of these and, by default, write them
  back to the same header they originated from. If you prefer, you can
  tell mutt to merge them all to Keywords (the official RFC-compliant
  way to do it now).

* The new code will permit X-Label keyword splitting on space or comma,
  your choice, because the "correct" value is unspecified.  The other
  headers _do_ specify their separator.

* There will be virtual keyword support by means of a label-hook. These
  keywords are generated in runtime based on other message properties
  (e.g. List-Id, Subject, From) and are not saved to message headers.
  Label-hook virtual keywords correspond closely to labels created by
  gmail filters.

* Both IMAP and local folders are supported, but we're still doing it
  through header analysis, not protocol-level keyword handling. There's
  room for improvement here but I'm not taking it on right now.

* On 16 Dec 2020, Kurt Hackenberg wrote: 
> On 2020-12-16 13:05, Kevin J. McCarthy wrote:
> > Mutt's label handling is pretty basic right now.  It expects only a
> > single X-Label header in the email.  When editing the label, Mutt only
> > knows how to write a single X-Label header back.
> ...
> > The label completion has some code to delimit by ":" or ",". However,
> > internally Mutt doesn't understand the multiple values, making the
> > completion less then useful.
> Some mail programs use X-Keywords, which I think can have multiple keywords
> separated by whitespace. Pine and Dovecot use that header, that I know of.
> My knowledge is fragmentary, and these headers are non-standard, so not well
> defined.
> I don't know of anything other than Mutt that uses X-Label, but I don't know
> much.
> One possibility would be to keep X-Label, add X-Keywords, and make the first
> value from X-Keywords be the only value of X-Label. That would attempt to
> maximize compatibility with other software.
> How does Mutt handle this through IMAP? The protocol knows about keywords.
> Dovecot, using maildir, can store multiple keywords as metadata, outside the
> message file contents. That's a non-standard extension of maildir, though.
> What about when Mutt handles maildir directly? Still X-Label in the message?

Re: cache/session related problem for (neo)mutt

2017-05-11 Thread David Champion
* On 11 May 2017, Baron Fujimoto wrote: 
> I recently upgraded my MacPorts-installed version of (neo)mutt. Since then
> I freqently encounter situations where I cannot refresh mailboxes, or
> otherwise delete and expunge messages. Even (q)uitting doesn't work, so
> maybe it's any attempt to save changes to the mailbox? I can work around
> this problem if I e(x)it mutt and delete the .mutt/cache directory before
> restarting the app. Eventually however the broken behavior returns. I've
> noticed at least once that this happens right after my session expired,
> but I'm not sure that's a prerequisite.
> Is this a known issue with either the MacPorts port specifically or this
> version or more generally? Any ideas or suggestions?

Do you have any specific steps to reproduce, or it just seems to happen
randomly?  This does not sound familiar to me as a mutt user, but
neomutt is a fork with a _lot_ of changes and altered behavior, and is
no longer code-compatible with mutt -- meaning that it's very difficult
for us to support it or know what it's doing.

If we can reproduce it, then of course we can help.

> $ mutt -version
> NeoMutt 20170428 (1.8.2)
> Copyright (C) 1996-2016 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 16.5.0 (x86_64)
> libidn: 1.33 (compiled with 1.33)
> hcache backends: gdbm
> Compiler:
> Apple LLVM version 8.1.0 (clang-802.0.42)
> Target: x86_64-apple-darwin16.5.0
> Thread model: posix
> InstalledDir: 
> /Applications/
> Configure options: '--prefix=/opt/local' '--enable-compressed' 
> '--disable-debug' '--disable-gpgme' '--enable-imap' '--disable-nntp' 
> '--disable-notmuch' '--disable-pop' '--disable-sidebar' 
> '--disable-silent-rules' '--enable-smtp' '--disable-warnings' 
> '--mandir=/opt/local/share/man' '--with-docdir=/opt/local/share/doc/mutt' 
> '--with-libiconv-prefix=/opt/local' '--with-curses=/opt/local' 
> '--without-bdb' '--with-gdbm=/opt/local' '--without-gnutls' '--without-gss' 
> '--with-idn=/opt/local' '--without-kyotocabinet' '--without-lmdb' 
> '--without-qdbm' '--with-sasl=/opt/local' '--with-ssl=/opt/local' 
> '--without-tokyocabinet' 'CC=/usr/bin/clang' 'CFLAGS=-pipe -Os -arch x86_64' 
> 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64' 
> 'CPPFLAGS=-I/opt/local/include'
> Compilation CFLAGS: -pipe -Os -arch x86_64
> Compile options:
> SENDMAIL="/usr/sbin/sendmail"
> MAILPATH="/var/mail"
> PKGDATADIR="/opt/local/share/mutt"
> SYSCONFDIR="/opt/local/etc"
> EXECSHELL="/bin/sh"
> patch-attach-headers-color-neomutt
> patch-compose-to-sender-neomutt
> patch-compress-neomutt
> patch-cond-date-neomutt
> patch-encrypt-to-self-neomutt
> patch-fmemopen-neomutt
> patch-forgotten-attachments-neomutt
> patch-forwref-neomutt
> patch-ifdef-neomutt
> patch-index-color-neomutt
> patch-initials-neomutt
> patch-keywords-neomutt
> patch-kyoto-neomutt
> patch-limit-current-thread-neomutt
> patch-lmdb-neomutt
> patch-lua-neomutt
> patch-multiple-fcc-neomutt
> patch-nested-if-neomutt
> patch-new-mail-neomutt
> patch-nntp-neomutt
> patch-notmuch-neomutt
> patch-progress-neomutt
> patch-quasi-delete-neomutt
> patch-reply-with-xorig-neomutt
> patch-sensible-browser-neomutt
> patch-sidebar-neomutt
> patch-skip-quoted-neomutt
> patch-status-color-neomutt
> patch-timeout-neomutt
> patch-tls-sni-neomutt
> patch-trash-neomutt

David Champion •

Description: PGP signature

Re: Mutt on Windows 10 using WSL

2017-02-01 Thread David Champion
* On 01 Feb 2017, Paul McCormack wrote: 
> The only issue that I am having is that I cannot launch Windows executables 
> from the bash prompt, so I cannot get my GUI mailcaps to fire. The same issue 
> is described here, but there is no useful response:
> Has anyone else tried Mutt on Windows 10?

I haven't, but this is interesting news - thanks for sharing it.

It seems like someone will come up with a way to run native windows
commands from within the WSL - even if that's a separate executable you
have to prefix commands with (e.g.: sh -c "exerun MSPaint.exe").

David Champion •

Description: PGP signature

Re: display_filter and ex

2017-01-31 Thread David Champion
* On 31 Jan 2017, Patrick Shanahan wrote: 
> * David Champion <> [01-31-17 19:31]:
> > * On 31 Jan 2017, Andreas Doll wrote: 
> > > 
> > > I write emails using vim, which provides the handy function gggqG. This
> > > function reformats text such that it doesn't exceed (say) 72 characters. 
> > > The
> > > function is superior to e.g.
> > > 
> > > $ fold -s -w 72 inputFile
> > 
> > par is superior to all other text reformatters.
> > set display_filter="env PARINIT='rT4bgq B=.,?!_A_a Q=_s>|+' par"
> Your display_filter mangles display of the headers.  How to avoid this?

Yeah, I don't actually use this.  I suppose vim would do the same,

The avoidance trick would be something akin to:


# Read up to the first blank line unaltered
while read line; do
echo "$line"
case "$line" in
'') break;;

# Pump the remainder through par
par 'rT4bgq B=.,?!_A_a Q=_s>|+'

David Champion •

Description: PGP signature

Re: display_filter and ex

2017-01-31 Thread David Champion
* On 31 Jan 2017, Andreas Doll wrote: 
> I write emails using vim, which provides the handy function gggqG. This
> function reformats text such that it doesn't exceed (say) 72 characters. The
> function is superior to e.g.
> $ fold -s -w 72 inputFile

par is superior to all other text reformatters.
set display_filter="env PARINIT='rT4bgq B=.,?!_A_a Q=_s>|+' par"

But to your question:

> Recently I've learned about the display_filter option, and now I want to use
> this vim function to also reformat emails I read, not just those I send. Ex is
> (roughly) a way to perform vim actions and commands without starting a vim
> instance. So I thought I create a file commands.vim containing
> :normal gggqG
> :%print
> :%quit!
> and use in my muttrc
> set display_filter='cat commands.vim | ex'

The display filter is a filter in a strict sense: the message is send on
its stdin, and its stdout goes back to mutt.  So what you get is
analogous to the following:

cat emailmessage.txt | cat commands.vim | ex

The first cat is a no-op since the second cat doesn't read its stdin in
this case.  You can combine a file with stdin with, e.g.

cat commands.vim -

But that isn't what you want.  You need to compose it so that ex gets
your message and the stdin:

touch $tmp
trap "rm $tmp" 0 1 2 3 15
cat >$tmp
cat commands.vim | ex $tmp

Then set display_filter to run that script.

This is all approximate - untested. Some tweaks might be necessary.

David Champion •

Description: PGP signature

Re: message-ids containing slashes was: Can I use Mutt from Bash to extract attachments into an arbitrary directory?

2016-11-19 Thread David Champion
* On 19 Nov 2016, Cameron Simpson wrote: 
> Just to followup on this, here I am code reviewing some stuff for work and
> what does github use for Message-IDs? This:
>  Message-ID: 

Interesting. I guess I would be inclined to solve this by simply
urllib.quote()ing the string - consistent and predictable encoding no
matter what oddities appear in the original string.

David Champion •

Description: PGP signature

Re: Tagging duplicates

2016-11-09 Thread David Champion
* On 08 Nov 2016, Jon LaBadie wrote: 
> A year or more back someone posted a technique for
> tagging duplicate mails in a mailbox.  It used T~=.
> The tagged mails could then be deleted.
> I'm now using mutt on another system and the T~=
> sequence does not work and I can't see what I
> might have added to my .muttrc to make it work.

It should just work.

What happens when it doesn't work? If I tag-pattern something that isn't
defined -- in this case, "~." -- I get this:

.: invalid pattern modifier

Do you get that error, or does it just not tag anything?

David Champion •

Description: PGP signature

[SPAM?] Re: [SPAM?] Re: Can I use Mutt from Bash to extract attachments into an arbitrary directory?

2016-09-15 Thread David Champion
* On 14 Sep 2016, Cameron Simpson wrote: 
> On 14Sep2016 18:35, David Champion <> wrote:
> Just an aside, now often do you encounter "/" in a Message-ID? It is legal,
> and has long discouraged me from the otherwise obvious and inuitive
> name-a-file-after-the-message-id.
> > #!/usr/bin/env python
> [...]
> That is very nice, even cleaner than I imagined it might be.

Thanks - yes, my intention was just to demo the approach. I've done
a few MIME walks in Python so this was a simple modification of some
existing code. Even with many years of mutt experience I think rolling
this up last night was faster than getting something steady and sturdy
going with mutt macros, and I have more confidence in it.

There's certainly room to improve if anyone wants to take this further,
and you've raised a good point above. A few things ought to be sanitized

David Champion •

Description: PGP signature

[SPAM?] Re: [SPAM?] Re: [SPAM?] Can I use Mutt from Bash to extract attachments into an arbitrary directory?

2016-09-14 Thread David Champion
* On 14 Sep 2016, Cameron Simpson wrote: 
> Mutt is probably a poor match for the task because although it will decode
> messages etc, all the saving is interactive. In particular, there's no API
> for "iterating" over attachments, let along recursively.

Agree. It's entirely doable, but not worth the trouble and the
maintenance when there are other fine options.

> I'd be going for the Python stuff, lacking your context.

See attached.

You can pipe a message into this program (within mutt or elsewhere):

| mutt-savefiles /tmp/foo

It will create a directory under /tmp/foo named for the message's
message-id, and store each attachment inside. Filenames are taken
from the MIME or generated sequentially if there is no filename.

David Champion •
#!/usr/bin/env python
# TODO: merge into sympafile

import os
import sys
import email
import mimetypes

m = email.message_from_file(sys.stdin)

# mimetypes very unfortunately maps text/plain to .ksh, so
# we'll favor this internal list in type lookups.
localtypes = {
'text/plain': '.txt',

if 'message-id' in m:
msgid = m['message-id'].strip('<>')
msgid = str(time.time()).replace('.', '_')

if len(sys.argv) > 1:
dirname = sys.argv[1]
dirname = '.'

dirname = os.path.join(dirname, msgid)

n = 0
for p in m.walk():
n += 1
mtype = p.get_content_type()
if mtype.startswith('multipart/'):
# container

ext = localtypes.get(mtype.lower()) or \
  mimetypes.guess_extension(mtype) or \
filename = p.get_filename() or ('%02d%s' % (n, ext))
filename = os.path.join(dirname, filename)
data = p.get_payload()
print filename, len(data)
fp = open(filename, 'w')

Description: PGP signature

[SPAM?] Re: [SPAM?] validation of e-mail addrs

2016-07-13 Thread David Champion
* On 13 Jul 2016, Matthias Apitz wrote: 
> Hi,
> Is there some function in mutt's source which validates e-mail addrs?
> Thanks

Validates in what sense?

There are parse_address and (more broadly) rfc822_parse_adrlist, which
will reject or complete certain kinds of malformations based on RFC
(822, 2822, 5322, etc).  But RFC 5322 et al. are the only things mutt
cares about, address-wise.  Nothing in mutt tries to anticipate what
kind of junk ICANN is sunrising next month, or what ISO CC split from
another ISO CC last year, or whether a given RHS is a valid DNS name or
has an A/CNAME/MX record, etc.  In short, mutt never makes any effort to
see that an address is deliverable; only that it conforms the address
format specification.

At higher level, DNS validity in an email address is not mutt's concern.
Mutt could be running within an intranet in which global DNS is not
visible, and where no domain assumptions can be verified.  Since mutt
assumes an upstream SMTP relay (either via $sendmail or via built-in
SMTP), it can be used to send to a wide variety of addresses that mutt
itself knows nothing about; these are presumed to be understood by the
smtp relay. So mutt really has no interest in validation of an address
beyond the RFC.  It never really looks at your addresses beyond that.

At an even higher level, the only method the internet supports to
validate an address is to send it email and see what happens.

David Champion •

Re: Questions about gmail app passwords

2016-04-25 Thread David Champion
* On 25 Apr 2016, Grant Edwards wrote: 
> When one enables Google two-step verification, one can generate
> "application specific" passwords for use by programs like mutt,
> offline-imap, msmtp, exim, fetchmail, etc.  I've been reading both
> Google and third-party documentation on this, and can't find any
> description of what "application specific" actually _means_.

It means nothing. You can think of it as "supplementary password".

> Do you need different, unique passwords for mutt, imap, msmtp,
> offlineimap, and all other IMAP or SMTP clients on a particular
> machine?
> Are you required to use the same password for mutt on all machines?

No. You can create as many application-specific passwords as you need
at  Each
can be tagged with an application name and a device name to help you
remember where you're using that password, but they're all equivalent.
Google doesn't pick up on what each one is specifically being used from,
although they may track whether passwords are being used at all.

Choose your own granularity.

David Champion •

Re: My print command cannot use "read -p"

2016-04-22 Thread David Champion
* On 21 Apr 2016, Jon LaBadie wrote: 
> Unless it has changed recently, bash runs redirected read
> commands in a sub-process.  Thus the variable fn would not
> get set in the main process.

I haven't run into this (that I recall) with regular input redirection.
It does happen with piped input redirection (to a read) because the
pipeline terminal isn't the current shell.

read fn 

Re: My print command cannot use "read -p"

2016-04-21 Thread David Champion
* On 21 Apr 2016, Xu Wang wrote: 
> Hi,
> I would like to have a print command that takes input from the user.
> But mutt pipes the message to the print command so I guess I cannot
> use something like
> read -p "where to save?" filename
> because read looks on STDIN and mutt already piped to STDIN.

You've analyzed it right. Solution: read "$fn"

David Champion •

Re: portable shell scripts (was: How do you survive without notmuch?)

2016-04-07 Thread David Champion
What fun!

* On 07 Apr 2016, Cameron Simpson wrote: 
> Ah. I like zsh for my interactive shell. But we always leave root's shell
> alone. However, I am a _very_ strong advocate for writing scripts for
> /bin/sh, and avoiding bashisms for exactly your reasons above. Am I alone in
> wincing everytime I hear the term "bash scripting" these days?

No, you're not. :) I haven't brought myself to use zsh yet, because
I do a lot of /bin/sh snippet teseting in my interactive shell and I
like it to interpret bourne code correctly.  Bash does, but zsh does
not -- even with all the compatibility options set.  There are certain
bourne sequences that zsh does the wrong thing with, and that affects my

> > Though, the
> > switch in many Linux distros to dash as the system shell has somewhat
> > thwarted me--dash isn't (IMO) usable as an interactive shell, has some
> > issues as a scripting shell, and has slightly different semantics (BSD
> > vs.  SysV echo, for instance) than bash on some oft-used builtins,
> > etc..  I find this extremely annoying.  I get why they did it, but I
> > think it would have been a much better idea to produce a
> > bash-workalike shell for the subset of features they wanted to
> > support.  Or patch dash to behave the same where its supported
> > features differ.  Anyway, I digress.
> Oh, please digress!

I tend to like dash, although my experience of it is limited.  I didn't
like ash but dash seems pretty solid so far.  And its code is quite
readable.  This is excellent.  Bash is a morass.

> but printf for parameterised output:
>  printf '%s\n' "$arbitrary_value"

I've started leaning on printf for newline-less printing lately -- it's
just easier.  But you must be careful to use 'printf %s "$foo"' instead
of just 'printf $foo', since otherwise a % in input can thwart.

> and I have my own script "necho" for "echo with no newline" for the
> appropriat platform (or I make a shell function necho() calling printf for
> the same purpose, depending on context). Then one can go:

Let's see if I can get this right from memory:
case "`echo -n`" in)
-n) necho () { echo "$@""\c"; };;
*)  necho () { echo -n "$@"; };;

Speaking of which, it's taken me until the last year to use $(command)
consistently instead of `command`, and I'm not sure anymore why I was
a stickler.  I assume some older shell didn't support $() but I can't
recall which.

David Champion •

Re: How do you survive without notmuch?

2016-04-07 Thread David Champion
* On 07 Apr 2016, Christian Brabandt wrote: 
> According to Sven Maschecks website 
> ,
> | These shells behave the old way and need ${1+"$@"}:
> | 
> | Certainly: /bin/sh on 7th edition (aka Version 7). And thus also /bin/sh on 
> original BSDs, until these shipped the Almquist shell (after 4.3BSD-Reno)
> | HP-UX 8, 9 /bin/sh, HP-UX 10.x, 11.x /usr/old/bin/sh (as /bin/sh has become 
> a ksh)
> | OSF1/V4 and V5 aka Tru64 /bin/sh
> | Ultrix /bin/sh and /bin/sh5
> | Sinix 5.20 /bin/sh in both the "ucb" and the "sie" universe 
> `

Thanks, that must be it. Not Solaris and IRIX, but HP-UX and OSF/1.
BTW OSF/1 refers to v1-v3. v3.2-v4 are Digital Unix or, later (v4.0F),

> so basically, not relevant anymore.

Some people still have to support some of those, believe it or not.

if [ x = "x$1" ] ...

David Champion •

Re: How do you survive without notmuch?

2016-04-07 Thread David Champion
* On 06 Apr 2016, Cameron Simpson wrote: 
> On 06Apr2016 19:52, Ben Boeckel <> wrote:
> > On Thu, Apr 07, 2016 at 09:38:43 +1000, Cameron Simpson wrote:
> > > For historic reasons, "$@" evaluates to a single "" if there were no 
> > > arguments
> > > at all, introducing a spurious new empty argument. Possibly the thinking 
> > > was
> > 
> > What shell is that? I've *never* encountered such a bug (well, I'd classify 
> > it
> > as such at this point) and I do quite a bit of shell scripting.
> Probably fixed in modern shells. How long have you been shell scripting? (I
> also consider it a bug; the incantation is a workaround.)

I vouch for this.  I've encountered it in practice, although I couldn't
presently say where or when.  And I used the same solution, and I still
write it if I want to be especially robust.  I don't like to assume my
code will never be run on an older machine, especially when I have a
amiga running netbsd 1.0 and a next slab in the basement.

(I recently got rid of all my other suns, sgis, and alphas.  I used to
be able to make a stronger case.)

I'm not completely sure, but I *think* that I still saw this behavior on
late-model bourne shells (i.e. not bash or zsh) derived from svr5 code
the last time I used solaris or irix.  But while it's probably a bug,
it's the kind of bug that becomes entrenched and is actually dangerous
to fix when a decent workaround is available.  I think the architects of
modernity made a mistake on this one -- although reverting it now would
be a mistake for the same reason.

David Champion •

Re: folder-hook to move messages after 2 weeks to another folder.

2016-03-30 Thread David Champion
> On 2016年03月27日 14時38分, Peter Terpstra wrote:
> > 
> > Dear readers,
> > I have:
> > 
> > folder-hook =inbox  
> >  "push T~d>2w=read-mail"
> > 
> > ..which works, but has an issue.
> > 
> > The issue is that when there are no messages to move it moves the first 
> > message of
> > the inbox to readmail, disregarding the 2w.
> > 
> > Does anyone know a solution to this?

I.e. use  instead of , and wrap up with an

David Champion •

Re: leaking timezone

2016-03-21 Thread David Champion
> I don't think mutt puts the Date: header on outgong email.

Mutt does, but if it didn't then the MTA would.

Mutt uses the local time zone, so you can either set the machine time
zone to UTC or (as mentioned) run it with TZ=UTC in the environment.

However, as also was mentioned, the Received: headers that annotate
your mail's progress through the internet are generally in their own
respective timezones -- including your own msmtp's.  So you're hiding
something that people can infer pretty easily.  To obfuscate this
you would need to inject the mail at a server that uses a different

For example, the OP's first message had these:

Received: from ([])
by with esmtps
(Exim 4.86_2)
(envelope-from <>)
id 1ahx3Z-WN-Bw
for; Mon, 21 Mar 2016 10:27:31 +
Received: from compute1.internal (compute1.nyi.internal [])
by mailout.nyi.internal (Postfix) with ESMTP id 1CEF320739
for <>; Mon, 21 Mar 2016 06:09:31 -0400 (EDT)
Received: from frontend1 ([])
by compute1.internal (MEProxy); Mon, 21 Mar 2016 06:09:31 -0400

If he had bypassed his own systems and gone directly to fastmail, those
-0400 zones wouldn't appear and we wouldn't know where he is so easily.
Doing so would mean using mutt's built-in SMTP instead of an external
agent.  But if every MTA between mutt and fastmail is running under
TZ=UTZ, that's another knowledge bypass.

David Champion •

Re: Conditional configuration

2016-01-30 Thread David Champion
* On 29 Jan 2016, wrote: 
> So, whoever is producing the fork, DOES work with the community within
> the scope of the GNU GPL.

Working within a development community and keeping the terms of a
license are disjoint.  Doing one gains you no ground on the other.
mutt-kz keeps the license.  It does not work with the greater mutt

David Champion •

Re: Conditional configuration

2016-01-30 Thread David Champion
* On 29 Jan 2016, wrote: 
> Hello,
> I don't understand why be jealous on something that has been clearly
> worked out in the licence itself.
> I don't know who is that man, but speak to him. Don't blame people for
> doing something that was intended to do in the first place.
> It was intention that everyone can make a fork and do what they want. So
> don't stamp on the freedom of software and GNU GPL, as there is just
> nothing written about the "Community" in the licence. 
> Not even the word "community" is there.

I don't follow why you're bringing up the GPL.  It has nothing to do
with my concerns.  I don't know who this guy is either, but as far as I
know he's completely within his licensed rights and I have nothing to
say about that.

What bothers me is the approach.  It follows the very loose flavor of
a thousand "fork me on github" users.  This model is OK.  It's open
source, it's great for downstream.  But if only benefits upstream if
someone makes the effort to patch upstream.  The usual model is either
that when you fork, you take responsibility for guiding changes back
upstream, or that people at both ends become cooperative partners in
exchanging ideas between forks.  There are discussion and pull requests.
Karel Zak doesn't do this (he's never posted to mutt-users or mutt-dev)
and I don't recall that anyone else has ever made that effort either.

So his project is de facto a divergent fork.  It has its own
distributions and adherents, and nobody is bringing any efforts in
mutt-kz back to mutt.  It divides the mutt user community.  And his
decision to convert all his development to git means that even if
someone makes the missing effort, it's more work to cherrypick anything
back to mutt.

David Champion •

Re: Conditional configuration

2016-01-30 Thread David Champion
* On 29 Jan 2016, Will Yardley wrote: 
> I wasn't familiar with mutt-kz, but ultimately, I think some of these
> projects have helped in less direct ways. I didn't follow the (now
> defunct, AFAICT) mutt-ng project much, but it seems to me as if it put
> some much needed pressure in terms of making mutt development a little
> more active (and maybe a little more accepting of adding new features).

That's true, it did.  But Rocco Rutte (who began/directed mutt-ng) was
in regular communication with the upstream mutt user and development
bases, and ultimately merged a great deal of his effort back to mutt and
became a core maintainer.  This is a completely different picture from

Understand that I'm not arguing against forks, or against nonlinear
development.  Moving to Mercurial from CVS was of tremendous benefit
to mutt's growth.  I myself have multiple forks and patch queues that
are not part of upstream mutt.  But I participate in the central mutt
development community; there's always consideration of merging back to
mainline mutt; and I take that responsibility on myself.  By contrast I
don't have any idea of where mutt-kz is headed, but indicators aren't
positive (cf. converting to another vcs and never posting here).

David Champion •

Re: Conditional configuration

2016-01-30 Thread David Champion
* On 30 Jan 2016, wrote: 
> to the person who has made the forked mutt? Why bash such person, who is
> contributing, on the public list that is going to stay here for ages.

So you've now accused me of jealousy, envy, and "bashing" -- I guess
that's defamation?  I don't think any of these are accurate.  I'm
describing why I don't agree with the choices another developer has
made, and why I wish he had chosen differently.  This grew naturally out
of a discussion about differences between mutt-kz and mutt; I didn't
just start weighing in ad hoc on another software project, and most of
what I've said is in response to you, not the original topic.  I've
explained my position, so I'll let it lie there.

Good luck with your approach of expecting upstream maintainers to
independently discover and uptake the worthwhile developments in any
forks of their projects.  As a developer it seems backwards to me, but
if it works for your coding projects, I'm glad for you.

David Champion •

Re: Conditional configuration

2016-01-29 Thread David Champion
* On 28 Jan 2016, martin f krafft wrote: 
> also sprach Lukasz Szczesny <> [2016-01-28 21:42 
> +1300]:
> > I keep my sidebar configuration in a separate file and source it when
> > sidebar is enabled with the following `source` command:
> > 
> > source `FILE=$HOME/.mutt/sidebar; mutt -v | grep -Fq sidebar || 
> > FILE=/dev/null; echo $FILE`
> Unfortunately, mutt-kz does not export this info in -v output:

I'm guessing you use kz on one machine and real mutt on the other.  Not
showing what features are added beyond stock mutt is, I'm afraid, a kz

I don't use mutt-kz, and Karel Zak doesn't talk to us so we have no idea
what he does with his fork.  But I think that mutt-kz incorporates the
sidebar code, _not_ as a patch, so it's not shown as a feature.  If it
has a configure option to enable it and kz tracks upstream, then you
should be able to get the --enable option from mutt-v.

Otherwise... you could strings the binary I guess? Or run mutt against a
-F config file containing sidebar config options, and see if it errors
out to test for feature presence?

David Champion •

Description: PGP signature

Re: Conditional configuration

2016-01-29 Thread David Champion
* On 29 Jan 2016, martin f krafft wrote: 
> It's a shame to hear that Karel doesn't do his work within the
> community. mutt-kz is a nice piece of work and why not provide an
> officially experimental mutt?

I wonder, too, why he works entirely separately.  I wish he were feeding
back to the community but he seems more interested in maintaining a
separate fork, and letting us worry about following/backporting his

> [several approaches to a solution deleted]

I should have thought of this one before, but your suggestions made me
remember it:

mutt -D | egrep '^some_variable='

That would tell you very simply whether that variable is in the

David Champion •

Description: PGP signature

Re: Internal mutt commands?

2015-12-01 Thread David Champion
* On 01 Dec 2015, David Woodfall wrote: 
> Is there a list of commands we can use inside mutt? I did a quick
> google, but didn't find anything useful.
> I did try :display-toggle-weed but got an unknown command error.
> Dave

Commands are the things you can put in a muttrc or execute at the :

display-toggle-weed is a function -- something that can be bound to a

Then of course there are variables: things you can set or unset:

David Champion •

Re: Open postponed menu on startup

2015-11-23 Thread David Champion
* On 23 Nov 2015, Xu Wang wrote: 
> I would like to have mutt open postponed when I first start mutt. Is
> there a way to do this from the .muttrc? I suppose I could do that
> "push R" trick, but I would prefer a .muttrc solution.

You can put the "push R" into your muttrc.

You can also use "mutt -p" to recall postponed from the command line at
startup.  Mutt will exit when you leave postponed mode.

David Champion •

Re: Author's name in index from address book

2015-11-20 Thread David Champion
* On 19 Nov 2015, Ian Zimmerman wrote: 
> You don't need to write a script for that.  Mutt will display the "real
> name" automatically for addresses in your alias list.  Define aliases in
> your .muttrc as follows:
> alias Foo Foo Bar <>
> and now incoming mails from will have "Foo Bar" in the
> origin field.

But you do need:

    set reverse_alias

to get that.

David Champion •

Re: understanding PGP encrypt to myself

2015-11-15 Thread David Champion
* On 15 Nov 2015, Rejo Zenger wrote: 
> ++ 14/11/15 22:47 -0500 - Xu Wang:
> >>
> >> A copy of the message will also be encrypted by your own public key and 
> >> saved
> >> in the folder you have specified for Sent messages.  It is this copy which 
> >> you
> >> can decrypt with your private key later on, if you wish to read what you 
> >> sent
> >> to the recipient.
> [...]
> >I see. So it is one email, but there is never actual double encryption
> >on the same text. It is two single encryptions. I think I am
> >understanding more.
> As I understand it: your message is encrypted to a session key, and that 
> session key is encrypted with your and the recipients' key. That way, 
> the message may have a large number of recipients, but doesn't increase 
> in size as much.

This is correct.  PGP encryption generates a random symmetric key of
a large size -- essentially a really long password.  It encrypts the
original message using that "session key".  The session key is included
in the PGP output alongside the encrypted message, but it's encrypted
once for each recipient.  This gives huge space savings in the final
message, compared to encrypting the message once per recipient.

When you decrypt, PGP finds the list of encryptions of the symmetric key
and searches for the one encrypted with your public key.  It decrypts
that to get the session key, then uses the session key to decrypt the
original message.

There are two ways to store that list of session key crypts.  The
default is like a dictionary -- each ciphertext is indexed with the
key ID that encrypted it.  When PGP decrypts this, it can quickly zip
right to the correct session ciphertext.  The other way stores these
ciphertexts anonymously -- not indexed by key ID.  This is more secure,
but slower because PGP must try each one in turn to find the correct
ciphertext.  It's not a problem for a few recipients though -- it's
really only a performance problem with many separate recipients.

David Champion •

Description: PGP signature

Re: Press any key to continue

2015-09-21 Thread David Champion
* On 21 Sep 2015, Cameron Simpson wrote: 
> So you might have ",y" mapped to a macro to save various settings (i.e. save
> everything that any of your macros fiddle with) and ",Y" mapped to pull the
> values back from $my_foo et al into the settings again.
> Then put ",y" at the start of your macros and ",Y" at the end.

Similarly, I have macros that cycle through various values of
$index_format. There are four of them, named something like "=y0",
"=y1", etc.  Each macro sets the $index_format, then macros "Y" to the
next "=y" in the list. Upshot: each time I press Y my index_format
changes, rotating through four options.

> I think about this issue frequently. My preferred general approach would be
> some kind of stack of settings: "push settings", do work, "pop settings".
> And possibly "push particular setting(s)".

Before the my_ variables were introduced I had a patch for making
variable stacks.  I like your idea of push/pop all settings. I didn't
have that but it sounds useful.  Sort of like a gsave/grestore (for
postscript nerds).

> There are three trickinesses that spring to mind: (a) defining the "end of
> work point", (b) making the "pop settings" operation run even when something
> in the middle of your macro fails and (c) what about when you want your
> macro to change one setting by hack-and-preserve the rest of them. You'd
> need some kind of "set value in the outer set" or "set value in some global
> set" or something.  Issue (c) would be nasty to define - one can imagine
> wanting all sorts of variations depending on circumstances.

Keep thinking about this stuff.  I'd be interested in a comprehensive
plan that addresses multiple use cases and doesn't break existing
configs.  One passing thought that I haven't given much consideration
to: fail-hook, defining what happens when something doesn't complete
as intended.  (But the _much_ harder problem is detecting failure in a
consistent and useful way.)

David Champion •

Re: Press any key to continue

2015-09-21 Thread David Champion
* On 21 Sep 2015, Ben Boeckel wrote: 
> On Mon, Sep 21, 2015 at 11:38:23 -0400, Patrick Shanahan wrote:
> > No, you don't chang mutt to accommodate vim as many, maybe most, use
> > another editor.  Mutt has a manner available to provide the state you
> > wish, use it.  And, as with many programs, you may have to keep track of
> > the conditions you set to provide the environment you wish.
> This was not saying to accomodate Vim, but to take a command it provides
> as inspiration for a command which could be useful in Mutt.
> Is there a way to push or save the current wait_key setting so that it
> gets set back to the original value when the macro is complete?

The pattern is:

set my_wait_key=$wait_key
unset wait_key
set wait_key=$my_wait_key

David Champion •

Re: Press any key to continue

2015-09-21 Thread David Champion
* On 21 Sep 2015, Jon LaBadie wrote: 
> > 
> > I still think some command or function to do this would help a lot.
> > Wrapping all functions like this is…tedious to say the least. It also
> > makes reading these things annoying since the meat of the binding is
> > buried 65 characters into the line.
> Can a macro be executed by another macro?
> Back in my troff days we used to write macros like
> "save_a_group_of_settings" and "restore_saved_settings".
> After the housekeeping macro calls appeared at the start
> and end of several other definitions, the mind learns to
> ignore them when considering the logic of the macro later.

Yes. I do that pretty often and agree it's appropriate here.

David Champion •

Re: Compressed maildirs possible?

2015-09-17 Thread David Champion
* On 17 Sep 2015, Ian Zimmerman wrote: 
> Can the compressed folder code handle the case where the archived file
> is something like .zip or .tar, and contains a whole maildir?  From
> reading that part of the manual it seems it should be possible, but I
> thought I'd check before playing with my precious archives.

Yes. (Just tar, make copies, and experiment.)  Your hook event can
be anything -- even bulk folder encryption is an option.

I've done both these in the past, but not at present so I'm afraid I
don't have any specific examples.  I finally decided that compress-hook
was suboptimal, and instead I use dynamic compression and deduplication
at the filesystem layer.  It's delightful.

David Champion •

Re: highlighting *bold* and _underline_ in mutt

2015-09-01 Thread David Champion
* On 01 Sep 2015, mwnx wrote: 
> Thanks. I didn't know you could do that. It seems that it requires
> 'allow_ansi' to be set to 'yes' though. To my understanding, this allows
> ANSI sequences in the original message to be interpreted, which, as
> suggested by mutt's manual, does pose somewhat of a security risk.
> It would be nice to have a way to have an option like 'allow_display_ansi'
> which would permit ANSI sequences to be added by the display filter while
> still filtering out ANSI sequences present in the original message. Oh well,
> ... maybe I'll see about writing a patch.

I'm not sure there's really any security risk in allow_ansi.  (Perhaps
there was once, I don't recall.)  Looking quickly at the ANSI-handling
code, it seems to allow only colors and text attributes (bold,
underline, etc).  It doesn't appear to do anything with the more
dangerous sequences.

David Champion •

Re: scoring top posters

2015-07-30 Thread David Champion
Hi Mattias -

* On 30 Jul 2015, Matthias Apitz wrote: 
 are some other text lines. Of course we need here a good regular
 expression because the line 'On 29 Jul 2015, Matthias Apitz wrote:'
 is highly configurable and language dependent.

That's why I wouldn't do it with anything regular-expression-based, like
mutt.  Here's an example procmail rule which I haven't tested.

toppostlines=`awk '/^/ {exit;} /^ *$/ {next;} /^[^ ]*:/ {next;} {total += 1;} 
END {print total}'`
:0 f
| formail -i X-Top-Post-Lines: $toppostlines

This tells how many non-blank lines occur between the header and quoted
text, without regard to what's in those lines.  Two or three is probably
not top-posty.  You could go further and count unquoted lines AFTER the
first quoted line.  Then mutt can score on X-Top-Post-Lines.  

This doesn't help with any encoded mail -- you'd need a smarter filter
for that.  Smart decoding and inability to run filters on your mail
service are the main reasons you would want to do it inside mutt, but
that seems very challenging at best (and impossible at worst).

Making this more general is left as an exercise.  But I wouldn't
recommend it really.  I find personally that downscoring top-posters is
a pretty poor way to judge content.  If it works for you, great, but you
must not exchange email with very many normal people. :)

David Champion •

Re: scoring top posters

2015-07-29 Thread David Champion
Simplest idea I have is to add a procmail (or whatever) rule to detect 
then insert a yes or no header into the message:

X-Top-Posted: yes

Then it's trivial to score it in mutt.

* On 29 Jul 2015, Matthias Apitz wrote: 
 I'm using scoring to mark, auto delete, ... certain mails I do not want
 to read. I'd like to auto-score top posters for the next mail. For the
 first mail it is not possible due to scoring is based on header lines.
 But the sender could be scored with -10 or -20 for the next mail...
 Any ideas how to implement this as automagically?

Sorry, couldn't resist the top-posting. :)

David Champion •

Re: Getting urlview to work with mutt on OS X Yosemite

2015-06-29 Thread David Champion
* On 29 Jun 2015, Russell Urquhart wrote: 
 I've been running mutt, for some time now, on my older powerpc based mac. I 
 recently got a new mac, that runs OS X Yosemite. I compiled mutt 1.5.23, the 
 same as i had compiled it, for my old machine and brought all my prefs over. 
 I recompiled urlview, and brought over the .urlview file as well.
 urlview tries to work, it selects the urls, but when i hit enter, it DOESN'T 
 open a safari window like it should. I think I've checked everything, can 
 anyone give any suggestions?

What does your .urlview file look like?

David Champion •

Re: Getting urlview to work with mutt on OS X Yosemite

2015-06-29 Thread David Champion
* On 29 Jun 2015, wrote: 
  My urlview file has this line:
 COMMAND open %s

What happens when you open a terminal and type:



You may need to do something in the OS layer for your preferred handler
for URLs.  open just taps into that.

David Champion •

Re: Quotes

2015-06-21 Thread David Champion
* On 20 Jun 2015, Chuck Martin wrote: 
 On Sat, Jun 20, 2015 at 08:49:36PM +1000, Erik Christiansen wrote:
  form. If it is the:
  Ian .
   Herbet ... 
  form, than that's no harder than following a straight line. I've never
  heard of that being deprecated, though I've only encountered it rarely
  in list posts.
 Actually, that can be ambiguous.  For example:
 Ian .
 Herbet ...
 Ian .
 Herbet ...

Yes, this is one of my points in the (yes, flip) example I gave.
Conventional SuperCite style gives only one level of quoting, which not
only fails to provide appropriate context to a conversation that is
several generations deep, but also *removes* such context when others
have kept it.  It destroys information that people have taken care to

But trying to keep that by using multiple layers of quoting in
SuperCite style gets unbearable in a text-only medium by making the
quote indicators themselves a majority of the content.

GNUS users have amended this situation by changing from full names,
something like this:

Ian Herbet Ian Herbet ...

to initials only:

 IZ == Ian Zimmerman
 HA == Herbet Andersen


This is a little less ridiculous but still a bit of a chore to read. But
regardless, the truth remains that how we quote email is a train that's
been accelerating for decades.  Turning it around now means fighting a
lot of inertia, and it's not going to get done on this mailing list.
That was my other point.

David Champion •

Re: How can i see the message ID of a message

2015-06-19 Thread David Champion
* On 19 Jun 2015, Michael Tatge wrote: 
 * On Fri, Jun 19, 2015 06:29PM +0200 I ( muttered:
  * On Fri, Jun 19, 2015 02:56PM +0200 ( 
   Is there a key shortcut in the index/pager to display the MessageID of 
   the current email?

Another approach.  I have 4 different versions of my index_format,
depending on what I want to see (and how much), what kind of window I'm
in, etc.  I have a key binding (Y) that toggles through the list.  You
could do the same with index_format or status_format to display only the

Here's my recipe exactly as I use it.  I've replaced the actual values
of the index_format with INDEX_YY because my index_formats are very
long and don't work in a regular mutt build, and I don't want to confuse
the issue by displaying them here.  Just substitute your preferences

macro index =y0 enter-commandset 
index_format='INDEX_Y0'enterenter-commandmacro index Y '=y1'enter
macro index =y1 enter-commandset 
index_format='INDEX_Y1'enterenter-commandmacro index Y '=y2'enter
macro index =y2 enter-commandset 
index_format='INDEX_Y2'enterenter-commandmacro index Y '=y3'enter
macro index =y3 enter-commandset 
index_format='INDEX_Y3'enterenter-commandmacro index Y '=y0'enter
push =y0

If you only wanted two toggle settings:

macro index =y0 enter-commandset 
index_format='INDEX_Y0'enterenter-commandmacro index Y '=y1'enter
macro index =y1 enter-commandset 
index_format='INDEX_Y1'enterenter-commandmacro index Y '=y0'enter
push =y0

The push =y0 is used instead of setting $index_format directly, so as
to queue up the next item in the list.

So if you used this formula in pager, you could have a toggle that puts
the message-id in the status bar, then when pressed again, removes it.
(%i represents the message-id).

David Champion •

Re: Quotes [Was: saving messages to files/permissions?]

2015-06-19 Thread David Champion
Ian Erik Mattias Chris Tom Greetings all, Not sure if this may be a
Ian Erik Mattias Chris Tom debian problem but
Ian Erik Mattias Chris Tom
Ian Erik Mattias Chris Tom I often save individual incomming emails
Ian Erik Mattias Chris Tom in seperate files in my home directory
Ian Erik Mattias Chris Tom with the mutt s command.
Ian Erik Mattias Chris Tom
Ian Erik Mattias Chris Tom In any session, the first time I save to
Ian Erik Mattias Chris Tom a particular file it goes fine.
Ian Erik Mattias Chris Tom
Ian Erik Mattias Chris Tom However if I try to save another message
Ian Erik Mattias Chris Tom to the same file, I get Permission
Ian Erik Mattias Chris Tom denied.
Ian Erik Chris I never wrote any of the above!
Ian Erik And the quoting does show that. Compare the inner Chris
Ian Erik Bannister quote with the outer: In the outer, the leftmost
Ian Erik '' ladder links your name with the last quoted sentence. In
Ian Erik your inner, the third '' ladder links your name with nothing
Ian Erik at all, i.e. no attribution to you. The whole of the central
Ian Erik block of quoted text is solidly attributed to Tom Fowle by an
Ian Erik unbroken fourth '' ladder, is it not?
Ian Now compare this correct, but horribly complex analysis (can a
Ian human really do that habitually?) with the SuperCite nonstandard
Ian [1] quoting I use.  Which is easier to read, honestly?  If it is
Ian a matter of colorizing in the mutt pager, a simple setting of
Ian quote_regexp in .muttrc fixes that.  (This should count as ob-mutt
Ian content.)

Are we really going to do this?

   David Champion • • University of Chicago

Re: Sidebar oddity

2015-06-12 Thread David Champion
 I am investigating an issue with the folder list in the sidebar.
 At some point in the recent past, my sidebar folder list changed
 INBOX   45|
 fbsd-questions  95|
 other folder 3|
 INBOX [1]   45|
 fbsd-questions  95|
 other folder 3|
 and I cannot, for the life of me, figure out where the '[1]' is
 coming from.

You appear to have a flagged message in INBOX.  Snippet of the sidebar
patch code:

+   {sidebar_format, DT_STR, R_NONE, UL SidebarFormat, UL %B%?F?  [%F]?%* 
+   /*
+   ** .pp
+   ** Format string for the sidebar. The sequences `%N', `%F' and `%S'
+   ** will be replaced by the number of new or flagged messages or the total
+   ** size of them mailbox. `%B' will be replaced with the name of the mailbox.
+   ** The `%!' sequence will be expanded to `!' if there is one flagged 
+   ** to `!!' if there are two flagged messages; and to `n!' for n flagged
+   ** messages, n2.
+   */

David Champion •

Description: PGP signature

Re: Reply to all CC's but not to From

2015-06-10 Thread David Champion
* On 10 Jun 2015, steve wrote: 
   I often receive a message like this:
   From: A
   To: Me, X, Y, Z
   CC: others
   I would like to answer like this:
   From: Me
   To: X, Y, Z
   so A and others are discarded. For the time being, I'm copy pasting
   addresses to achieve this, so it's not very convenient.
   Is this possible to do (and easy)?

You can't prescriptively discard the sender from the recipient list. The
easiest approach is to set edit_headers in your muttrc, so you can
manually fix them in the editor.

David Champion •

Re: showing mails with attachment in index

2015-06-09 Thread David Champion
* On 09 Jun 2015, John Niendorf wrote: 
 Perhaps I misread this, but how specifically are you using %?X?{%2X}%4c?
 How is this written in your .muttrc file?

My actual index_format is much more complicated, and depends on some
patches, so I can't show that very easily.  But here's an example for

This is the stock/built-in $index_format:

set index_format=%4C %Z %{%b %d} %-15.15L (%?l?%4l%4c?) %s

Here's how I would code it differently using attachments:

set index_format=%4C %Z %{%b %d} %-15.15L %?X?{%2X}%4c? %s

David Champion •

Re: showing mails with attachment in index

2015-06-09 Thread David Champion
* On 09 Jun 2015, Orm Finnendahl wrote: 
  is there an option in mutt to display some indicators in the leftmost
 column in the index for mails with attachments or is there a way to
 filter out mails without attachment? I would prefer this indicator to

Use %X in index_format to show the attachment count.  You can use it
conditionally to make it look better:

%?X?%2X  ?

I use something like this:


which shows me the attachment count if there are attachments, or the
message size otherwise.

Use ~X [number range] to search for them.

 only indicate real attachments and not simple multipart text+html
 mails containing more or less the same content. I often have to search
 my mail directories for a certain attachment and this would simplify
 and speed up this process tremendously.

See this to learn how to tell mutt what attachments you're interested

David Champion •

Re: using 'push' in a macro

2015-06-03 Thread David Champion
* On 03 Jun 2015, Cameron Simpson wrote: 
 On 31May2015 08:26, Xu Wang wrote:
 Sometimes I would like to use 'push' in a macro, but I cannot figure
 out the way to achieve this. For example, I have:
 macro attach E push
 save-entrykill-line/home/xuwang/Downloads/enteryenter xu
 What would the correct syntax be?
 push is a command line command, which is accessed by typing :. So you
 need to prefix push with : to enter the command line. So you would start
 your macro :push instead of push.

There may be a misundertanding though.  Hooks execute commands, so
to make a hook trigger keyboard events you need push.  Macros are
opposite: they do not execute commands, they execute keyboard events.
So typically a macro would not use push -- it would be redundant.  On
the surface, it seems this should do what you want:

  macro attach E 
save-entrykill-line/home/xuwang/Downloads/enteryenter xu save

There may be reasons to have a push inside a macro, but it would
be as part of some other command which the macro is executing via
enter-command (same as Cameron's : above).  So then it's a problem
of using push with that command, not of using push with macro.

David Champion •

Re: Parse message ID from 'compose' map?

2015-05-26 Thread David Champion
* On 26 May 2015, Ian Zimmerman wrote: 
 On 2015-05-26 11:59 -0400, Xu Wang wrote:
 Dan You can generate your own valid message-id, and all subsequent
 Dan systems should preserve it. Does that solve your problem?
 Dan Just make sure you follow the format and that it is unique.
 Xu Yes that would solve my problem, if I could do that from the compose
 Xu menu. I would prefer to trust mutt to do that correctly rather than
 Xu myself. But if that is the best option then I would like to look
 Xu into it.
 You don't have to do it manually.  Here's what I added just yesterday to
 my .muttrc:
 # Mutt built-in Message-ID algo is pretty lame
 my_hdr Message-ID: `mutt-message-id`
 Where the /usr/local/bin/mutt-message-id script writes a unique string
 on its output.  If you need to save it for some purpose your script can
 do that too.
 (I hope nobody takes offense /grin)

N.B. `backticked expressions` are evaluated only once, at the time the
muttrc file is read.  So you're issuing the same message-id with each
outbound e-mail.  Note your message-id above: it doesn't match the date
of your message.  It's earlier, and I think if you check your old sent
messages you'll find others with the same ID.

You would need a my_hdr in a send-hook, perhaps, to do this.

Also, I'm not offended, but what's lame about the built-in message-id
generation?  Does it need to be patched?

David Champion •

Re: Parse message ID from 'compose' map?

2015-05-26 Thread David Champion
* On 26 May 2015, Ian Zimmerman wrote: 
 I started composing, rather than when I sent it.  But you're right about
 the rest.  Oops!  Back to the drawing board :-(

I do think a send-hook will help.  I'll leave specifics to you. :)

  Also, I'm not offended, but what's lame about the built-in message-id
  generation?  Does it need to be patched?
 What happens if multiple users send a message at the same moment, and it
 is the same numbered message for each of them?  Unlikely for human users
 perhaps, but more imaginable as a byproduct of automation.

The algorithm protects against repetition up to 26 messages per second
by a single mutt process.  Two separate processes will generate
different IDs, unless you're recycling process ids more than once per

So... I wouldn't be opposed to a new algo with a real hash, but I think
collisions are already pretty unlikely.

David Champion •

Re: Filter and backtick substitution

2015-05-24 Thread David Champion
* On 24 May 2015, Ian Zimmerman wrote: 
 Are filter substitutions (example: source list-my-mailboxes|) and backtick
 substitutions (example: source `echo foo.rc`) done through a shell
 (i.e. through system(3)) or directly (i.e. through fork(2) and exec(2))?
 This would make a difference with shell metacharacters, such as if the
 foo above was *.

Both use a shell (but not using system()).

David Champion •

Re: quickly switching to an alternate for from

2015-05-24 Thread David Champion
* On 23 May 2015, Mun wrote: 
 Indeed.  I use a send-hook to accomplish the change to from.  However,
 I recently found at least one destination bounced my mail because it
 detected that  I didn't actually send the email from the domain stated
 in from:.  Here's the error within the bounce e-mail:
  Sender address rejected: This mail didn't
 really arrive via a mail server (in reply to RCPT TO command)
 Does anyone know of a way to workaround this issue?

GMail publishes SPF and DKIM records.  Any receiving site that thinks
these are a good idea can check your mail alleging to be from
and determine whether it really is sent by  Yours isn't, so
it fails the check and there's no way around this except to send via's SMTP relays.

You might try a send2-hook to set your $sendmail according to the
profile you're using (the address you're sending from).

David Champion •

Re: Some desired features, do they exist?

2015-05-11 Thread David Champion
* On 10 May 2015, Ian Zimmerman wrote: 
 I'm just getting started using mutt as my main user agent.  It has long
 been my MUA of last resort but the others suck more and more :(

Good for us!

 1. The prefix in the index indicating an address is a destination rather
 than a source seems to be hardcoded to To, Cc or Bcc depending on the
 header where it occurs.  But these take up precious screen space.  I'd
 like them to be configurable, so I can change them to some Unicode arrow
 characters or even to the empty string.

Not currently possible and I don't recall such a patch.  You can patch
this yourself, for your particular preferemce, of course.  I would
consider a more general approach, but the everlasting concern is that
we have so, so many configuration values already; do we want to add one
that is not widely wanted?  Probably worth some design discussion on  (One idea to throw out there: a single config value
which is by default To Cc Bcc; each token is a prefix mapped to a

 2. Mailman managed lists (and maybe others) insert the annoying [Foo-List]
 tags in the Subject header.  Other MUAs allow one to massage the Subject
 header (for display only) so as to hide the tag, and (again) save screen
 space.  Is this possible with mutt?  Should it be?

First apply this patch:

Then apply this patch:

These probably should go upstream.  I'll have to stop putting it off.

 Please *no* private copies of mailing list or newsgroup messages.

When using mutt, please observe to help us with
meeting your request.  Nobody knows whether you're subscribed but you. :)

David Champion •

Re: Some desired features, do they exist?

2015-05-11 Thread David Champion
* On 11 May 2015, Ian Zimmerman wrote: 
  NOTE: You MUST be subscribed to a list in order to post to it. This is
  not to make your life harder, but to reduce SPAM and/or UCE.

That's new, and not a general principle.

David Champion •

Re: Remove my alias emails from CC lists.

2015-04-08 Thread David Champion
* On 08 Apr 2015, David Haguenauer wrote: 
 Hi Brandon,
 * Brandon Amos, 2015-04-08 09:33:46 Wed:
  I forward many email accounts to a primary email account.
  When I group-reply to emails sent to my non-primary account,
  the other account is (reasonably) added to the CC list.
  Is there a way to ignore a set of emails when I group-reply
  so my aliases aren't added to the CC list?
 You can use the `alternates' command to tell Mutt about e-mail
 addresses that are yours. Once this is done, group-reply should
 properly avoid sending to your addresses.

In conjunction with alternates, you may also be interested in
reverse_name.  (I forward dozens of addresses to one mailbox, and find
this immensely useful.)

3.223. reverse_name

Type: boolean
Default: no

It may sometimes arrive that you receive mail to a certain machine, move
the messages to another machine, and reply to some the messages from
there. If this variable is set, the default From: line of the reply
messages is built using the address where you received the messages
you are replying to if that address matches your alternates. If the
variable is unset, or the address that would be used doesn't match
your alternates, the From: line will use your address on the current

Also see the alternates command.

David Champion •

Description: PGP signature

Re: attach public GPG key by default?

2015-03-18 Thread David Champion
* On 17 Mar 2015, Will Yardley wrote: 
 I've seen other mail clients (Evolution, I think) send the public key
 with every message, but seems a bit of a wste of bndwdth to me. Just put
 a link to your key (or your key-id and keyserver address) in your sig.

+1, if even that.  Don't all mail readers with basic PGP support have
the ability to query keyservers for unknown keys automatically?

David Champion •

Re: Two-phase authentification?

2015-02-18 Thread David Champion
* On 18 Feb 2015, Ben Gold wrote: 
 To encrypt the password I entered this on the commandline (OS X):
openssl aes-256-cbc -salt -out pw.txt -in cleartext.txt
(openssl then prompts your for an encryption password)
 and in my muttrc file I wrote:
set imap_pass = `openssl aes-256-cbc -salt -d -in ~/.mutt/pw.txt`
set smtp_pass = $imap_pass

Nice! If you have time to add this somewhere in the Mutt wiki, it looks
like a good approach.

David Champion •

Re: Two-phase authentication?

2015-02-12 Thread David Champion
* On 12 Feb 2015, Peter Davis wrote: 
 Aha! I'm sorry. I misinterpreted your reply. You mean I have to
 create an application-specific password to use IMAP once I've enabled
 2-factor authentication. (I don't know where I got authentification
 from ... fingers on auto-pilot, I guess.)

Yes, I think that's right.  I haven't enabled 2FA myself but that's how
it works when you have a Google Apps account using an organizational
SAML login, and you want to use IMAP. :)

David Champion •

Re: Two-phase authentification?

2015-02-12 Thread David Champion
* On 12 Feb 2015, Peter Davis wrote: 
 I think I know the answer to this, and I think it's no, but just for fun, 
 is there any way to use mutt with GMail's 2-phase authentification?

(The last time I checked) GMail doesn't support 2-factor with IMAP.  You
have to set up an application-specific password to enable 2-factor
for web and the mobile app, while still using IMAP.  This isn't
mutt-specific, it's for any IMAP client.


David Champion •

Re: Changing the Help list of keybindings?

2015-02-04 Thread David Champion
* On 03 Feb 2015, Chris Bannister wrote: 
 On Mon, Feb 02, 2015 at 03:54:57PM -0500, Patrick Shanahan wrote:
  * Joe M [02-02-15 15:42]:
   I am wondering if it is possible to change (add to) the list of
   keybindings that mutt shows in the bottom? For example, in the index
   menu, it shows me: q:Quit d:Del u:Undel s:Save m:Mail r:Reply  ?:Help
  Without programming, I don't believe, but you can see your defined keys
  and an explanation of their usage in the ?:Help menu.
 Weird, Mine shows me:
 d:Del  u:Undel  s:Save  m:Mail  r:Reply  g:Group  ?:Help
 and it's along the top of the screen, not along the bottom.
 So it seems as though some aspects are able to be changed.

As posted, it's not possible to change the items shown without patching
the code.  Chris's doesn't show q:Quit because he's unbound the Quit
function.  Mutt has a static list of things it tries to show, but that's
filtered by which of them is actually bound to a key (so that it can
show which key).

David Champion •

Re: How to prevent file disappearing before browser sees it?

2015-01-23 Thread David Champion
* On 23 Jan 2015, Jon LaBadie wrote: 
 You should be able to remove it in the script that copies it and
 starts firefox.  If more than a process has a file open and the
 file is removed, only the directory entry is deleted.  The inode
 and data blocks not freed until the last close is done.  So you
 may be able to do something like:
   start firefox in background
   pause a second or two
   remove the copy
   exit (or issue a wait for firefox to complete)

The trouble here is usually that /usr/bin/firefox is, itself, a wrapper.
It typically passes a message to firefox (perhaps also launching firefox
as a background process first) and then exits, so the real firefox might
not actually read the file until after /usr/bin/firefox exits.  This is
how things used to be anyway -- maybe it's changed but I wouldn't expect
so since this approach (while a bit messier) is more responsive to the
user POV.

David Champion •

Re: How to prevent file disappearing before browser sees it?

2015-01-22 Thread David Champion
* On 22 Jan 2015, Chris Green wrote: 
 The trouble is I'm frequently seeing the temporary HTML file saved by
 mutt disappearing before firefox gets to see it, why does this happen
 sometimes (almost all the time now)?  It used to work OK.  I have just
 moved to a faster computer, would this affect it?

Yes, it's a race condition.  Mutt removes the file when it regains
control of your terminal. /usr/bin/firefox is just a launcher - it will
detach and background the real firefox executable and come back to
mutt.  If Firefox starts up slower than mutt finishes, the file will be

   text/html; /usr/bin/firefox %s
   text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html

To solve this you need a wrapper script around Firefox.  The wrapper
will take the file content from $1 and save it somehow for Firefox, so
that mutt may delete the original.

There are various techniques for this.  I personally like the approach
of hard-linking the temp file so that it doesn't use more storage.
Something like this:

ln $1 $COPY
/usr/bin/firefox $COPY 

But no matter what option you choose, your wrapper will then be
responsible for removing the saved copy!  The only difference to not
having a wrapper at all is that now it doesn't matter how long you wait
to remove the extra copy, whereas with no wrapper the time that you wait
is the time that it takes to get mutt back.  So something like this
should generally work.  You can append it to the above.

# background a subshell to clean up later
sleep 120
rm $COPY

 While I'm about it how do the two text/html entries in .mailcap work
 so that lynx is used by default but 'v' takes me to firefox?

I would think you've got it already.  Mutt will only use a copiousoutput
entry for auto_view, and the first appropriate match otherwise.  There
are a number of ways to control what appropriate means though; see

Are you seeing something different?

David Champion •

Re: How to prevent file disappearing before browser sees it?

2015-01-22 Thread David Champion
* On 23 Jan 2015, Gary Johnson wrote: 
  ln $1 $COPY
  /usr/bin/firefox $COPY 
 I'm surprised that linking works because it used to be that mutt
 overwrote the temporary file with 0s before deleting it.  I thought
 it still did, but I don't know for sure.

You're right, it does overwrite (at least for most cases).  I don't
think this was always true, but it's been a very long time since I used
mailcap this way, so I'm pretty distant.

So a hard link won't work.

David Champion •

Re: Alternative pager?

2015-01-11 Thread David Champion
* On 11 Jan 2015, Peter Davis wrote: 
 I'm trying to use emacs as an alternative pager for mutt. Specifically, I'd 
 like to use the gnus Article mode to display articles. I've
 tried just setting emacsclient as the pager, but I have some questions:
 1) What exactly is passed to the pager? From my experiments, it appears the 
 message is pre-formatted before passing it to the pager. That
 prevents me from latting the pager format it, so I'd like to avoid this. I 
 tried moving my .mailcap file, but I'm still seeing already
 formatted messages. Is there any way to get mutt to send the whole raw 
 message to the pager?

Yes and no.  In mutt, paging always means to format the message for
some kind of text viewer.  If you want to pass the full rfc822 message
data to some external program, you really want piping (to mutt's world
view).  So the right approach here is to write a macro that pipes to
your external pager, and bind that to the keystrokes that you associate
mentally with the pager.  Be sure to unset pipe_decode if you really
want the external pager to receive the unadulterated message data.

This doesn't interfere with other uses of pipe-entry or your | key --
you're just using the same internal mechanism to view the content in a
particular way.

(I don't know anything about gnus or article-mode, so can't speak to
how well this works in specifics.)

 2) Does mutt use the same temp filename for passing to the pager that it uses 
 for passing to the editor? I'd like to be able to distinguish
 in emacs, so that pager output gets displayed in gnus Article mode, and 
 replies, etc. that I'm editing get opened in Mail mode.

It uses the same temp file template for generating random temp file
names -- not sure whether that's what you mean.  Can you just invoke
emacs or an emacs shell wrapper with different options?

 3) Is there some way to keep mutt active while a message is being displayed 
 by a pager? Ultimately, I'd like to have mutt open in emacs in
 one window, and message contents displayed in Article mode in another window. 
 Then I'd like to be able to use keystrokes in the mutt window
 to move to different messages, mailboxes, etc.

You would need a shell script that captures the temporary file content
(or copies it blindly, or hard-links to it) and feeds it to a launch
of your viewer into the background.  This technique generally has been
discussed on the list but offhand I'm not sure what search terms would
find the discussions.  Another old-timer might.

The general idea is that the shell script that mutt is aware of must
terminate for it to move on with things, and mutt will delete the temp
file.  So you capture the file content through some means, eliminate
your dependency on the filename itself, and launch a background viewer
before letting the launcher script exit.

 Is there some more detailed doc. about defining alternate pagers somewhere? 
 All I see in the manual is that you can specify an external pager.

None that I recall, sorry.

David Champion •

Re: How do I kill these posts?

2014-12-15 Thread David Champion
* On 15 Dec 2014, John Long wrote: 
 On Mon, Dec 15, 2014 at 06:29:43PM +0100, Francesco Ariis wrote:
  ~f does work on my machine  (Tested with limit~f /and/
  with 'score').
  The From header (yahoo group) looks similar to yours:
 It's not similar enough:
  From: [abcusers]
   From: phoney bologna [bademails]
 You have a real email id in the sender portion. The example I am using has a
 non-RFC format (AFAIK) email address with 

Francesco is right, this should work. ~f a@b will match a@b whether it's
the actual address or inside the name portion.

Here's an example from my mailbox:
From: First Last [ListName]

So ~e won't work because Sender: does not have your
target pattern, but ~f should.  If it does not there's
something else wrong.

Your example is a valid RFC From: line, by the way.  All the goofy stuff
is inside double quotes, and the proper email address is inside angle
brackets.  It's annoying, and it breaks crypto, but strictly in terms of
address format it's legit.

 firstname lastname blah 
 I think it would normally have to be 
 firstname lastname
 firstname lastname
 I suspect this nonconformance is part of the problem and I don't know how to
 get Mutt to scan the header since it could be not a valid header at all.
 ASCII ribbon campaign ( ) Powered by Lemote Fuloong
  against HTML e-mail   X  Loongson MIPS and OpenBSD
and proprietary/ \
  attachments /   \  Code Blue or Go Home!
  Encrypted email preferred  PGP Key 2048R/DA65BC04 

David Champion •

Re: Stupid regexp tricks

2014-12-10 Thread David Champion
* On 10 Dec 2014, John Long wrote: 
 On Tue, Dec 09, 2014 at 05:08:22PM -0600, David Champion wrote:
  * On 09 Dec 2014, John Long wrote: 
   The messages seem to all have message-ids in the form
  You'll need to be much more specific if you want help writing a matching
  regex.  Is something a semantic variable or literal?  What does
  bunchofchars look like?
 What difference does it make. I want to score on where:
 m. is a literal
 anything is anything
 and .com is a literal

OK, I see what I'm missing now: it's the m vs mx.  You're right,
getting the regex right for this one will be enough -- for now.  But
it turns out that more than one site uses m.*.com hostnames, so
you'll be back in this position some time.  I think that when writing
mail-filtering rules, it's best to be as exact as you can, not as
ambiguous as you can get away with.

David Champion •

Re: Stupid regexp tricks

2014-12-09 Thread David Champion
* On 09 Dec 2014, John Long wrote: 
 On Tue, Dec 09, 2014 at 02:54:59AM -0500, Jon LaBadie wrote:
  On Tue, Dec 09, 2014 at 07:15:13AM +, John Long wrote:
  In your RE expression you have two literal periods (m. and
  .com) plus one meta-period (.*).  One of the literal periods
  is escaped (\.com) the other is not.
  Both literal periods should be the same (escaped or not escaped)
  and the meta-period should be the opposite.
 Thanks. If I understood what you said and did this right then that did match
 the spammers but is still killing google mail.

I'm not sure what exactly you need to match - your example in the first
mail looks like a paraphrasing, so not sure what parts are variable.
However if your spammer's message-ids are actually showing an RFC822
address format, you might try:

~i '\S+\s+\S+@\S+'

I'm assuming your regex library supports \s, \S. PCRE does. Otherwise
you could try

~i '[^ ]+ +[^ ]+@[^ ]+'

Also note the spam command, which can be used to classify spam.  It's
normally for matching spam scores from spam filters, but you could use
it instead to add these messages as high-scoring spam.  This allows you
to treat all spam in aggregate, distinctly from other scoring.

David Champion •

Re: Stupid regexp tricks

2014-12-09 Thread David Champion
* On 09 Dec 2014, John Long wrote: 
 The messages seem to all have message-ids in the form

You'll need to be much more specific if you want help writing a matching
regex.  Is something a semantic variable or literal?  What does
bunchofchars look like?

From all I can gather it sounds like they're generating totally legit
and normalized message-ids.  Any message-id that someone out here
provides you will match false positives as well.  That's why we need
specific examples to help.

 They also have email ids in the form
 Idiot Spammer

By email id do you mean address?  Again, that looks completely normal.
Matching it will require examples.

  However if your spammer's message-ids are actually showing an RFC822
  address format, you might try:
  ~i '\S+\s+\S+@\S+'
  I'm assuming your regex library supports \s, \S. PCRE does. Otherwise
  you could try
  ~i '[^ ]+ +[^ ]+@[^ ]+'
 You lost me on these two regexps. What's going on here?

That matches the following:


This is what an email address should look like, but a message ID should
have only the text@text part.  (It should not have leading text +

David Champion •

Re: Problem with password

2014-11-28 Thread David Champion
* On 28 Nov 2014, ant wrote: 
 Rainer Sokoll wrote:
  I have a weird problem: I have an $ sign in my imap account=E2=80=99s =
  password, lets say word1$word2.
  Whatever I put in imap_pass - it does not work. With debugging at level =
  5, I see:
  set imap_pass =3D word1$word2 - word1 #I understand this
  set imap_pass =3D word1\$word2 - word1
  set imap_pass =3D word1\$word2=E2=80=9C - word1
  set imap_pass =3D 'word1\$word2=E2=80=98 - word1\\ #Really!
  set imap_pass =3D 'word1$word2=E2=80=98 - word1
   without seeing the exact file i'm not going to be
 able to interpret your strings above.  you may have
 left out something important and i can't make sense
 of things like:
  set imap_pass =3D 'word1\$word2=E2=80=98 - word1\\ #Really!
   i.e. i see no closing quote character and that may be
 affecting other stuff later...

Rainer's mail contains quoted-printable-encoded unicode smart quotes,
which are usually not very smart.  Ant's mutt, because it doesn't
understand unicode, is leaving them encoded as =E2=80=98 and such.

Rainer, this doesn't happen for me.  This test:

cat muttrc.test EOF
set imap_pass = 'abc$xyz'
push :set ?imap_passenter
mutt -D -F muttrc.test | egrep imap_pass=

... does what you'd expect: prints imap_pass=abc$xyz' on my screen.

I haven't tested against an IMAP server, but this shows what I want to see:

:set ?imap_pass

Does your muttrc contain actual unicode smart quotes or are those just
an artifact of pasting into Apple Mail?  They could cause unforeseen
results in mutt's parser.

David Champion •

Re: again on mutt sasl problem with isp

2014-11-15 Thread David Champion
* On 15 Nov 2014, M. Fioretti wrote: 
 almost one year ago, I had a problem with mutt, so I asked for help
 here, describing it in detail, see (1) below. It received one answer
 (2), but:
 I don't know why, honestly, I NEVER saw it last year. I have no memory
 of it at least, sorry!
 Besides, for many reasons not relevant, the need to do what I had
 described in my message vanished a couple of days later and never
 came back until this week. So only today I have seen message (2)
 below, and immediately tried what Mick suggested. No luck. If I add
 port 587 I only get a different error message, and nothing more
 because that mutt was not compiled with debug support and I can't
 change it on that machine:
 DEBUG was not defined during compilation.  Ignored.
 gnutls_handshake: An unexpected TLS packet was received.
 so, sorry again for not realizing for one year I had left this
 thread hanging and... any more suggestion on how to fix this, or
 at least understand exactly what is happening?

Generally your smtp_url should be one of:

smtp://server/ For unauthenticated SMTP on the standard port (25)
smtp://server:587/ For unauthenticated SMTP on the submission port (587)
smtp://user@server:587/For authenticated SMTP on the submission port
smtps://user@server/   For authenticated SMTP on the secure port (465)

STARTTLS is the SMTP command (it exists in other protocols too) to
negotiate a switch to secure communication over an initially insecure
line.  Mutt will attempt STARTTLS to secure credentials when using
smtp:// URLs.  Neither port 25 nor port 587 is required to support
STARTTLS, but 587 usually does and port 25 often does.  Port 465 is used
for smtps, which means there is no STARTTLS negotiation but a TLS
handshake is performed right off the bat at connection time.

Recently a user on this list discovered that his ISP uses port 80 for
outbound SMTP.  That's quite nutty but it does occur.

user is tricky.  At smaller providers with only one user namespace,
it's usually just an account name -- such as dgc for me.  At providers
who serve more than one namespace (domain, virtual host) through the
same interface, it's more likely to be a fully qualified email address.
So your SMTP URL could look like this:


... which looks wrong, but is actually quite usable.

For debugging, don't set smtp_pass at first.  This complicates
the diagnostic process.  Just let mutt prompt you for a password
when needed.  If it doesn't prompt, it's not even encountering
authentication; this is useful information.

If you're not in the mood for deeper debugging (connecting to canonical
SMTP ports with telnet or netcat or openssl s_client and issuing SMTP
commands manually) then try each of the four patterns above, in order,
and note whether and how they fail due to authentication requirements.
Only set smtp_pass after you have everything working otherwise.

As always, compiling mutt with DEBUG and gathering a .muttdebug0 file
will help greatly.

David Champion •

Re: trying repository mutt again SOLVED, maybe...

2014-11-09 Thread David Champion
* On 09 Nov 2014, DaleKelly wrote: 
 On 11/09/2014 07:42 PM, DaleKelly wrote:
 got it to work without SSL/TLS in my smtp_url
 the caveats might have been
 installing everyone related before ubuntu version
 adding  around the string for smtp_url
 no SSL/TSL, and using port 80 instead of 25

I would not advise authenticating without SSL (encryption). Your login
credentials have been exposed in cleartext.

Port 465 is TLS/SSL with encryption right off the bat, no negotation.
Port 587 is usually negotiated TLS (STARTTLS), but this can be offered
over port 25.

There is no reasonable explanation for SMTP working over port 80.
It does appear that your server provides SMTP on port 80, so... ok
then.  But this is clearly a wacky thing specific to your provider.
Virtually nobody does this.  It's not normal.  I guess they do it to
allow customers to relay mail through firewalls that allow port 80
(HTTP) but block SMTP (or think they do).

That said, it's clear that they also honor port 465:
[1220/1]$ openssl s_client -connect -quiet
depth=2 C = US, O = Starfield Technologies, Inc., OU = Starfield Class 2 
Certification Authority
verify return:1
depth=1 C = US, ST = Arizona, L = Scottsdale, O = Starfield Technologies, 
Inc., OU =, CN = Starfield 
Secure Certification Authority, serialNumber = 10688435
verify return:1  
depth=0 C = US, ST = AZ, L = Scottsdale, O = Special Domain Services, Inc., 
CN =
verify return:1
220  ESMTP
221  closing connection

And port 25:
[1224/130]$ telnet 25
Connected to
Escape character is '^]'.
220  ESMTP
500 command unrecognized
221  closing connection

Since port 25 doesn't negotiate TLS, you might continue trying to
get 465 to work.  I think you're having problems with the SASL
authentication here, not with the connectivity itself.  Debug output
might help us figure it out.

David Champion •

Re: trying repository mutt again SOLVED, maybe...

2014-11-09 Thread David Champion
* On 09 Nov 2014, DaleKelly wrote: 
 On 11/09/2014 09:37 PM, David Champion wrote:
 Debug output
 might help us figure it out.
 how can I do this?

You need +DEBUG enabled:
mutt -v | grep DEBUG

This command:
mutt -d4 other options

creates ~/.muttdebug0.  If you run again, .muttdebug0 is renamed to
.muttdebug1, etc.  So try against port 465, with your smtp_url set
to include your email address as a user name, and show us the contents
of .muttdebug0 (or put it on, etc).

Your password will be scratched out of the debug file but other personal
details may appear -- nothing you haven't shared already though, I

David Champion •

Re: SMTP one more time, with all the details

2014-11-07 Thread David Champion
* On 07 Nov 2014, DaleKelly wrote: 
 I get no prompt for username and password

No, you wouldn't because nothing in your configuration indicates
definitively that you want AUTH-SMTP.

 I added only one change to the sample.muttrc
 and saved it to ~/.muttrc
 set smtp_url=smtps://
 I don't get a prompt for username or password
 when I add
 set stmp_user=

You need EITHER:
  set smtp_url=smtps://
  set smtp_user=username

I believe you'll be prompted for a password then.

David Champion •

Re: How is mutt with multi-mega-byte mboxes?

2014-09-19 Thread David Champion
* On 19 Sep 2014, Chris Bannister wrote: 
 On Thu, Sep 18, 2014 at 04:19:12PM -0400, Mark Filipak wrote:
  How is mutt with multi-mega-byte mboxes? Have you found that having tens
  of thousands of messages in a single box is dangerous?
 No, just really slow!

I don't find it slow at all, once the mailbox is loaded.  Is that what
you mean or is there an ongoing performance problem?

David Champion •

Re: Format flowed equals no space in depth 1

2014-09-19 Thread David Champion
* On 17 Sep 2014, Ed Blackman wrote: 
 I'm not one of the developers of Mutt, nor am I some representative of all
 of Mutt's users.  However, it seems to me that the devs and at least most of
 the users like things as they are, such that you need to know a good bit
 about email to use Mutt.  Otherwise they would be developing changes[1] or
 switching to another email client.
 That being the case, I don't know that passionate rants on the mailing list
 are going to do much good.  The people on this list have self-selected to be
 users of a email tool that requires you to know a bit about email internals
 to use it, and have further self-selected to join a list to converse and
 swap tips about that editor with other like-minded people.  Making things
 easier for non-geeks, when non-geeks are not likely to want to use mutt for
 many other reasons other than difficulties writing flowed or HTML text,
 doesn't seem to be a priority.

We're not closed to further development on mutt, but it takes times that
for the most part we don't have.  Mutt probably is not feature-complete,
but it's close, and we're evidently well into the long tail of
diminishing returns.  Personally, mutt annoys me in very few ways, and
I'm pretty tolerant of those that remain.  Addressing these relatively
minor issues rarely claims my time.  If it tempts yours, patches are

I know what the response to that will be: but the maintainers never
respond to patches!  You're right.  What's more difficult than
getting patches is finding consensus on the right reaction when the
problem being addressed is one that we (maintainers) don't experience
personally.  I don't want to transmogrify this thread into another how
do we fix mutt development thread -- I don't know that everyone of
note is paying attention.  But I do want to make the comment that for
me, it's not that I like things as they are so much as that I don't
know what the right solution to this problem is, and I'm afraid I don't
have time right now for reading the RFC, trying to sketch it out, and
evaluating the various patches' solutions, etc.  Perhaps I'm a bad
maintainer, I'll accept that, but there it is.  So what's really useful
to maintainers (I think) is some solid discussion of the solutions
proposed, and a community recommendation.

I haven't read this thread through completely because it's a bit off
course, but I've picked up on two implemented solutions on this topic:
a VVV patch and a Gary Johnson patch.  Can someone discuss how they
differ, whether they conflict, whether either causes problems, whether
they can or should be merged, etc?  Do they solve the problem raised in
this thread, work around it, are they tangential?

We need this kind of help to move ahead on something.

David Champion •

Description: PGP signature

Re: How is mutt with multi-mega-byte mboxes?

2014-09-18 Thread David Champion
* On 18 Sep 2014, Mark Filipak wrote: 
 How is mutt with multi-mega-byte mboxes? Have you found that having tens
 of thousands of messages in a single box is dangerous?
 Thank You.

[473/130]$ du -sh /var/mail/dgc

I only have ~25k messages in my inbox right now.  I used to keep 50-60k,
but now I turn a new leaf every spring.

David Champion •

Re: How is mutt with multi-mega-byte mboxes?

2014-09-18 Thread David Champion
* On 18 Sep 2014, Mark Filipak wrote: 
 On 2014/9/18 4:27 PM, David Champion wrote:
  * On 18 Sep 2014, Mark Filipak wrote: 
  How is mutt with multi-mega-byte mboxes? Have you found that having tens
  of thousands of messages in a single box is dangerous?
  Thank You.
  [473/130]$ du -sh /var/mail/dgc
  I only have ~25k messages in my inbox right now.  I used to keep 50-60k,
  but now I turn a new leaf every spring.
 And you're using mbox? Not maildir?

Correct.  I've used mutt on mboxes even larger too -- maybe 200-300k
messages, a gigabyte or two in size.  Not often; this is usually a
temporary arrangement, like when I want to look at a whole year's worth
of mail at once.  But 25k messages is daily routine.  I've used mutt
for 15 or 16 years and I don't recall ever losing mail due to software

Memory usage for mutt on my inbox:
[477/148]$ ps -eorss,vsz,comm | grep mutt
41784  44280 mutt

So ~43mb virtual, mostly paged in, for 466M of mail in 25k messages.

David Champion •

Re: SMTP Authentication fails with 1.5.23 on Verizon

2014-09-17 Thread David Champion

 is_from(): parsing: Wed Apr  3 22:54:45 2013

 is_from(): got return path: 

 is_from(): month=3, day=3, hr=22, min=54, sec=45, yr=113. 

 parse_parameters: `boundary=ZmUaFz6apKcXQszQ'   

 parse_parameter: `boundary' = `ZmUaFz6apKcXQszQ'  

 read_rfc822_header(): no date found, using received time from msg separator   


 is_from(): parsing: Sat Sep 29 15:38:58 2012
 is_from(): got return path: 

 is_from(): month=8, day=29, hr=15, min=38, sec=58, yr=112.

 parse_parameters: `charset=us-ascii'  

 parse_parameter: `charset' = `us-ascii'   

 read_rfc822_header(): no date found, using received time from msg separator   


 is_from(): parsing: Tue Apr  8 16:41:29 2014

 is_from(): got return path: 

 is_from(): month=3, day=8, hr=16, min=41, sec=29, yr=114. 

 parse_parameters: `charset=us-ascii'  

 parse_parameter: `charset' = `us-ascii'   

 read_rfc822_header(): no date found, using received time from msg separator   


 is_from(): parsing: Sat Sep 13 08:06:55 2014

 is_from(): got return path: 

 is_from(): month=8, day=13, hr=8, min=6, sec=55, yr=114.  

 parse_parameters: `charset=us-ascii'  

 parse_parameter: `charset' = `us-ascii'   


 is_from(): parsing: Wed Sep 17 08:11:00 2014

 is_from(): got return path: 
 is_from(): month=8, day=17, hr=8, min=11, sec=0, yr=114.  

 parse_parameters: `charset=us-ascii'  

 parse_parameter: `charset' = `us-ascii'   

 read_rfc822_header(): no date found, using received time from msg separator   

 mutt_index_menu[605]: Got op 145

David Champion •

Re: Display of threads, order in question

2014-05-23 Thread David Champion
* On 23 May 2014, Guy Gold wrote: 
 That, pretty much, is what I'm trying to get to, only reversed,
 with the newest message, on the bottom. I wonder if other parts
 of my .muttrc breaking it. 

For threading, you need sort=threads.  Sort_aux is the only variable.

Reverse- and last- are modulation prefixes.  Your base sort param is
either date or date-received.  (I use date-received because I don't
trust people's sending MUAs to set an accurate date, and messages often
wind up hours or days behind in my inbox.)

With sort=threads, sort_aux controls the order of threads.  Order of
messages within threads cannot be altered.

Prepend reverse- to invert the thread sort order, making newer threads
appear earlier instead of later.  Newer normally means with a more
recent anchor/base message.

Prepend last- to make newer mean more recently updated.

Sort_aux=last-date-received will put the threads in chronological order,
with the most recently updated threads (i.e. those with the newest
messages in the thread) later in the sort.

David Champion •

Re: Display of threads, order in question

2014-05-23 Thread David Champion
* On 23 May 2014, Guy Gold wrote: 
 That is all true. 
 But, I cannot explain some of the behaviour I'm getting. 
 Notice the two threads here:
 The first one, is sorted very well according to what I expect. 
 The second one has some flaws with regards to the sort. 
 It looks like, once authors of messages write to others (rather
 than replying one after another, chronologically), that's when the
 mix-up happens. 
  Thu, May 22, 2014 at 05:19:42PM EDT  To mutt-users@mutt.o Display of 
 threads, order in question
  Thu, May 22, 2014 at 07:22:07PM EDT  Cameron Simpson  └─
  Thu, May 22, 2014 at 08:54:23PM EDT  To mutt-users@mutt.o   └─
  Thu, May 22, 2014 at 09:37:48PM EDT  Cameron Simpson  └─
  Fri, May 23, 2014 at 08:19:11AM EDT  To mutt-users@mutt.o   └─
  Fri, May 23, 2014 at 11:22:54AM EDT  David Champion   └─
  Sat, May 17, 2014 at 02:51:40PM EDT  Kevin J. McCarthy┬─Re: Writing a 
 wrapper for the editor: mutt aborts in-between
  Sun, May 18, 2014 at 04:14:23AM EDT  Chris Green  │ └─
  Sat, May 17, 2014 at 05:04:29PM EDT  Mike Glover  └─Re: Writing a 
 wrapper for the editor: mutt aborts in-between
  Sat, May 17, 2014 at 05:59:53PM EDT  Karl Voit  └─
  Sat, May 17, 2014 at 09:51:00PM EDT  Cameron Simpson  ├─
  Sun, May 18, 2014 at 02:58:31AM EDT  Karl Voit│ └─
  Sat, May 17, 2014 at 07:02:19PM EDT  Gary Johnson └─

These both look correct, to me, for
sort_aux=reverse-last-date[-received].  Whether sort=threads or
sort=reverse-threads is irrelevant in this case, since you're showing
only one thread.

What looks wrong to you?

David Champion •

Re: Strange repeated Exit Mutt ([yes]/no): ...

2014-05-15 Thread David Champion
* On 15 May 2014, Saptarshi Guha wrote: 
 Every 5-10 seconds i get the prompt Exit Mutt ([yes]/no): ...
 I have no idea why. I'm not pressing any key by accident  - i can come
 back after 5 mins and see this.

It sounds like some process is delivering a SIGINT to mutt.

David Champion •

Re: disabling shell-escape

2014-05-11 Thread David Champion
You don't need to jail postfix for your situation.  Build Mutt with smtp
support, and set smtp_server to localhost.  Your SMTP processes will run
in the global context, and mutt will only need a socket to that.

* On 11 May 2014, Shawn Zaidermann wrote: 
 I understand. There is definitely always that possibility that users will
 get a shell. However, can SELinux help in this case? Perhaps I can confined
 the users with basic access, one that does not allow a user to run any
 execution from their home or /tmp. We have a debian deployment but can
 migrate our users to CentOS without a problem. I realized running a chroot
 does not help much since the system only runs postfix and mutt. If I jail
 mutt, then I have to jail postfix and if I do that, I defeat the purpose of
 the jail entirely.
 On 05/10/2014 05:01 PM, Derek Martin wrote:
 On Fri, May 09, 2014 at 03:14:03PM -0700, Shawn Zaidermann wrote:
 Is there a way to completely disable the shell-escape feature?
 In short, no.  If you're trying to prevent mutt users from gaining any
 access to the shell, you also have to concern yourself with things
my_var=`run arbitrary shell command here`
 in the user's .muttrc.  The bottom line is Mutt was not designed for
 restricted access... but then neither was any other e-mail client
 But also, as the author of rssh, I can tell you that this turns out to
 be an extremely hard problem (though exactly how hard is somewhat OS
 dependent), and is probably not worth your time.  The best you can
 hope for is to restrict unsophisticated users; if you have savvy users
 on your system and they REALLY want to get shell access, they probably
 You have to trust your users, and if you can't you've basically
 already lost the battle.  If you do, then there's no point in
 confining them to your idea of what's safe.

David Champion •

Re: disabling shell-escape

2014-05-09 Thread David Champion
* On 09 May 2014, Shawn Zaidermann wrote: 
 Is there a way to completely disable the shell-escape feature?

You can unbind the key (or bind it to no-op), but the user can still
rebind it unless you also remove the enter-command binding (preventing
them from entering a bind command).  Also ensure that they cannot source
any muttrc files (check bindings for source macros), and cannot edit any
muttrc files that the program is sourcing.  Your use case might help to
answer more exactly.

To avoid this complexity, source code changes are the only option.
There is no irreversible restricted mode that does all this

David Champion •

Re: Using maildir

2014-04-29 Thread David Champion
* On 28 Apr 2014, David Woodfall wrote: 
 I've just set up dovecot/procmail on a debian VPS and when using mutt
 with maildir, as I navigate around, I see the new/ cur/ tmp/ folders
 and inside the actual file names of the mail.

This should just work.  Maildir is tested first, before other mailbox
types, and it only checks whether there is a cur/ subdirectory to the
mailbox location.

Two questions: 1. are you sure that the permissions are correct (i.e.
that your user can read it, was not set up by root, etc)?  Clearly you
can read the mailbox directory, but what about cur?  2. How are you
referring to the mailbox?

You might running in debug mode: mutt -d3 -f /path/to/mailbox

David Champion •

Re: Using maildir

2014-04-29 Thread David Champion
* On 29 Apr 2014, David Woodfall wrote: 
 Significant parts from .muttrc:
 set mbox_type=maildir
 set folder=$HOME/mail
 set mbox=$HOME/mail
 set spoolfile=$HOME/mail

Your $folder may be the source of the problem.  My hypothesis: if you
change that (to anything else, pretty much) and open up ~/mail directly,
you'll see it as intended.  Since $folder is the directory in which
mailboxes are expected to be located -- i.e. there should be maildirs
*within* ~/mail -- mutt is searching it for mailboxes and unable to
treat it as a mailbox itself.

David Champion •

Re: Folder redirection

2014-03-07 Thread David Champion
* On 07 Mar 2014, Karolis Pabijanskas wrote: 
 Hi everyone,
 Does mutt support folder redirection?
 For example, I may have a folder called WORK in my sidebar (I'm using
 mutt 1.5.21 patched with sidebar patch), and when I enter it, I would like it
 to redirect me to account2/INBOX folder.

In a standard mutt build, that could only be accomplished with local
folders and symbolic links (or hard links, depending on the folder
type).  You would also need support in the sidebar patch either way,
if you want redirection (as opposed to aliasing).

I don't know whether the sidebar patch supports that, but I suspect not.

It's an interesting feature idea, but not sure how useful it is without
the sidebar.

David Champion •

Re: create multipart/alternative

2014-02-27 Thread David Champion
* On 27 Feb 2014, Sebastian Tramp wrote: 
 Hi mutt users,
 is it possible to create mulitpart/alternative message parts in the compose

This patch adds what you need:

The group-alternatives binding for the componse menu (where you press
's' to send) combines selected attachments into a multipart/alternative
group.  The move-up and move-down bindings then allow you to change
their order.

 There exists some post send filter to achieve this but they do not work in
 combination with encryption (and I do not have the sent copy in my archive)
 Another idea: Is it possible to put the complete message to a tool from the
 compose screen (which can parse and change it completely) and re-read it
 afterwards? I thinks is would allow a lot of other feature too.

I don't know offhand how you would generate the content.  MIME is not
that hard to write if you know the structure, but I don't know a tool
off the top of my head that will generate it for you.  However, if you
have one: a trick I have used for things of this flavor is to:

* postpone the message
* open your postponed folder as a regular mutt mailbox
* find the postponed message
* edit the raw mesage
* save
* sync
* go back to your regular mutt session
* recall the postponed message
* finish and send

(It's not as hard as it looks on paper.  Usually I do this when I find
I've written a trmendously long message and I want to split it into
two messages.  In that case, after editing the message I exit without
syncing in order to preserve both copies of the original, then I recall
and send each copy.)

David Champion •

Re: search in sent

2014-02-27 Thread David Champion
* On 27 Feb 2014, vwf wrote: 
 When being in the 'sent'-folder, '/' is bound to search, as documented
 in '?'. When I hit '/', a search-line appears but it nevers return what
 I search for: 
 Search for: Harry  -  Not found.
 but when scrolling down, Harry is on line/number 128

This is a long shot, but do you have reverse_alias set, and do you have
an alias for Harry?  Possibly you see Harry because it's in an alias,
but is not actually in the message as part of the To: address.

David Champion •

Re: pin flagged messages

2014-02-27 Thread David Champion
* On 27 Feb 2014, Mart Lubbers wrote: 
 I've looked in the overwhelming and detailed documentation but couldn't
 find an answer. I was wondering if it was possible to pin flagged emails
 on top of the mailbox. So that mutt displays my email by date(or any
 other sorting method I initialized) but always keeps my flagged as
 important mails(by ^F) pinned to the top of the screen.

You would need to use scoring for this, and to sort by score.

David Champion •

Re: auto reply to html-mails

2014-01-20 Thread David Champion
 and such, whose mailboxes are
unattended and which will autoreply to me if I autoreply to them.

David Champion •

Re: few questions

2013-12-01 Thread David Champion
* On 01 Dec 2013, Dave Dodge wrote: 
 On Fri, Nov 29, 2013 at 11:10:11AM -0600, David Champion wrote:
  * On 29 Nov 2013, Martin Vegter wrote: 
   On 2013-11-29 12:40, LEVAI Daniel wrote:
   On p, nov 29, 2013 at 12:24:33 +0100, Martin Vegter wrote:
   when in run mutt in terminal emulator, it reacts to the scroll wheel of 
   mouse. Is it possible to disable mouse entirely? There is no mention of 
   word mouse in man mutt.
   Well, not sure if this is Mutt specific, but terminal emulator specific.
   If you're on a tty, perhaps gpm is running? If you're on a pseudo
   terminal, just disable the mouse input in your terminal emulator (xterm,
   urxvt etc... see their corresponding manuals).
   I had similar problem with midnight commander and I solved it by using mc
   --nomouse. So I was hoping for similar command line option for mutt.
  Midnight Commander has support for mouse input events, so they can be
  disabled.  Mutt does not read mouse events.  What you see is probably
  your terminal emulator's scrollback buffer (the scrollbar).
 If it's the same thing that happens to me, it's not the scrollback
 buffer.  Mutt actually reacts to the scroll wheel, intentionally or

Interesting - admittedly I don't use an X desktop.  I just scanned
mutt's source code for mouse, click, and button events.  Maybe these
events translate into something else at a lower layer of the window

In any case I don't think mutt is specifically responding to the mouse;
it's responding to a signal that a mouse generate for some unclear
reason, but that could be generated in another way.

David Champion •

Re: few questions

2013-11-29 Thread David Champion
* On 29 Nov 2013, Martin Vegter wrote: 
 On 2013-11-29 12:40, LEVAI Daniel wrote:
 On p, nov 29, 2013 at 12:24:33 +0100, Martin Vegter wrote:
 could somebody please advise on the following issues?
 when in run mutt in terminal emulator, it reacts to the scroll wheel of my
 mouse. Is it possible to disable mouse entirely? There is no mention of the
 word mouse in man mutt.
 Well, not sure if this is Mutt specific, but terminal emulator specific.
 If you're on a tty, perhaps gpm is running? If you're on a pseudo
 terminal, just disable the mouse input in your terminal emulator (xterm,
 urxvt etc... see their corresponding manuals).
 I had similar problem with midnight commander and I solved it by using mc
 --nomouse. So I was hoping for similar command line option for mutt.

Midnight Commander has support for mouse input events, so they can be
disabled.  Mutt does not read mouse events.  What you see is probably
your terminal emulator's scrollback buffer (the scrollbar).  Mutt has
no influence on this -- you need to disable it in your term emulator.

David Champion •

Re: unbind (all) key bindings

2013-11-27 Thread David Champion
* On 25 Nov 2013, Martin Vegter wrote: 
 I would like to unbind all key bindings, so that I can explicitly define
 only those, that I am actually going to use.
 While googling, I have discovered that I am not the only one having this
 problem. There even seems to be a patch called unbind:
 but only for version 1.4 and 1.5.1. I am using mutt version
 1.5.21-6.2+deb7u1, so I am not sure if that would work.

Hi Martin -

I think the other responses on this thread are appropriate, and you
should consider whether you really want to unbind everything.  That
said, as the author of the unbind patch that you cited: no, it won't
work with a current mutt.  It's very out of date.  I took some time to
update and improve the patch and you'll find the result here:

(For anyone familiar with the unbind saga and its intricacies, this
patch finally does a real unbind, not a bind to noop.)

David Champion •

Re: core dumps and can't build

2013-11-26 Thread David Champion
* On 26 Nov 2013, Charles E Campbell wrote: 
 The core dumps don't do me much good; the mutt I'm using came via a yum
 install, so it uses hex addressing.  ~/.mutt/cache exists, but no headers,

Which yum repo is it from?

 I tried building mutt myself (mutt 1.5.21); it builds, but blesses me
 Error in /home/cec/.muttrc, line 1: smtp_pass: unknown variable
 Error in /home/cec/.muttrc, line 2: smtp_url: unknown variable
 source: errors in /home/cec/.muttrc
 sh: /usr/local/bin/mutt_dotlock: No such file or directoryError in
 /home/cec/.muttrc, line 1: smtp_pass: unknown variable
 Error in /home/cec/.muttrc, line 2: smtp_url: unknown variable
 source: errors in /home/cec/.muttrc
 sh: /usr/local/bin/mutt_dotlock: No such file or directory
 Couldn't lock /home/cec/sent

You will certainly need the --enable-smtp option to ./configure for this
muttrc.  If there's an SRPM available for the yum repo you installed
from, you might try just using its spec file, but adding --enable-debug.

David Champion •

Re: Encrypting postponed messages

2013-09-09 Thread David Champion

I confess I haven't dug my way through the entire debate on this, but so
far I've seen argument along lines of: is it a necessary feature? if it
is necessary, is it necessary to be supported in mutt per se, or can it
be done externally?

I haven't seen any discussion of what use models it would harm to
support this in mutt.  Does anyone have an argument against?

Lacking that, I would say that if someone submits a good patch it should
be considered.  To me it's a good enhancement request.

(I can take the old features are bloat, one tool for one job trope for
granted, but I don't find it very compelling in general and especially
not in this case, where almost all the code necessary is already there
in some fashion.)

David Champion •

Re: Download multiple attachments at once

2013-07-30 Thread David Champion
* On 30 Jul 2013, James Griffin wrote: 
 David, out of curiosity, how do you get voicemail sent to your email
 server? that sounds like a great idea. My mobile has no signal where i
 live; if I could get my voicemail sent to my server that would be
 fantastic! It also sounds complex??

I have home VoIP service, and the provider (Megapath, formerly known
as Speakeasy) has this as a built-in option.  I think you can do it
using Google Voice (as a wrapper around your home/mobile) as well, but I
haven't tried it.

David Champion •

Re: Download multiple attachments at once

2013-07-29 Thread David Champion
* On 28 Jul 2013, wrote:
  Today as I was saving about 20 photos I received from my sister,
  I thought I wonder if there is a way to save all of the images
  attached to an email in one swoop as opposed to hitting s for each
  one.  How do you guys manage attachments?

 I wrote this small script; invoke it by |muttrip dir.  It depends
 on having ripmime installed.  The followup .pl program merely builds
 a crude index.html file and reports how many files it found; you can
 skip it.

Adding to this theme: I receive voice mail as wav attachments, but I
don't view them through mutt.  I have a procmail rule that sends
voicemail messages to a python script (attached).  This script saves all
audio/* attachments to a designated location with a unique filename.  It
could easily be adapted as an ad hoc bulk attachment filer.

David Champion •
#!/usr/bin/env python

import os
import sys
import email
import email.parser
import errno

def extract(m):
n = 0
audio = []
for part in m.walk():
n += 1
if part.get_content_type().startswith('audio/'):
data = part.get_payload(decode=True)
params = dict(part.get_params())
if 'name' in params:
name = params['name']
name = 'attachment%03d.wav' % n
fp = open(name, 'w')

return audio

def main(args):

p = email.parser.Parser()
m = p.parse(sys.stdin)
audio = extract(m)
for file in audio:
base, ext = os.path.splitext(file)
if '_' in base:
caller, date, timeofday = base.split('_')
dir = date[:6]
dir = time.strftime('%Y%m')

except OSError, e:
if e.errno == errno.EEXIST:
os.rename(file, os.path.join(dir, file))

if len(audio):
return 0

return 1

if __name__ == '__main__':

Re: Undependable macro

2013-06-17 Thread David Champion
* On 16 Jun 2013, jeremy bentham wrote: 
 I have a macro which works...sometimes.
 macro generic,pager ,t :set folder=imaps://mail.eskimo.comenterc
 (All one long line in my muttrc; I broke it up for readability
 If it fails, when I launch it mutt beeps immediately after I hit
 t and doesn't complete it.  Usually it gets as far as the toms
 mailbox and opens that.
 When it works, it finds a particular pdf file (nice of the sender
 always to include the string AM only in that file...) and opens it.

When it doesn't work, can you execute it manually with success?  Other
than that I can't help debug very much because I don't know what your
key bindings are, and I no longer remember the defaults.

General tip for requesting help on the lists: formulate your macros
to use keybinding names, not keystrokes.  That means putting each and
every interaction EXCEPT for prompt input into angle brackets using the
binding's name.  If you can do that before posting, more people will
understand what you're trying to do up front.

No criticism meant -- just a utilitarian perspective. ;)

David Champion •

Re: OT making ascii tables

2013-05-21 Thread David Champion
* On 21 May 2013, Will Fiveash wrote: 
 Another tool I use occasionally for creating ASCII based art/figures is

Neat, thanks.  I don't know how many ANSI editors I downloaded for the
Amiga way back when, but I've wished for something similar for unix a
hundred times since.  Or a thousand.  Hard to keep track.

David Champion •

Re: OT making ascii tables

2013-05-13 Thread David Champion
You should use the mutt-table script. :)


|a | b | c | d |
|e | f | g | h |
|i | j | k | l |

Saves having to write all the troff macros manually.

David Champion •

  1   2   3   4   5   6   >