![]() |
#1 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3
Karma: 2600
Join Date: Sep 2011
Device: kindle
|
mutt e-mail client on the kindle
Hey Folks,
I've been lurking for a bit, but this is my first post :-) I recently got mutt working and configured on the kindle, and thought I'd share: DISCLAIMER: Running a mail client on the kindle means making the root filesystem writable by default. This is dangerous. If you fill up your root partition, you risk making your kindle unbootable! Notes: 1. Wherever I put something in <brackets> I intend you to substitute your own value. I most often use this for <username> and <password> 2. Although you could go through most of this guide without logging in to your kindle via usb networking or ssh over wifi, it is much easier if you do most of the below while logged in from your computer. this link: https://www.mobileread.com/forums/sho...85&postcount=8 has instructions for connecting via ssh over wifi and making the sshd start at boot. Authenticating via key rather than username and password, is, of course, not essential, but you should probably change the default root password using Code:
passwd Step 1: Jailbreak your kindle. I used: http://yifan.lu/p/kindle-jailbreak Step 2: Install usbNetwork Hack and native kindle terminal. I used: https://www.mobileread.com/forums/sho...d.php?t=125860 which links here: http://info.iet.unipi.it/~luigi/kind...indle-terminal Step 3: Install optware. I used: https://www.mobileread.com/forums/sho...d.php?t=118472 This script looks promising, but it failed for me on a hash check: https://gist.github.com/791141 Step 4: Set up your path. I changed relevant line in /etc/profile from: Code:
export PATH=/usr/local/bin:/bin:/usr/bin:/usr/sbin:/sbin Code:
export PATH=/opt/bin:/opt/sbin:/usr/local/bin:/bin:/usr/bin:/usr/sbin:/sbin set up a user account Code:
mkdir -p /home/<username> adduser <username> (and follow the prompts) chown <username> /home/<username> chgrp <username> /home/<username> use ipkg to install the appropriate mail utilities. vim and sudo are not strictly essential to this setup, but are helpful. Code:
ipkg install mutt fetchmail procmail msmtp sudo vim if you installed sudo, add yourself to the sudoers file. Code:
visudo Code:
root ALL=(ALL) ALL Code:
root ALL=(ALL) ALL <username> ALL=(ALL) ALL fix the kindle's strange permissions Since the kidnle was never really invisioned as a multi-user device, the permissions on things like /dev/null and /dev/random are tighter than they really should be. So, fix that: Code:
chmod a+rw /dev/null chmod a+rw /dev/random chmod a+rw /dev/urandom To put it in an init script, do something like: Code:
vim /etc/init.d/fixperms Code:
#!/bin/sh #a script for making the kindle more multi-user friendly mntroot rw chmod a+rw /dev/null chmod a+rw /dev/random chmod a+rw /dev/urandom Code:
chmod +x /etc/init.d/fixperms ln -s /etc/init.d/fixperms /etc/rc.5/S99fixperms Logging in Code:
login Step 9: Configuring mutt (Most of this came from http://www.andrews-corner.org/mutt.html ) Put the following in your ~/.muttrc file, in your home directory Code:
# Colors Generated by the muttrc builder (http://muttrcbuilder.org/) # for mutt-1.5.18 # Colors # We set all the colors to black on while for maximum kindle readability color attachment black white color error black white color hdrdefault black white color indicator black white color markers black white color message black white color normal black white color quoted black white color search black white color signature black white color status black white color tilde black white color tree black white #The rest of the config taken from http://www.andrews-corner.org/mutt.html #======================================================# # Boring details # I use Gmail, so this configuration caters to that. set realname = "<Your Name>" set from = "<gmail username>@gmail.com" set use_from = yes set envelope_from ="yes" # Use a signature set signature="~/.signature" # Use msmtp rather than sendmail. Check that # the path is correct for your system: set sendmail="/opt/bin/msmtp" # If not set in ~/.bashrc: set spoolfile = "/opt/var/spool/mail/<username>" #======================================================# # Folders set folder="$HOME/mail" # Local mailboxes stored here set record="+sent" # Where to store sent messages set postponed="+postponed" # Where to store draft messages set mbox_type=mbox # Mailbox type set move=no # Don't move mail from spool #======================================================# # Watch these mailboxes for new mail, useful only if # Procmail or Maildrop is used to sort mail. mailboxes ! +slrn +fetchmail +mutt set sort_browser=alpha # Sort mailboxes by alpha(bet) #======================================================# # What to show and order of headers ignore * unignore Date: From: User-Agent: X-Mailer X-Operating-System To: \ Cc: Reply-To: Subject: Mail-Followup-To: hdr_order Date: From: User-Agent: X-Mailer X-Operating-System To: \ Cc: Reply-To: Subject: Mail-Followup-To: #======================================================# # which editor do you want to use? # vim of course! set editor="vim -c 'set tw=70 et' '+/^$' " set edit_headers=yes # See the headers when editing #======================================================# # Aliases set alias_file = ~/mail/mutt_aliases # In their own file source ~/mail/mutt_aliases # Source them set sort_alias=alias # Sort alphabetically #======================================================# # Odds and ends set markers # mark wrapped lines of text in the pager with a + set smart_wrap # Don't wrap mid-word set pager_context=5 # Retain 5 lines of previous page when scrolling. set status_on_top # Status bar on top. push <show-version> # Shows mutt version at startup Code:
mkdir ~/mail touch ~/mail/mutt_aliases Configuring fetchmail Put the following in .fetchmailrc in your home directory Code:
poll imap.gmail.com protocol IMAP user "<your gmail address>" there with password <your gmail password>" nofetchall mda "/opt/bin/procmail -d %T" ssl sslcertck sslcertfile /etc/ssl/certs/ca-certificates.crt keep Code:
chmod 600 .fetchmailrc Configuring procmail Put the following in ~/.procmailrc Code:
PATH=/opt/sbin:/opt/bin:/bin:/usr/bin:/usr/local/bin VERBOSE=off DEFAULT=/opt/var/spool/mail/matthew MAILDIR=$HOME/mail LOGFILE=$HOME/.procmaillog # Recipes below this comment: Code:
sudo mkdir -p /opt/var/spool/mail/ sudo chmod a+rw /opt/var/spool/mail/ Configuring msmtp Put the follwoing in ~/.msmtprc Code:
account default host smtp.gmail.com port 587 from <gmail address> tls on tls_starttls on tls_trust_file /etc/ssl/certs/ca-certificates.crt auth on user <gmail username> password <gmail password> logfile ~/.msmtp.log To check for new messages, run fetchmail, to read them, run mutt. you can even run fetchmail from within mutt with Code:
!fetchmail Ideally, I'd like to put the spool folder on /mnt/us/ somewhere, so that there is no chance of it filling up the root filesystem. However, I can't seem to make /mnt/us/ writable to an ordinary user. My script for fixing permissions on boot time only seems to work sometimes. I don't know why. When logging in via ssh, I can only log in as user: root, then I can run login to get to my user. I don't know why. When starting the standalone kindle terminal, /etc/profile is not read, and login is not called. Ideally, when that terminal started, it would call login, but I don't know how to make it do that either. Any suggestions for improvements are welcome :-) -Matthew |
![]() |
![]() |
![]() |
#2 |
Member
![]() Posts: 16
Karma: 24
Join Date: Sep 2011
Device: Kindle 3 WiFi v3.2.1
|
Hi Matthew
I'm looking forward to trying out your procedure to get Mutt up and running! I don't like the idea though of having the root FS remain writable (and possibly filling it up). Would it not be safer to use /mnt/us even if this means having to login as root? Why do you want to login as an ordinary user? If you can't make /mnt/us writable for an ordinary user, I'm wondering about the suggestion in the post on installing optware to create an ext2 file in /mnt/us and then mounting that for opt. I wonder if this FS could then be made writable for an ordinary user and be used for the spool folder? |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Using a loop-mounted filesystem in /mnt/us would clearly be a better solution and even allow for using user accounts other than root. I would not suggest to keep the rootfs writable, and I would not suggest to mess with the rootfs more than absolutely necessary.
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3
Karma: 2600
Join Date: Sep 2011
Device: kindle
|
Great idea hawhill and anthonyb
I'm thinking making /opt and /home mountpoints for loop filesystems in /mnt/us would solve my problem of needing to leave the root fs mounted rw, a situation I agree it would be preferable to avoid. I'll update my howto post as soon as I've tested it. -Matthew |
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 16
Karma: 24
Join Date: Sep 2011
Device: Kindle 3 WiFi v3.2.1
|
After creating a loop mounted ext3 file system as /mnt/loc (see thread on optware) I had to:
mkdir /mnt/loc/home mkdir -p /mnt/loc/opt/var/spool/mail mntroot rw ln -s /mnt/loc/home /home ln -s /mnt/loc/opt/var/spool /opt/var/spool ln -s /mnt/loc/opt/doc /opt/doc ln -s /mnt/loc/opt/libexec /opt/libexec ln -s /mnt/loc/opt/include /opt/include mntroot ro |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 16
Karma: 24
Join Date: Sep 2011
Device: Kindle 3 WiFi v3.2.1
|
I also noticed that changes to /etc/profile have no effect when starting a new terminal with kiterm (although some of the original settings in it do seem to have been applied?). The latest build I have of myts (kiterm) sets ENV=/mnt/us/kiterm/profile and this profile script is called successfully for root. When I then logon as myself it is not called - for my own user the script in /home/<myuser>/.profile is called.
I also tried fetchmail with a POP3 server. It tries to use service "pop3" but in /etc/services this is defined as "pop-3" so one has to add an alias for pop3 or add the line "service pop-3" to .fetchmailrc |
![]() |
![]() |
![]() |
#7 |
Member
![]() Posts: 16
Karma: 24
Join Date: Sep 2011
Device: Kindle 3 WiFi v3.2.1
|
Now that mutt is working I realise much of my email is in HTML format. So I'm thinking the next step it to create a .mailcap file to handle text/html; via w3m (or links) and adding auto_view text/html to .muttrc. I wonder if w3m or links is available on optware? Or better yet (perhaps), is there some way to launch the html via the browser built into the Kindle?
|
![]() |
![]() |
![]() |
#8 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3
Karma: 2600
Join Date: Sep 2011
Device: kindle
|
w3m is indeed available in optware, as is elinks, links2, some busybox version of links and lynx :-)
Be careful with your conf files so that your browser of choice renders everything as black text on white background though :-) |
![]() |
![]() |
![]() |
#9 |
Member
![]() Posts: 16
Karma: 24
Join Date: Sep 2011
Device: Kindle 3 WiFi v3.2.1
|
Well I decided to go for w3m. When I ran it I got "can't find termcap entry linux" so I had to install termcap too which fixed it. Trying it with -M option to set monochrome, but maybe I'll have to fiddle with color settings too. Speaking of which, I can't see which is the active message in mutt using the color settings above.
|
![]() |
![]() |
![]() |
#10 | |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Dec 2011
Device: kindle 3g
|
Quote:
Code:
set arrow_cursor |
|
![]() |
![]() |
![]() |
#11 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Dec 2011
Device: kindle 3g
|
Thanks OP! This is a good idea and mutt can be quite functional as a mail client. BTW, I just set my root user's home directory to '/mnt/us/root' and run mutt as root.
Also, for those who want a richer IMAP/Gmail experience (e.g. being able to move emails to folders, delete, archive, etc), you can take advantage of the built in IMAP support. No fetchmail necessary. here is my .muttrc configuration. Code:
set imap_user = "your_username@gmail.com" set imap_pass = "your_password" set folder = "imaps://imap.gmail.com" set spoolfile = "+INBOX" set realname = "Firstname Lastname" set from = "your_username@gmail.com" set use_from = yes set hostname = gmail.com set mail_check = 120 set timeout = 300 set imap_keepalive = 300 set postponed = "+[GMail]/Drafts" set record = "+[GMail]/Sent Mail" set move = no set include set sort = 'threads' #set sort_aux = 'reverse-last-date-received' set auto_tag = yes ignore "Authentication-Results:" ignore "DomainKey-Signature:" ignore "DKIM-Signature:" hdr_order Date From To Cc auto_view text/html #======================================================# # What to show and order of headers ignore * unignore Date: From: User-Agent: X-Mailer X-Operating-System To: \ Cc: Reply-To: Subject: Mail-Followup-To: hdr_order Date: From: User-Agent: X-Mailer X-Operating-System To: \ Cc: Reply-To: Subject: Mail-Followup-To: set smart_wrap # Don't wrap mid-word set pager_context=5 # Retain 5 lines of previous page when scrolling. # Colors # We set all the colors to black on while for maximum kindle readability set arrow_cursor color attachment black white color error black white color hdrdefault black white color indicator black white color markers black white color message black white color normal black white color quoted black white color search black white color signature black white color status black white color tilde black white color tree black white |
![]() |
![]() |
![]() |
#12 |
Member
![]() Posts: 16
Karma: 24
Join Date: Sep 2011
Device: Kindle 3 WiFi v3.2.1
|
Thanks for the tip!
(I had changed the colors to get a grey selection bar, but with the way the eink is updated, each time I move the selection up and down the text becomes lighter and lighter!) |
![]() |
![]() |
![]() |
#13 |
Member
![]() Posts: 19
Karma: 10
Join Date: Apr 2011
Device: pocketbook 603a
|
1. Works with firmware 3.3?
2. Supports file attachments? (pdf, zip ...) 3. Maybe someone wrote a script for easy installation of the client? |
![]() |
![]() |
![]() |
#14 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 250
Karma: 136662
Join Date: Apr 2011
Device: N/A
|
Quote:
Last edited by hfpop; 07-09-2012 at 11:04 AM. |
|
![]() |
![]() |
![]() |
#15 | |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Dec 2011
Device: kindle 3g
|
Quote:
Similarily, you can press "c?" to switch to another folder. To send email, you have to have msmtp installed and configured. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hacks Is there an ssh client for the Kindle ? | ninsei | Amazon Kindle | 3 | 11-18-2011 08:55 PM |
Is there a native twitter client for Kindle? | firstfan | Kindle Developer's Corner | 4 | 10-31-2010 08:40 PM |
e-Mail on Kindle DX | Alnilam | Amazon Kindle | 8 | 07-21-2009 12:23 PM |
$20 Mail-in rebate for kindle | atl475 | Amazon Kindle | 4 | 05-01-2008 02:10 PM |
E-Mail Signatures in Mac Mail? | Pride Of Lions | Lounge | 0 | 03-05-2004 08:47 PM |