6

I am using mailx command to send mail, I tried it by two ways..

mailx -s "This is Subject" toAddr < bodyFile.txt
mailx -r "fromAddr" -s "This is Subject" toAddr < bodyFile.txt

I am getting same error:

send-mail: fatal: parameter inet_interfaces: no local interface found for ::1

I want to know how to resolve that error as well as following things:

  • What does mailx takes fromAddress by default?
  • What does mailx takes Mail Transfer Agent address by default?
  • From where to change these values?
2
  • Have you disabled IPv6 with kernel settings?When you disable IPv6, some applications configurations have to be adjusted and IPv6 disabled there too. Commented Oct 7, 2016 at 8:21
  • I don't have permissions to disable IPv6 Commented Oct 13, 2016 at 5:11

3 Answers 3

8
# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)

# more  /var/log/maillog
Sep  1 17:07:50 izuf6cj2o216xp postfix/sendmail[25307]: fatal: parameter inet_interfaces: no local interface found for ::1

Solved it:

vim /etc/postfix/main.cf
#inet_interfaces = localhost
inet_interfaces = all

then

service postfix start
3

Mailx is just a command-line tool to pass mail to your Mail Transfer Agent (MTA; whatever it is you have installed: sendmail, exim, ...). It does this by invoking the command sendmail (usually /usr/sbin/sendmail). Your MTA provides this command to, well, send mail.

In your case, it tries to contact a server on the IPv6 address of the loopback device on localhost (::1), and can't find anything. So either your MTA is not configured correctly (uses IPv6 instead of IPv4), or your IPv6 networking setup is not correct (no ::1 address on loopback interface).

The default from-address is your username, and the MTA adds whatever domain name you have configured in your MTA (and may further rewrite this according to various criteria like which mail server it contacts to deliver the mail, if you've set up rules for it).

You change these values by configuring your MTA.

I don't understand the question "what does mailx takes MTA address by default". If you mean "which MTA does it use", as I said, it just invokes the sendmail command, so it uses whatever MTA package you have installed that provides this command.

6
  • Can I consider there is a MTA installed for sure if I have sendmail command?? Commented Nov 17, 2016 at 6:52
  • @firoj_mujawar: It's often a symbolic link, so I'd do an ls -l /usr/bin/sendmail and look closely at where it links to ... You still may have some package installed that simulates some part of sendmail (like "local delivery only"), but isn't a full MTA.
    – dirkt
    Commented Nov 17, 2016 at 6:58
  • atfer doing ls -l /usr/sbin/sendmail it shows "lrwxrwxrwx. 1 root root 21 Nov 18 2015 /usr/sbin/sendmail -> /etc/alternatives/mta" Is this the full MTA or something else as it lies in etc/alternatives Commented Nov 17, 2016 at 7:21
  • @firoj_mujawar: That means you use Debian or a Debian based system like Ubuntu, you have several MTA-like packages installed, and now you have to do a ls -l /etc/alternatives/mta to find out where it really points to. See e.g. Debian Alternatives System.
    – dirkt
    Commented Nov 17, 2016 at 7:30
  • I done that and found it points to "/usr/sbin/sendmail.sendmail" and i also done ls -l /usr/sbin/sendmail.sendmail then it shows the info about that, it points to itself i guess. I searched for my system distributor details, I got it as RedHatEnterpriseServer(i am working on putty terminal) Commented Nov 17, 2016 at 7:52
1

Probably you don't have a properly configured local MTA running which mailx wants to use by default.

You can use mailx to directly send email via your public smtp account.

echo "This is the text." | \
  env MAILRC=/dev/null  \
  from=from@your_domain  \
  smtp=your_smtp_server:port  \
  smtp-auth-user=your_login  \
  smtp-auth-password=your_pwd  \
  smtp-auth=login \
  smtp-use-starttls=yes  \
  mailx -n -s "test 1" to@domain

Or install and setup a local MTA like postfix or exim. Nowadays some distros don't install MTAs by default anymore.

4
  • It is showing me: Missing "nss-config-dir" variable. Commented Oct 14, 2016 at 12:17
  • @user3373857 Maybe this could help you stackoverflow.com/questions/16799407/…
    – rudimeier
    Commented Oct 14, 2016 at 12:27
  • I have seen that, and i have given that variable value also, but new problem is "host certificate does not match to smtp.server.com" Commented Oct 17, 2016 at 4:50
  • Because of that certificate issue, it is showing Authentication unsuccessful even when I provided right credentials Commented Oct 17, 2016 at 4:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .