3

Arch Linux x86
Heirloom mailx

From what I know, the mailx utility is supposed to read and send email. I somehow got it to work with sending and receiving mail with a gmail account, also using fetchmail.

So I apparently have an email with picture attachments in my mailbox, it displays fine on the native Gmail AJAX. Keeping with Unix tradition to deter absolute beginners, it does not explain anywhere in the manual pages how to read attachments. When I display the email it says:

Part 3:
Content-Type: application/octet-stream;
        charset="gbk";
        name="123.jpg"
Content-Disposition: attachment; filename="123.jpg"

Yes it does explain how to send them, but what use is that if one couldn't read them in the first place? All it needs is something like

& cat 123.jpg > foo

I also googled this and I think I'm just about the first person to ask this anywhere. Even if this answer is braindead simple, the point of all this is that I as a beginner could not retrieve this answer by myself, which I find surprising on something so simple as this.

And no, don't suggest GUI monolithic clients.

slhck
  • 235,242
kaykun
  • 173

2 Answers2

2

Have you read the mailx manpage (archived, active) ?  Look for the write (w) command. This can write attachments.

Turbo J
  • 2,009
1

Easiest solution i found was extract base64 code from email and then decode it. After decode it promt me to download binary file and all i had to do was give it right extension http://www.freeformatter.com/base64-encoder.html

qwerty
  • 111