[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mailutils+nullmailer: sender full name



On Tue, Oct 17, 2023 at 05:43:55PM +0200, Gertjan Klein wrote:
> This works, but the mail
> from address looks like this: "gklein <gklein@parvos.nl>". This irks me.
> My account has my full name configured; why isn't it used? I am testing
> this as follows:
> 
> $ echo "this is a test" | mail -s Subject gklein@parvos.nl
> 
> I am unclear about which of GNU mailutils or nullmailer is responsible
> for this header. I've tried various things the internet suggested; none
> made any difference at all.
> 
> While this is more an annoyance than a showstopper for me, I would like
> the From address to look like "My name <my@address>". Does anyone here
> know which program to persuade, and how to persuade it?

You mean the "From:" header.  This is provided by the MUA (Mail User
Agent), which in your case is whatever program "mail" links to.

On my system, mailx points to bsd-mailx:

unicorn:~$ ls -l /etc/alternatives/mailx
lrwxrwxrwx 1 root root 18 Jan 12  2018 /etc/alternatives/mailx -> /usr/bin/bsd-mailx*

The bsd-mailx(1) documentation is EXTREMELY confusing, and it took
me 8 tries to get this, so I hope you appreciate it:

unicorn:~$ cat .mailrc
set from="Someone <me@wooledge.org>"
unicorn:~$ echo test8 | mailx -s test8 greg@wooledge.org

This generates:

Date: 17 Oct 2023 18:30:46 -0000
From: Someone <me@wooledge.org>
To: greg@wooledge.org
Subject: test8

If you aren't using bsd-mailx, then you will have to figure out how to
do this using whatever implementation you're using.


Reply to: