Mutt returns error from cmd line: Bad IDN in "from":

6.4k views Asked by At

When trying to issue this command to send a file attachment from the command line I'm getting an error:

Bad IDN in "from": 'sd3.È'

sd3 is the name of my host.

The command I'm executing is:

echo "See attached file" | /usr/bin/mutt -a file.txt -s File:file.txt -- [email protected]

I recently cloned an existing Centos7 server (made a copy of the virtual machine and spawned it as a second instance under a different IP) and everything has been working perfectly for awhile as far as I can tell. Not sure if that's relevant to this but it could be an indicator of what needs adjusting.

On the original server I cloned, I can run this command on without any error. I uninstalled mutt and re-installed it and I'm still getting the error.

.muttrc looks like this:

set mbox_type=Maildir
set folder="~/Maildir"
set mask="!^\\.[^.]"
set mbox="~/Maildir"
set record="+.Sent"
set postponed="+.Drafts"
set spoolfile="~/Maildir"

I also compared the /etc/Muttrc and /etc/Muttrc.local files and they're identical between the two systems. (Muttrc.local is empty)

Running the latest version of Mutt under CentOS7: Mutt 1.5.21 (2010-09-15)

So on two almost-identical servers, one runs, one doesn't. Any ideas what might be wrong?

6

There are 6 answers

0
Trent Three On

After a ton of research, there appears to be some obscure bugs that are still in this stable version of mutt - which is the standard package release on CentOS7.

First I removed my old version:

yum remove mutt.x86_64

I ended up downloading the latest source of mutt, 1.9.0 from mutt.org and manually compiling and installing it.

In order to compile the source version of Mutt, I also needed to run:

 yum install ncurses-devel

Now the command works without this "bad IDN" error.

0
TPaine On

I ran into this working through some automated system builds (Centos7, Mutt 1.5.21).

Using strace and some other debugging it wasn't entirely clear what the issue was, but seemed to be circling dns/domain/hostname issues. I as able to get around/recreate the error by adding/remove the "search " in the /etc/resolv.conf file (works WITH a search domain).

Without a search domain, rendered the: Bad IDN in "from": ... error

0
KineTiKon On

Setting the following environment variables worked for me.

[email protected]
REPLYTO=$EMAIL
export EMAIL REPLYTO
0
CJAtl404 On

It appears CentOS 7.3 had mutt-1.5.21-26.el7.x86_64 and CentOS 7.4 now has mutt-1.5.21-27.el7.x86_64.

If you don't want to compile/install from source, I found that a Fedora 22 version (mutt-1.6.2-1.fc22.x86_64.rpm) works OK. I just removed the rpm that came from CentOS 7.4 and did a local install of the Fedora 22 rpm.

0
shosaco On

I encountered the same problem and it was simply solved by setting the from variable in ~/.muttrc (in fact, the file didn't exist before and this is the only thing my .muttrc contains now):

set from="[email protected]"

0
Kousuke On

I was smashing my head the entire day on this issue as I'm not permitted allow to installed outside of redhat repo

I found a workaround that is using option -x

-x Emulate the mailx compose mode.

echo "This is a test message" | mutt -x -s "Test Mail" [email protected]