Extract a message header field from an 822 message
Usage
lr_smtpfieldfieldname
Overview
The format of an email header, when stored in a traditional var/spool/mail-type mailbox, is
"From <user>" "Field: <something>" ""
lr_smtpfield expects an RFC822 message on stdin or a file containing such a message as it's last argument. It prints the fieldname's value to stdout, if found. Return value is 0 if input was an RFC822 message, 1 if input was not an RFC822 message, 2 if a command line error occured.