Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HTML-Mails mit Mutt + .mailcap richtig anzeigen lassen
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Deutsche Dokumentation
View previous topic :: View next topic  
Author Message
rogge
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2006
Posts: 132
Location: Erfurt

PostPosted: Sun Mar 23, 2008 10:42 pm    Post subject: HTML-Mails mit Mutt + .mailcap richtig anzeigen lassen Reply with quote

Hier ist eine kleine Anleitung für alle die wie ich ziemlich verzweifelt versucht haben
Mutt beizubringen HTML-Mails korrekt anzuzeigen.

Der gängige Tipp ist folgender (Eintrag in die ~/.mailcap):

Code:

text/html; /usr/bin/links -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html


Damit versucht Mutt Mails mit text/html-MIME-Type durch 'links' anzeigen zu lassen.

Für 'links' könnt ihr auch den Browser eures Vertrauens einsetzen (w3m, lynx, ...).
Lynx kann man zusätzlich noch die Option '-force-html' übergeben. Damit wird die
HTML-Interpreation erzwungen, egal was es eigentlich für ein MIME-Type ist.

'copiousoutput' sorgt dafür das der Inhalt inline angezeigt wird und kein neues
Fenster/Terminal genutzt wird. Fall man das doch möchte kann das durch den
Zusatz von 'needsterminal' erzwingen.

'description' ist nicht zwingend, aber selbsterklärend.

Zusätzlich musste ich noch folgendes in meine ~/.muttrc eintragen:
Code:

alternative_order text/enriched text/plain text/html
auto_view text/html


Die erste Zeile ist für Mails mit gemischtem MIME-Type, sie sorgt für eine entsprechende
Sortierung.
Die zweite Zeile sorgt für ein automatisches Anzeigen der HTML-Inhalte. Dies könnte man
noch durch andere MIME-Types erweitern, je nach Bedarf.


Hier ist meine komplette ~/.mailcap :

Quote:

text/plain; less '%s'; needsterminal
application/x-troff-man; /usr/bin/nroff -mandoc -Tlatin1; copiousoutput; print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
text/plain; shownonascii iso-8859-1 '%s'; description="Plain ASCII Text"; test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
text/richtext; shownonascii iso-8859-1 -e richtext -p '%s'; description="Richtext"; copiousoutput; test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
text/enriched; shownonascii iso-8859-1 -e richtext -e -p '%s'; description="Enriched Text"; copiousoutput; test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
message/partial; showpartial '%s' %{id} %{number} %{total}; description="An incomplete message"
message/external-body; showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}; needsterminal; description="A reference to data stored in an external location"; composetyped="extcompose '%s"'
audio/basic; /usr/lib/mime/playaudio '%s'; description=Basic uLaw Audio; nametemplate=%s.au
application/x-tar; /bin/tar tvf -; print=/bin/tar tvf - | print text/plain:-; copiousoutput
application/x-gtar; /bin/tar tvzf -; print=/bin/tar tvzf - | print text/plain:-; copiousoutput
text/plain; more '%s'; needsterminal
application/xrx; view=xrx '%s'; description="remote X application"; test=test "$DISPLAY"; nametemplate=%s.rx
text/richtext; richtext '%s'; description="Richtext"; copiousoutput
text/enriched; richtext -e '%s'; description="Enriched Text"; copiousoutput
text/plain; gview '%s'; edit=gvim -f '%s'; compose=gvim -f '%s'; test=test "$DISPLAY" != ""
text/plain; view '%s'; edit=vim '%s'; compose=vim '%s'; needsterminal
text/html; /usr/bin/links -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
text/*; gview '%s'; edit=gvim -f '%s'; compose=gvim -f '%s'; test=test "$DISPLAY" != ""
text/*; view '%s'; edit=vim '%s'; compose=vim '%s'; needsterminal
text/*; more '%s'; needsterminal
application/pdf; acroread %s
application/octet-stream; acroread %s
image/*; xv %s
#image/jpeg; gimv %s
#image/jpg; gimv %s
#image/JPG; gimv %s
#image/psd; gimp %s
#image/PSD; gimp %s
application/msword; abiword %s
application/msexcel; gnumeric %s
text/richtext; abiword %s
text/*; less '%s'; needsterminal
*/*; less '%s'; needsterminal
*/*; false; print=lpr '%s'


und meine ~/.muttrc hat folgende Inhalte:
Quote:

my_hdr from: ***@***.**
my_hdr Organization: ******
my_hdr X-URL: http://www.*****.de
set editor="vim"
set pipe_decode=no
set attribution="%n <%a> schrieb am %d:"
set move=no # nich nach mbox
macro index <delete> "!%a >> /home/***/Mail/spam" "SPAM"
set record=+sentbox
set postponed=+postponed
set sort=threads #Nachrichten im Index nach Thread sortieren
set include=yes
set spoolfile=~/Mail/inbox

# multipart messages
alternative_order text/enriched text/plain text/html
# natuerlich den normalen text lieber als den html schrott
auto_view text/html


source /usr/share/doc/mutt-1.5.13-r1/samples/gpg.rc

ignore *
unignore subject to from date

color hdrdefault brightcyan green
color header brightwhite green "^from:"
color header brightwhite green "^subject:"

color quoted brightgreen green
color signature brightwhite green

color indicator blue white

color error brightwhite green
mono error bold
color status black cyan
mono status bold
color tree yellow blue

color tilde brightmagenta green
color body brightwhite green "[-a-z_0-9.]+@[-a-z_0-9.]+"
mono body bold "[-a-z_0-9.]+@[-a-z_0-9.]+"
color body brightyellow black "^Good signature"
mono body bold "^Good signature"
color body brightwhite red "^Bad signature from.*"
mono body bold "^Bad signature from.*"
color normal default green
color message brightwhite green
color attachment brightwhite green




So, ich hoffe ich konnte helfen.

MfG, rogge

PS: http://ssl.schlittermann.de/pipermail/lug-dd/2003-December/064488.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Deutsche Dokumentation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum