Making changes by edit-type persistent

2013-01-20 Thread Suvayu Ali
Hi Mutt users,

Often I receive attachments with bad MIME types (usually
application/octet-stream).  I have the following config to deal with
these attachments:

  mime_lookup application/octet-stream

But sometimes the attachments are files of uncommon types without
entries in my ~/mime.types file.  I would like to edit the types of
these attachments and write it back to disk (I use Maildir) for the
future.  Is that possible somehow?

Thanks for any ideas,

-- 
Suvayu

Open source is the future. It sets us free.


256 colors, autoview and control codes

2013-01-20 Thread Patrice Levesque

Hi.

I'm happily using gentoo's mutt-1.5.21 with a 256-color terminal,
mostly under tmux.  My mutt colorscheme uses 256 colors and they are
showed perfectly.

I'd like to display image previews using unicode block characters,
in the mutt pager, using something like img2xterm
[https://github.com/rossy2401/img2xterm#] in conjunction with a
proper mailcap entry.

Outside of mutt, img2xterm displays the image in full 256 colors.
Inside mutt, it seems the escape codes for 256 colors don't get
recognized and blinking block junk gets displayed instead.
allow_ansi is turned on in .muttrc and the ANSI escape codes for
good ol' 16 colors work fine in a similar scenario.

Is there something I can do to make mutt recognize 256 color ANSI
codes inside its pager?

Also, is there a way inside mutt to strip the ANSI codes created by
an autoview-spawned command before relaying the message to an
external editor?

Attached to this mail is a typical 256-color ANSI-code output from
img2xterm.

Thanks,



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--
â–„â–„â–„â–„â–„â–„
 
â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„
 
â–„â–„â–„â–„â–„
 
â–„â–„â–„â–„â–„â–„
â–„ 
â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„
 â–„â–„â–„ 
â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„
 
â–„â–„â–„â–„â–„
â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„
 
â–„â–„â–„â–„â–„â–„â–„â–„â–„
 â–„â–„â–„â–„ 
â–„â–„â–„â–„â–„
 
â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„
 â–„ 
â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„
 
â–„â–„â–„â–„â–„â–„
 â–„â–„
â–„â–„â–„â–„â–„â–„â–„
 â–„â–„â–„ 
â–„â–„â–„  
â–„â–„â–„â–„â–„â–„â–„â–„â–„
 
â–„â–„â–„â–„
 â–„ 
â–„â–„â–„
▄▀▀▀▀▄▄▄▄▄▄▄▄
  
â–„â–„â–„â–„[48;5

Re: 256 colors, autoview and control codes

2013-01-20 Thread Stefan Wimmer

* Patrice Levesque  [2013-01-20 16:33]:

I'm happily using gentoo's mutt-1.5.21 with a 256-color terminal,
mostly under tmux.  My mutt colorscheme uses 256 colors and they are
showed perfectly.

I'd like to display image previews using unicode block characters,
in the mutt pager, using something like img2xterm
[https://github.com/rossy2401/img2xterm#] in conjunction with a
proper mailcap entry.

Outside of mutt, img2xterm displays the image in full 256 colors.
Inside mutt, it seems the escape codes for 256 colors don't get
recognized and blinking block junk gets displayed instead.
allow_ansi is turned on in .muttrc and the ANSI escape codes for
good ol' 16 colors work fine in a similar scenario.

Is there something I can do to make mutt recognize 256 color ANSI
codes inside its pager?

Also, is there a way inside mutt to strip the ANSI codes created by
an autoview-spawned command before relaying the message to an
external editor?

Attached to this mail is a typical 256-color ANSI-code output from
img2xterm.

Thanks,


Is your mutt compiled with ncurses or slang? I experienced that mutt can handle 
ANSI code better if it's compiled with slang ...


I'm using my own live-ebuild though so I'm not sure how that is handled by the 
official ebuild. Feel free to ask for my local ebuild if there's any interest ...


Greetz
Stefan


pgpS3lNUI45OM.pgp
Description: PGP signature


Re: Making changes by edit-type persistent

2013-01-20 Thread s. keeling
Incoming from Suvayu Ali:
> Hi Mutt users,

Hi yourself.  Still suffering the after-effects of last night here, so
this may be no help.  But I'm trying!  :-)

> Often I receive attachments with bad MIME types (usually
> application/octet-stream).  I have the following config to deal with
> these attachments:
> 
>   mime_lookup application/octet-stream

Mine looks like this:

  mime_lookup application/octet-stream application/X-Lotus-Manuscript

and in *nix you can do "file blah" which will tell you what type of
file "blah" is.

FYI, I also use:

  unset mime_forward
  unset mime_forward_decode

and I see there's also:

  # unset use_8bitmime

which I have commented out (for what reason, I don't know).  Perhaps
grepping the dox for "mime" may help?

> But sometimes the attachments are files of uncommon types without
> entries in my ~/mime.types file.  I would like to edit the types of
> these attachments and write it back to disk (I use Maildir) for the
> future.  Is that possible somehow?
> 
> Thanks for any ideas,

Have fun.  :-)


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*) :(){ :|:& };:
- -


Re: 256 colors, autoview and control codes

2013-01-20 Thread Patrice Levesque


> Is your mutt compiled with ncurses or slang? I experienced that mutt
> can handle ANSI code better if it's compiled with slang ...

ncurses; the official gentoo ebuild does not give any compilation flag
to switch between slang and ncurses (plus the gentoo patchset seems to
assume ncurses is selected).


> I'm using my own live-ebuild though so I'm not sure how that is
> handled by the official ebuild. Feel free to ask for my local ebuild
> if there's any interest ...

I'd like that very much; thanks.



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: 256 colors, autoview and control codes

2013-01-20 Thread Stefan Wimmer

* Patrice Levesque  [2013-01-20 22:14]:

Is your mutt compiled with ncurses or slang? I experienced that mutt
can handle ANSI code better if it's compiled with slang ...


ncurses; the official gentoo ebuild does not give any compilation flag
to switch between slang and ncurses (plus the gentoo patchset seems to
assume ncurses is selected).


I'm using my own live-ebuild though so I'm not sure how that is
handled by the official ebuild. Feel free to ask for my local ebuild
if there's any interest ...


I'd like that very much; thanks.


Certainly - here we go ...

Oh and my use flags are:
+berkdb
+crypt
+debug
-doc
+gdbm
-gnutls
+gpg
-idn
+imap
+mbox
+nls
+pop
-qdbm
+sasl
-sidebar
+smime
+smtp
+ssl
+tokyocabinet

You'll need the attached patch to successfully compile the hg-version.

Have fun B-)
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/mail-client/mutt/mutt-1.5.21-r1.ebuild,v 1.2 
2010/12/07 02:37:21 mattst88 Exp $

EAPI="3"

inherit eutils flag-o-matic autotools mercurial

DESCRIPTION="A small but very powerful text-based mail client"
HOMEPAGE="http://www.mutt.org";
EHG_REPO_URI="http://dev.mutt.org/hg/mutt";
EHG_REVISION="HEAD"
IUSE="berkdb crypt debug doc gdbm gnutls gpg idn imap mbox nls pop qdbm sasl 
sidebar smime smtp ssl tokyocabinet"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~x86"

RDEPEND=">=sys-libs/ncurses-5.2
tokyocabinet?  ( dev-db/tokyocabinet )
!tokyocabinet? (
qdbm?  ( dev-db/qdbm )
!qdbm? (
gdbm?  ( sys-libs/gdbm )
!gdbm? ( berkdb? ( >=sys-libs/db-4 ) )
)
)
imap?(
gnutls?  ( >=net-libs/gnutls-1.0.17 )
!gnutls? ( ssl? ( >=dev-libs/openssl-0.9.6 ) )
sasl?( >=dev-libs/cyrus-sasl-2 )
)
pop? (
gnutls?  ( >=net-libs/gnutls-1.0.17 )
!gnutls? ( ssl? ( >=dev-libs/openssl-0.9.6 ) )
sasl?( >=dev-libs/cyrus-sasl-2 )
)
smtp? (
gnutls?  ( >=net-libs/gnutls-1.0.17 )
!gnutls? ( ssl? ( >=dev-libs/openssl-0.9.6 ) )
sasl?( >=dev-libs/cyrus-sasl-2 )
)
idn? ( net-dns/libidn )
gpg?   ( >=app-crypt/gpgme-0.9.0 )
smime?   ( >=dev-libs/openssl-0.9.6 )
app-misc/mime-types"
DEPEND="${RDEPEND}
net-mail/mailbase
doc? (
dev-libs/libxml2
dev-libs/libxslt
app-text/docbook-xsl-stylesheets
|| ( www-client/lynx www-client/w3m www-client/elinks )
)"


src_configure() {
# Fix a small typo in hg source
epatch "${FILESDIR}"/crypt-gpgme.patch || die "patch failed"

local myconf="
$(use_enable crypt pgp) \
$(use_enable debug) \
$(use_enable gpg gpgme) \
$(use_enable imap) \
$(use_enable nls) \
$(use_enable pop) \
$(use_enable smime) \
$(use_enable smtp) \
$(use_with idn) \
$(use_with mixmaster) \
--enable-external-dotlock \
--enable-nfs-fix \
--sysconfdir="${EPREFIX}"/etc/${PN} \
--with-slang \
--with-docdir="${EPREFIX}"/usr/share/doc/${PN}-${PVR} \
--with-regex \
--disable-fcntl --enable-flock \
--with-exec-shell=${EPREFIX}/bin/sh"

# mutt prioritizes gdbm over bdb, so we will too.
# hcache feature requires at least one database is in USE.
if use tokyocabinet; then
myconf="${myconf} --enable-hcache \
--with-tokyocabinet --without-qdbm --without-gdbm 
--without-bdb"
elif use qdbm; then
myconf="${myconf} --enable-hcache \
--without-tokyocabinet --with-qdbm --without-gdbm 
--without-bdb"
elif use gdbm ; then
myconf="${myconf} --enable-hcache \
--without-tokyocabinet --without-qdbm --with-gdbm 
--without-bdb"
elif use berkdb; then
myconf="${myconf} --enable-hcache \
--without-tokyocabinet --without-qdbm --without-gdbm 
--with-bdb"
else
myconf="${myconf} --disable-hcache \
--without-tokyocabinet --without-qdbm --without-gdbm 
--without-bdb"
fi

# there's no need for gnutls, ssl or sasl without socket support
if use pop || use imap || use smtp ; then
if use gnutls; then
myconf="${myconf} --with-gnutls"
elif use ssl; then
myconf="${myconf} --with-ssl"
fi
# not sure if this should be mutually 

Re: 256 colors, autoview and control codes

2013-01-20 Thread Patrice Levesque

>>> Is your mutt compiled with ncurses or slang? I experienced that mutt
>>> can handle ANSI code better if it's compiled with slang ...

Unfortunately, though your ebuild works fine in other regards, the
switch to slang did not fix nor help the 256-color ANSI-display issue.
Thanks for trying.

Should I file a ticket?



-- 
 --|--
|
Patrice Levesque
 http://ptaff.ca/
mutt.wa...@ptaff.ca
|
 --|--
--


signature.asc
Description: Digital signature


Re: Making changes by edit-type persistent

2013-01-20 Thread s. keeling
Incoming from Stephen Keeling:
> Incoming from Suvayu Ali:
> > Hi Mutt users,
> > ...
> > But sometimes the attachments are files of uncommon types without
> > entries in my ~/mime.types file.  I would like to edit the types of

Dunno if it helps, but "apt-file search mime.types" produces some
interesting output.

fwiw.


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*) :(){ :|:& };:
- -


Re: Making changes by edit-type persistent

2013-01-20 Thread Derek Martin
On Sun, Jan 20, 2013 at 10:33:27AM +0100, Suvayu Ali wrote:
> But sometimes the attachments are files of uncommon types without
> entries in my ~/mime.types file.  I would like to edit the types of
> these attachments and write it back to disk (I use Maildir) for the
> future.  Is that possible somehow?

I don't believe it is (with Mutt).  You'd have to edit the raw message
with a text editor.

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



pgpQb5oJS6d4X.pgp
Description: PGP signature