Docunext


Full Name From Message Header with Mailx

August 16th, 2009

Too bad its not a little easier to get full "From" headers with mailx. Two possibilities:

  • Postfix canonical header rewrites to include full name in message headers (not currently available)
  • Mailrc would grab the information from the passwd getent

Its possible to manually add a customized from message header with mailx on the command line, but for some reason its not possible to set the message header in .mailrc.

I found a workaround here, which creates a wrapper to /usr/lib/sendmail and sets the full name in the from header like this:

.mailrc:

set sendmail=~/bin/mymailx

~/bin/mymailx:

#!/bin/sh
(echo "From: Full Name <full.name@example.com>"; cat ) | /usr/lib/sendmail $@
Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022