Difference between revisions of "Mutt"

From WTFwiki
Jump to navigation Jump to search
Line 17: Line 17:
 
== Open HTML mails in a browser on another machine ==
 
== Open HTML mails in a browser on another machine ==
  
# On your mutt machine:
+
1. On your mutt machine:
## Generate passwordless ssh key (don't worry we'll limit the access):
+
 
 +
1.1. Generate passwordless ssh key (don't worry we'll limit the access):
 +
 
 
  ssh-keygen
 
  ssh-keygen
## Add to .muttrc:
+
 
 +
1.2. Add to .muttrc:
 +
 
 
  macro pager o "v/html<enter>|ssh MACHINE<enter>q" \
 
  macro pager o "v/html<enter>|ssh MACHINE<enter>q" \
 
         "View HTML mail in Firefox on arachnotron"
 
         "View HTML mail in Firefox on arachnotron"
 +
 
where MACHINE is your browser machine name.
 
where MACHINE is your browser machine name.
# On your browser machine:
+
 
## Add to $HOME/.ssh/authorized_keys:
+
2. On your browser machine:
 +
 
 +
2.1. Add to $HOME/.ssh/authorized_keys:
 +
 
 
  command="/home/yourname/bin/open_html_mail.sh" ssh-rsa AAAA...<rest of key>
 
  command="/home/yourname/bin/open_html_mail.sh" ssh-rsa AAAA...<rest of key>
## Create $HOME/bin/open_html_mail.sh:
+
 
 +
2.2. Create $HOME/bin/open_html_mail.sh:
 +
 
 
  #!/bin/sh
 
  #!/bin/sh
 
   
 
   
 
  cat >/tmp/last_html_mail.html
 
  cat >/tmp/last_html_mail.html
 
  DISPLAY=:0 firefox /tmp/last_html_mail.html
 
  DISPLAY=:0 firefox /tmp/last_html_mail.html
## chmod +x $HOME/bin/open_html_mail.sh
+
 
 +
2.3. chmod +x $HOME/bin/open_html_mail.sh

Revision as of 12:32, 14 November 2012

Render HTML email when there's no text/plain alternative

If there's no text/plain version of an email component, mutt defaults to just rendering the html, regardless of the mailcap file.

To make it do something more useful:

.mailcap

text/html; lynx -force_html -dump %s ; copiousoutput

.muttrc

auto_view text/html
alternative_order text/plain

One downside of this, is that lynx no longer can run interactively (you can't follow links from a html email). Instead lynx will print out a references section at the bottom with all the embedded links.

More info can be found at http://www.mutt.org/doc/manual/manual-5.html

Open HTML mails in a browser on another machine

1. On your mutt machine:

1.1. Generate passwordless ssh key (don't worry we'll limit the access):

ssh-keygen

1.2. Add to .muttrc:

macro pager o "v/html<enter>|ssh MACHINE<enter>q" \
        "View HTML mail in Firefox on arachnotron"

where MACHINE is your browser machine name.

2. On your browser machine:

2.1. Add to $HOME/.ssh/authorized_keys:

command="/home/yourname/bin/open_html_mail.sh" ssh-rsa AAAA...<rest of key>

2.2. Create $HOME/bin/open_html_mail.sh:

#!/bin/sh

cat >/tmp/last_html_mail.html
DISPLAY=:0 firefox /tmp/last_html_mail.html

2.3. chmod +x $HOME/bin/open_html_mail.sh