1

I am using linux "mail" client. When I try to send an email echo "test" | mail -s "testing" myemail@personal.com I receive a 550 error bounce back because the domain is invalid.

On the server there are 2 domains. One is public the other is strictly internal. How do I force only the mail client to use the public domain?

Here is the failure message.

Final-Recipient: RFC822; myemail@personal.com
Action: failed
Status: 5.1.8
Diagnostic-Code: SMTP; 550 5.1.8 Invalid domain: server_hostname.internal.domainname
Last-Attempt-Date: Wed, 12 Feb 2014 12:22:06 -0500
Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
Igor
  • 61
  • 2
  • 10
  • http://stackoverflow.com/questions/119390/specify-the-from-user-when-sending-email-using-the-mail-command ? – dst Feb 12 '14 at 22:32
  • Is there any way to specify this in a configuration rather than command line? We have multiple scripts utilizing the command. – Igor Feb 12 '14 at 22:41
  • Seems like for plain `sendmail` the configuration line is `define('confDOMAIN_NAME', 'example.com')dnl`, but I never worked with it and thus did not test that. – dst Feb 12 '14 at 23:01

1 Answers1

1

The fix ended up by modifying the submit.cf and sendmail.cf in /etc/mail/

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
Djdomain_name

You need to include the Dj which will be followed by the hostname.

Thank you for everyones help.

Igor
  • 61
  • 2
  • 10