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!
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!
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>"
email.file
?email.file
has the same format as/var/mail/user
mailbox file. Andemail.file
contains single email message.