Home > UNIX > Set the display name in Mutt

Set the display name in Mutt

A while back I posted instructions on how to use MUTT to send email attachments and specify from address. This is an addition to that post.

The previous instructions work good. The only problem I have run into is the “real” or “personal” name of the sender.  One of my users noticed that emails sent out would show their username in the recipients mail client. To fix this I had to set another variable: realname.

Here is an example of the original code I used:

mutt -e ’set from=fromaddress@test.com’ -s ’subject’ -a file.pdf toaddress@test.com < body.txt

Here is an example of the new code including the set realname:

mutt -e ’set from=fromaddress@test.com realname=”Test User”’ -s ’subject’ -a file.pdf toaddress@test.com < body.txt

As you can see I put the variable after the set comand just like the from variable. The quotes are only neccesary if there is a space in the realname. Here is how the from field shows in a mail client now (Outlook 2007 in this case):

Test User [fromaddress@test.com]

The first part of this is what was set using the new code. If this is not specified MUTT will populate the real name from the GCOS field in /etc/passwd.

Chapter 6 of the MUTT documentation has greater detail for command line options.

Categories: UNIX
  1. Pankaj
    March 19, 2012 at 06:02

    Great !!!,

    You explained the things very nicely, Will definitely read all your Unix posts this weekend.

    Thanks a lot.

  2. Anand
    June 22, 2012 at 05:40

    Thanks a lot. This post was very helpful and saved me tons of research and lots of time 🙂

  3. super hero
    June 4, 2015 at 08:15

    thank you, it was very helpful…

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: