Discussion:
Forwarding emails to kindle
SK
2012-04-17 08:46:59 UTC
Permalink
Hi all,

I am trying to get a workflow setup as follows:

Need: I would like to read articles / long emails distributed in
mailing lists via kindle

step 1: browse though emails in mutt in laptop
step 2: forward some interesting emails to ***@free.kindle.com address
step 3: download the emails as "Personal Documents" in kindle
step 4: go offline and read them in kindle

I am having issue with step 2 because every email I forward to
Amazon/kindle comes back with the error:

--error msg--
Your message to ***@free.kindle.com, sent at xxx GMT did not include
any attached documents or image files.

The Kindle Personal Document Service can convert and deliver the
following types of documents:
Microsoft Word (.doc, .docx)
Rich Text Format (.rtf)
HTML (.htm, .html)
Text (.txt) documents
Archived documents (zip , x-zip) and compressed archived documents
Mobi book

Images that are of type JPEGs (.jpg), GIFs (.gif), Bitmaps (.bmp), and
PNG images (.png).
Adobe PDF (.pdf) documents are delivered without conversion to Kindle
DX, Second Generation and Latest Generation Kindles.

Conversion of Adobe PDF (.pdf) to Kindle format is done on experimental basis.

If the document(s) that failed belonged to one of the above document
types, please ensure the document is not password protected or
encrypted. Note that the Latest Generation Kindles support password
protected PDFs.
--/error msg--

I did forward the email as attachment but for some reason I guess
amazon is not really interpreting the attaching as one of the valid
types.

Has anyone done anything similar or know what could be going wrong?

Thanks,
skn
Toby Cubitt
2012-04-17 10:21:47 UTC
Permalink
Post by SK
I am having issue with step 2 because every email I forward to
--error msg--
any attached documents or image files.
The Kindle Personal Document Service can convert and deliver the
Microsoft Word (.doc, .docx)
Rich Text Format (.rtf)
HTML (.htm, .html)
Text (.txt) documents
Archived documents (zip , x-zip) and compressed archived documents
Mobi book
I did forward the email as attachment but for some reason I guess
amazon is not really interpreting the attaching as one of the valid
types.
Not owning a Kindle, this is complete speculation. But at a guess Amazon
is recognising text documents either by their mime type, or (ugh!) by the
.txt filename extension.

In case you haven't already tried this, you can manually change the mime
type of the attachment from the compose menu using <edit-type> (bound to
^T by default), and set it to "text/plain".

Failing that, saving the mail you want to forward to a file with
extension .txt, then attaching that file to a new mail, will both produce
the desired file extension and automatically set the mime type to
"text/plain" (assuming you have mime.types configured sanely).

HTH,

Toby
--
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: ***@cantab.net
web: www.dr-qubit.org
SK
2012-04-17 12:29:26 UTC
Permalink
Post by Toby Cubitt
Post by SK
I am having issue with step 2 because every email I forward to
--error msg--
any attached documents or image files.
The Kindle Personal Document Service can convert and deliver the
Microsoft Word (.doc, .docx)
Rich Text Format (.rtf)
HTML (.htm, .html)
Text (.txt) documents
Archived documents (zip , x-zip) and compressed archived documents
Mobi book
I did forward the email as attachment but for some reason I guess
amazon is not really interpreting the attaching as one of the valid
types.
Not owning a Kindle, this is complete speculation. But at a guess Amazon
is recognising text documents either by their mime type, or (ugh!) by the
.txt filename extension.
In case you haven't already tried this, you can manually change the mime
type of the attachment from the compose menu using <edit-type> (bound to
^T by default), and set it to "text/plain"
That does not work for two reasons:

- amazon does not recognise the forwarded attachment as "attachment"
for some reason
- when I covert from message/rfc822 to text/plain, the whole msg
header part gets dumped in.
Post by Toby Cubitt
Failing that, saving the mail you want to forward to a file with
extension .txt, then attaching that file to a new mail, will both produce
the desired file extension and automatically set the mime type to
"text/plain" (assuming you have mime.types configured sanely).
That works indeed. However it is a painful manual process. Any quick
way to automate it?

Thanks,
skn
Post by Toby Cubitt
HTH,
Toby
--
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain
web:   www.dr-qubit.org
Dennis Guhl
2012-04-17 12:49:22 UTC
Permalink
[..]
Post by SK
Post by Toby Cubitt
In case you haven't already tried this, you can manually change the mime
type of the attachment from the compose menu using <edit-type> (bound to
^T by default), and set it to "text/plain"
- amazon does not recognise the forwarded attachment as "attachment"
for some reason
If you forward the email as an attachment (look for mime_forward in
the manual) you can prevent this.
Post by SK
- when I covert from message/rfc822 to text/plain, the whole msg
header part gets dumped in.
To prevent this you would have to cut out the headers, which would be
difficult with simple forwarding.
Post by SK
Post by Toby Cubitt
Failing that, saving the mail you want to forward to a file with
extension .txt, then attaching that file to a new mail, will both produce
the desired file extension and automatically set the mime type to
"text/plain" (assuming you have mime.types configured sanely).
That works indeed. However it is a painful manual process. Any quick
way to automate it?
Write a macro saving the message to a txt and composing a new email
with the file attached. But be aware, this file will also contain the
full headers. You would probably need a script to cut out the headers.

Dennis
SK
2012-04-17 13:27:52 UTC
Permalink
Post by Dennis Guhl
Post by SK
Post by Toby Cubitt
In case you haven't already tried this, you can manually change the mime
type of the attachment from the compose menu using <edit-type> (bound to
^T by default), and set it to "text/plain"
- amazon does not recognise the forwarded attachment as "attachment"
for some reason
If you forward the email as an attachment (look for mime_forward in
the manual) you can prevent this.
Strangely enough even when I forward as attachment (text/plain), the
amazon system does not recognise it as an attachment.

I am not sure why.
Post by Dennis Guhl
Post by SK
- when I covert from message/rfc822 to text/plain, the whole msg
header part gets dumped in.
To prevent this you would have to cut out the headers, which would be
difficult with simple forwarding.
Post by SK
Post by Toby Cubitt
Failing that, saving the mail you want to forward to a file with
extension .txt, then attaching that file to a new mail, will both produce
the desired file extension and automatically set the mime type to
"text/plain" (assuming you have mime.types configured sanely).
That works indeed. However it is a painful manual process. Any quick
way to automate it?
Write a macro saving the message to a txt and composing a new email
with the file attached. But be aware, this file will also contain the
full headers. You would probably need a script to cut out the headers.
That seems to be the way out since I can also convert the text/plain
to mobi or whatever that amazon overlords want. Can you help by
providing a skeleton of a macro? I can try to hook it to a a
perl/python script that removes headers and convert to .mobi etc.

Thanks,
skn
Leo Vegoda
2012-04-17 13:55:27 UTC
Permalink
Hi,

On Tue, Apr 17, 2012 at 1:46 AM, SK <***@gmail.com> wrote:

[...]
Post by SK
Need: I would like to read articles / long emails distributed in
mailing lists via kindle
step 1: browse though emails in mutt in laptop
step 3: download the emails as "Personal Documents" in kindle
step 4: go offline and read them in kindle
I am having issue with step 2 because every email I forward to
For articles that appear in web pages I suggest using a service like
Instapaper. It will save them for you and automatically send you an
email to your ***@free.kindle.com address every morning with the most
recent 20 articles. It works a treat.

If you have a Kindle Fire you might want to look at the apps that
interface with Instapaper instead. There are some good ones.

Regards,

Leo
SK
2012-04-17 14:10:47 UTC
Permalink
Post by Leo Vegoda
For articles that appear in web pages I suggest using a service like
Instapaper. It will save them for you and automatically send you an
recent 20 articles. It works a treat.
Already have a good workflow for articles and rss feeds:

articles: kindler (https://github.com/skn/kindler) since I don't like
to bundle all the articles (as instapaper does)
rss feeds: newsbeuter ->pinboard -> kindler

Thanks,
skn
David Champion
2012-04-17 13:58:06 UTC
Permalink
Offhand, the most straightforward way I can think of to do this
without including headers is to use a command designed to filter those
appropriately. Roughly, I'd look at using a macro that pipes to such a
command and then feeds it to another mutt instance to send to Amazon.
Something like:

macro index =k '<pipe-message>enscript -G2r -Email -p- | pstopdf >/tmp/mail.pdf; mutt -s email -a /tmp/mail.pdf -- ***@free.kindle.com </dev/null; rm -f /tmp/mail.pdf<enter>' 'Send as PDF to Kindle'

I haven't tested that, but since I have a Kindle I can work on it if you
have trouble.

There are endless variations if you want text vs pdf, etc, but this
basic formula should work.
--
David Champion • ***@uchicago.edu • IT Services • University of Chicago
SK
2012-04-17 21:51:45 UTC
Permalink
Post by David Champion
Offhand, the most straightforward way I can think of to do this
without including headers is to use a command designed to filter those
appropriately.  Roughly, I'd look at using a macro that pipes to such a
command and then feeds it to another mutt instance to send to Amazon.
I haven't tested that, but since I have a Kindle I can work on it if you
have trouble.
There are endless variations if you want text vs pdf, etc, but this
basic formula should work.
Thanks! I settled on a variation of this for now though, as you said,
I can keep playing with this for some time to get the best result:

macro index,pager \ck
'<pipe-message>~/.mutt/scripts/strip-email-headers.pl| enscript -f
"Times-Roman10" -B -p - | ps2pdf - /tmp/email.pdf; mutt -s convert -a
/tmp/email.pdf -- ***@free.kindle.com </dev/null; rm -f
/tmp/email.pdf<enter>' 'Send as PDF to Kindle'



% cat ~/.mutt/scripts/strip-email-headers.pl

!/usr/bin/perl -w
#
#

while(<>)
{
last if ( /^\s*$/ );
}

print <>;

Continue reading on narkive:
Loading...