Print Japanese UTF-8 mails

2009-10-15 Thread Horacio Sanson
I want to print emails from within mutt but when the emails contain Japanese
text in UTF-8 encoding I get very bad results and wasted paper.

For printing Japanese text I use the command:

  cat JapaneseDoc.txt | paps | lpr

Here the paps converts the japanese text to postscript that lpr can correctly
send to the default printer.

The question is how to set this command in the print_command of mutt? It seems
this command does not support pipes.

-- 
regards,
Horacio Sanson


How to display patch/diff files in color?

2009-10-27 Thread Horacio Sanson

Does anyone know how to make mutt display patches/diff files in color?

I am using pygmentize that in a terminal outputs the diff/patch files with easy 
to read
colors but when used from within mutt the text is displayed correctly but not 
colored.

Here is my configuration:

My .mailcap file:

  text/x-diff;pygmentize -f console %s;copiousoutput
  text/x-patch;pygmentize -f console %s;copiousoutput

My .muttrc file:

  auto_view text/x-diff
  auto_view text/x-patch


I can see in Mutt that the pygmentize command is being called but the output
text is not colored on the console.

As second question how do I change the mime type of received emails based on
extension? without using procmail? Some times I get patches/diff with mime-type
set to plain/text and I want to change them to text/x-patch or text/x-diff
based on extension. 

-- 
regards,
Horacio Sanson


Re: How to display patch/diff files in color?

2009-10-28 Thread Horacio Sanson
On Tue, Oct 27, 2009 at 09:57:39PM -0700, Gary Johnson wrote:
> On 2009-10-28, Horacio Sanson  wrote:
> > Does anyone know how to make mutt display patches/diff files in color?
> > 
> > I am using pygmentize that in a terminal outputs the diff/patch files with 
> > easy to read
> > colors but when used from within mutt the text is displayed correctly but 
> > not colored.
> > 
> > Here is my configuration:
> > 
> > My .mailcap file:
> > 
> >   text/x-diff;pygmentize -f console %s;copiousoutput
> >   text/x-patch;pygmentize -f console %s;copiousoutput
> > 
> > My .muttrc file:
> > 
> >   auto_view text/x-diff
> >   auto_view text/x-patch
> > 
> > 
> > I can see in Mutt that the pygmentize command is being called but the output
> > text is not colored on the console.
> 
> Try this in your .muttrc:
> 
> set allow_ansi
>

Thanks a lot... Now all patch/diff files are beautifully displayed in Mutt. 
Using
pygmentize I can potentially colorize all text attachments.

> > As second question how do I change the mime type of received emails based on
> > extension? without using procmail? Some times I get patches/diff with 
> > mime-type
> > set to plain/text and I want to change them to text/x-patch or text/x-diff
> > based on extension. 
> 
> This was originally intended for application/octet-stream but was
> generalized to handle other MIME types.  I don't know whether it
> will work for text/plain.  Look in the mutt manual for
> 'mime_lookup'.
> 

This also seemed to work very well. So far all files with patch or diff
extensions appear as text/x-diff mime.

> HTH,
> Gary
> 
> 

-- 
regards,
Horacio Sanson


How to display patch/diff files with color inside Mutt?

2009-10-30 Thread Horacio Sanson
Does anyone know how to make mutt display patches/diff files in color?

I tried using pygmentize that in console colors the diff files correctly but
when used from within mutt the text is displayed correctly but not colored.

Here is my configuration:

My .mailcap file:

  text/x-diff;pygmentize -f console %s;copiousoutput
  text/x-patch;pygmentize -f console %s;copiousoutput

My .muttrc file:

  auto_view text/x-diff
  auto_view text/x-patch


I can see in Mutt that the pygmentize command is being called but the output
text is not colored on the console.

As second question how do I change the mime type of received emails based on
extension? without using procmail? because I use Google IMAP.

Some times I get patches/diff with plain/text and I want to change them to
text/x-patch or text/x-diff based on extension. This of course so my coloring
rules above take effect.

-- 
regards,
Horacio Sanson


Vim fold key bindings for mutt threads

2010-01-04 Thread Horacio Sanson
Is it possible to create Vim fold like keybindings to expand/collapse threads in
mutt?

Example:
  zo  -   expand thread under the cursor
  zO  -   expand thread under the cursor and all subthreads recursively
  zc  -   close thread under the cursor
  zC  -   close thread under the cursor and all subthreads recursively
  za  -   toggle thread under the cursor
  zA  -   toggle thread under the cursor and all subthreads recursively

Being used to vim keybindings using ESC-v is rather uncomfortable for me.

-- 
regards,
Horacio Sanson


Mutt 256 color themes

2010-01-05 Thread Horacio Sanson
Currently I am using the ivy league color theme from Aaron Toponce (see link
below) with a couple of modifications to make it work in my transparent KDE
Konsole.

http://pthree.org/2008/10/22/ivy-league-theme-for-mutt/

I was looking for similar 256 color themes for mutt but there does not appear to
be any on the whole Internet.

Are there any other themes around? Or is anyone willing to share their colors?

Here I attach the color setting I use. To use it I source it in my .muttrc file
like: 
  
source /path/to/ivy256

-- 
regards,
Horacio Sanson
# 256 color theme from 
# http://pthree.org/2008/10/22/ivy-league-theme-for-mutt/
# Make sure you set TERM=xterm-256color for these colors to display correctly.
# In console you must edit the profile ENV and set the TERM variable there.

# The chosen color selection
# 34 - green
# 111 - blue
# 124 - red
# 142 - orange
# 193 - tan
# 233 - black

# general-doesn't-fit stuff
color normal color193 default
color error color193 color124
color markers color142 default
color tilde color142 default
color status color142 default

# index stuff
color tree color124 default
color indicator color21 color193
color index color193 default ~A
color index color34 default ~N
color index color34 default ~O
color index color124 default ~F
color index color160 default ~D
color index color210 default ~T

# header stuff
color hdrdefault color122 default
color header color111 default "^Subject"

# gpg stuff
color body color34 default "^gpg: Good signature.*"
color body color193 color124 "^gpg: BAD signature.*"
color body color142 default "^gpg: Can't check signature.*"
color body color142 default "^-BEGIN PGP SIGNED MESSAGE-"
color body color142 default "^-BEGIN PGP SIGNATURE-"
color body color142 default "^-END PGP SIGNED MESSAGE-"
color body color142 default "^-END PGP SIGNATURE-"
color body color142 default "^Version: GnuPG.*"
color body color142 default "^Comment: .*"
#color body color142 default "^[[:alnum:]/\+=]+[[:space:]]+$"

# url, email and web stuff
color body color111 default "(finger|ftp|http|https|news|telnet)://[^ >]*"
color body color111 default ""
color body color111 default 
"www\\.[-.a-z0-9]+\\.[a-z][a-z][a-z]?([-_./~a-z0-9]+)?"
color body color111 default "mailto: *[^ ]+\(\\i?subject=[^ ]+\)?"
color body color111 default "[-a-z_0-9.%...@[-a-z_0-9.]+\\.[-a-z][-a-z]+"

# misc body stuff
color attachment color111 default
color signature color142 default

# quote levels
color quoted color34 default
color quoted1 color142 default
color quoted2 color34 default
color quoted3 color142 default
color quoted4 color34 default
color quoted5 color142 default
color quoted6 color34 default
color quoted7 color142 default
color quoted8 color34 default
color quoted9 color142 default



Setting the To: header when replying.

2010-01-14 Thread Horacio Sanson

A few weeks ago everytime I replied a message by pressing r on the index or
pager views the To: header field was correctly set to the same address in the
original message From: header. 

Now everytime I reply an email the To: header in the reply is set to the To:
header of the original message that usually is my address.

I played with the reply_to option to no avail. Can someone please tell me what
is wrong with my configuration??


-- 
regards,
Horacio Sanson
# Jump to Mailboxes view when pressing q from within the index
# and quit when pressing q from within the Mailboxes view.
macro   index   q   '?'
macro   browser q   ''

##
# General Settings
##
set menu_scroll  # Stop mutt from jumping entire pages when scrolling
set copy=no  # Do not create copy of outgoing mails
set move=no  # Do not move read mail from the spool to the mbox
set delete=yes   # Purge deleted messages without asking
#set edit_headers # Allow me to edit headers when composing
set fast_reply   # Skip initial prompts when replying
set use_from # Needed to enable reverse_name
set reverse_name # Leave my address as it appears in the message I am replying
set fcc_attach   # Keep attachments in forwarded messages
set include=yes  # Always include message when replying
set indent_string="> " # Intent string for included messages
set pipe_split   # split tagged messages when using "|"
set pager_stop   # Don't jump to next message at the end of the pager
set allow_ansi   # Display colors used for pygmentize

set print=ask-yes # ask me if I really want to print messages
set print_command='paps | lpr' # Good for UTF-8 Japanese emails.
#set print_command="a2ps -2" # how to print things (I like to save trees)

# Command History
set history=200
set save_history=100
set history_file=~/.mutt/history

# Headers diplay
ignore "Authentication-Results:"
ignore "DomainKey-Signature:"
ignore "DKIM-Signature:"
hdr_order Date From To Cc Reply-To

##
# Mailing Lists Management
# http://larve.net/people/hugo/2000/07/ml-mutt
##
set followup_to=no
set honor_followup_to=no

subscribe group -group mailinglist ffmpeg-de...@mplayerhq.hu
subscribe group -group mailinglist ffmpeg-u...@mplayerhq.hu
subscribe group -group mailinglist android-beginn...@googlegroups.com
subscribe group -group mailinglist mutt-users@mutt.org

##
# Remove all messages older than 3 years, note that all my mailing lists
# folders start with ML-
##
#folder-hook ML- 'push ~r>3y!~F'# Marks 
them only, good for testing
folder-hook ML- 'push ~r>3y!~F'  # 
Actually deletes the old messages

message-hook '%C mailinglist' 'set from=hsan...@gmail.com'
send-hook '%C mailinglist' 'my_hdr From: hsan...@gmail.com'

##
# Handling Threads
##
# Show number of threads if collapsed
set index_format="%M %Z  %(%Y %b %d (%H:%m))  %-40.40n (%?l?%4l&%4c?) %s"

# Sort by threads
set sort = 'threads'
set sort_browser="reverse-date"
set sort_aux = 'last-date-received'

# Collapse all threads except for threads with unread messages.
set collapse_unread=no
folder-hook . 'push '
bind index za collapse-thread # Collapse current read thread
bind index zA collapse-all# Collapse all read thread

source '~/.mutt/scripts/gpg.rc'
source ~/.mutt/colors/colors256-ivy


Re: Simple Mutt with Eee PC 701.

2010-01-19 Thread Horacio Sanson
d put them in the signature
   variable. 
 - The first account has a pgp signature that I set for all email sent from that
   account. You can unset pgp_sign_as if you do not have pgp signatures.

Some other useful configuration:

set ssl_starttls=yes # activate TLS if available on the server
set ssl_force_tls=yes # always use SSL when connecting to a server
unset imap_passive # Don't wait to enter mailbox manually
#set imap_peek=yes # Don't mark imap emails as read
set imap_check_subscribed # poll mailboxes for new mail
set mail_check=60 # Reduce polling frequency to a sane level
set timeout=10 # Poll current mailbox more often
set net_inc=5 # Display download progress every 5K
set fast_reply   # Skip initial prompts when replying
set use_from # Needed to enable reverse_name
set reverse_name # Leave my address as it appears in the message I am replying

set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

Also make sure to set your alternates correctly.

Hope this is useful

> set realname = "Your realname"
> set from = "Email address"
> set imap_user = "yourusern...@foo.org"
> set imap_pass = "yourpassword"
> 
> How do I switch between IMAP accounts? I looked here 
> http://wiki.mutt.org/?action=browse&diff=1&id=UserStory/GmailMultiIMAP
> and see they suggest the following:
> 
> set folder="imaps://aoliv...@imap.gmail.com"
> mailboxes "=INBOX"
> 
> set folder="imaps://redon...@imap.gmail.com"
> mailboxes "=INBOX"
> 
> unset folder
> 
> unset imap_passive
> 
> 
> Notice that the INBOX is not the same.
> 
> BTW, thanks for the paranoid tips :-)
> 

-- 
regards,
Horacio Sanson


Are subscribe and lists commands obsolete?

2010-01-21 Thread Horacio Sanson
I have been trying to wrap my head around what suscribe and lists
commands are. For me mutt handles mailing lists  perfectly
without these commands so to make sure I am not missing some (not
obvious) benefits allow me to ask the experts.

>From the documentation I found the subscribe command allows to:

  - Use the reply-list  function to send replies only to the main
mailing list address, not to tha author.
  - Honor the Mail-Followup-To header if present.
  - Expand %L to the list address instead of the author's address in the
index.

but:

  - In my mutt (1.5.20) the reply-list  command works correctly even
if I do not have a subscribe command for that mailing list in my
muttrc. That is pressing  sets To: to the mailing list address
and pressing  sets To: to the authors address.
  - The Mail-Followup-To header seems to be considered a bad hack so I
disable it using (http://larve.net/people/hugo/2000/07/ml-mutt): 

set followup_to=no
set honor_followup_to=no

  - I don't use %L in my index_format

>From the above I really see no benefit in maintaining a bunch of
subscribe commands for each of the hundred's of mailing lists I read.

And the lists command is like a NOOP command for me. It is like a
subscribe but without any of it's benefits.

Just want to know if it is worth to start writing subscribe commands for
all my mailing list addresses or not.

-- 
regards,
Horacio Sanson


Re: Mutt and multiple imap accounts

2010-02-22 Thread Horacio Sanson
On Sat, Feb 20, 2010 at 02:57:41PM +0100, Zeerak Waseem wrote:
> Hey,
> 
> I'm having some difficulties with mutt and multiple imaps; I've been
> trying to set it up for my private mail and my uni mail, but I can't seem
> to get it to work. I've been following two entries from the wiki (mainly)
> this (http://wiki.mutt.org/?MuttGuide/UseIMAP) and this
> (http://wiki.mutt.org/?UserStory/GmailMultiIMAP), if I purely follow the
> first link, then mutt responds with there being no maildir.
> If I purely follow the second link then it recognizes the maildir, but it
> shows that there are no mailboxes.
> A finesse to this is that my uni mail has a different ending from the imap
> server (the other is a gmail account). Could someone help me point out the
> flaws in my configuration?
> 
> # Base hook to reset account variables to known state before activating
> new ones
>   account-hook . 'unset preconnect imap_user imap_pass imap_authenticators;
> set ssl_starttls=ask-yes'
> 
>   account-hook imaps://imap.gmail.com:993/ 'set imap_user=Gmail-user
> imap_pass=Pass'
>   folder-hook imaps://imap.gmail.com:993/ 'set
> folder=imaps://imap.gmail.com/INBOX record=+Sent from="My Name
> "'
> 
>   account-hook imaps://uni-imap-server.com/ 'set imap_user=Uni-user
> imap_pass=Pass2'
>   folder-hook imaps://uni-imap-server.com/ 'set
> folder=imaps://uni-imap-server.com/INBOX record=+Sent from="My Name
> "'
> 
> If I add a folder and a spoolfile line (independent of the hooks) then
> this setup works, but would I need to set a spoolfile and a folder for
> both accounts? I think I tried it, but I'm not quite certain.

The folder and spoolfile you set would be your defaults that get open
when you start mutt. You only need to set these for one of your
accounts.

A few days back I posted in this mailing list my configuration to handle 
multiple Gmail
accounts. Search the archives for a subject like "Simple Mutt with Eee
PC 701". You may find it useful.

> 
> Any help would be appreciated :-)
> 
> 
> -- 
> Zeerak

-- 
regards,
Horacio Sanson


Bounce message from a different from address.

2010-02-22 Thread Horacio Sanson

I send a long email to a mailing list but after sending it I realized I
send the email using the wrong from: address. Of course the message got bounced
back because that address is not registered in the mailing list.

Now this should be easy to do but I have not found a simple way to
resend the message with a different from: address. The message is stored
in my Sent folder but using the bounce function on it asks me to input a
new destination (to:) address but what I want is to change the from:
address and resend the message intact as it is.

How to achieve this feat?

-- 
regards,
Horacio Sanson


Re: Bounce message from a different from address.

2010-02-22 Thread Horacio Sanson
On Mon, Feb 22, 2010 at 06:45:48PM -0600, Kumar Appaiah wrote:
> On Tue, Feb 23, 2010 at 09:34:51AM +0900, Horacio Sanson wrote:
> > I send a long email to a mailing list but after sending it I realized I
> > send the email using the wrong from: address. Of course the message got 
> > bounced
> > back because that address is not registered in the mailing list.
> > 
> > Now this should be easy to do but I have not found a simple way to
> > resend the message with a different from: address. The message is stored
> > in my Sent folder but using the bounce function on it asks me to input a
> > new destination (to:) address but what I want is to change the from:
> > address and resend the message intact as it is.
> > 
> > How to achieve this feat?
> 
> On my Mutt, e is bound to "resend-message". You can use that to
> edit and "resend" the message.
> 

Thanks, I knew was something easy...


> HTH.
> 
> Kumar
> -- 
> Your idol is shattered in the dust to prove that God's dust is greater than 
> your idol.
> - Rabindranath Tagore (Stray Birds, 1916)



-- 
regards,
Horacio Sanson