1

Is there any CLI email client/program which can read email mailbox file (with single email message) and produce output to stdout main headers and text?

$ mailcmd < email.file
From: [email protected]
Subject: some subject
Message text: Hello world!
2
  • I don't uinderstand, what's the content of email.file?
    – A.B.
    Mar 20, 2016 at 17:52
  • email.file has the same format as /var/mail/user mailbox file. And email.file contains single email message.
    – Dimetry
    Mar 20, 2016 at 18:15

1 Answer 1

2

Possible solution:

mutt -f email.file -e "push <decode-save><Return><Return><quit><Return>"

-e key execute following command
push add key sequences to the keyboard buffer

As result I get file with main headers and plain text from raw mailbox file

When I execute the script under cron or procmail:

export LANG=en_US.UTF-8 && screen -dm mutt -f email.file -e "push <decode-save><Return><Return><quit><Return>"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .