0

I have an EC2 instance using Ubuntu 14.04 which is where I want to send email from. I tested it by sending an email:

echo "This is the body of the email" | mail -s "This is the subject line " myemailid@gmail.com

But it gave me an error:

Segmentation fault (core dumped)

I checked /var/log/syslog and found this:

Sep 25 09:26:47 my-server-hostname kernel: [321695.640722] mail[7863]: segfault at c0 ip 00007f58c4d5318e sp 00007ffdfc146f90 error 4 in libmailutils.so.4.0.0[7f58c4ccf000+a9000]

What should i do to fix this?

I don't know if this is relevant to this question, but I used a dynamic DNS address from duckdns and during the postfix setup,

I entered "mydomainname.duckdns.org" in the 'System mail name' field.

Dave M
  • 4,514
  • 22
  • 31
  • 30
cgifox
  • 101
  • 1

2 Answers2

0

First of all, your error messages show the segmentation fault is not happening in Postfix, but in the mail command, more precisely in the shared library libmailutils.so which it uses.

Normally a segmentation fault indicates a software bug and the next step would be either to report the problem to the program author or to run the program in a debugger to find out exactly where the fault is happening. But the mail program is so widely used that such a bug seems improbable, and I'd rather suspect a damaged binary file.

Consequently, as a first step I'd recommend to reinstall both the mail command and the libmailutils.so shared library to see if the error goes away. Also check if the system is current on updates.

Tilman Schmidt
  • 4,101
  • 12
  • 27
  • Reinstalled, still getting the same error – cgifox Sep 25 '16 at 11:32
  • Did you reboot the server? Sometimes stale copies of shared libraries remain in memory after an update. – Tilman Schmidt Sep 25 '16 at 11:44
  • Restarted and tried again, still getting a segfault.. – cgifox Sep 25 '16 at 11:59
  • Strange. If you have some idea of programming you might try getting a backtrace from the core dump with `gdb` and/or to run the `mail` command under `strace` to get an idea where and why it is dying. Otherwise I fear your only option is to report a bug to Ubuntu. – Tilman Schmidt Sep 25 '16 at 12:14
  • Hmm... i have programming experience,but not with C/C++ and linux....i think i'll just report the bug... – cgifox Sep 25 '16 at 12:15
  • Also, i was browsing around for other ways to send email, and i found the 'sendmail' command and that seems to work!! Does sendmail work with mailutils or is it completely different? If i just want to use sendmail, can i uninstall the mailutils package? – cgifox Sep 25 '16 at 12:17
  • The `sendmail` command is indeed completely different. In your case, since you installed `postfix` it is part of the `postfix` package. (There's an alternative mail server package called `sendmail`, too, which would of course bring its own version of the `sendmail` command, but you won't want that.) So you can uninstall the `mailutils` package if you don't need it for anything else. – Tilman Schmidt Sep 25 '16 at 12:21
-1

I was facing the same error while switching to root user & this link helped me to address the issue.

Actually there were some changes made to root’s bash profile “/root/.bashrc” and i reverted the changes as mentioned in above link.

Santosh Garole
  • 453
  • 1
  • 4
  • 11
  • Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Gerald Schneider May 12 '20 at 07:03