Configure sendmail with SMTP

Hello,

I'm trying to configure sendmail with SMTP authentication on a SunOS 5.11 operating system. I have been read various documentation / tutorials and unfortunately is not working. I need help from someone who has configured smtp on this operating system.

When I try to send a mail, I have the following error:

The following addresses had permanent fatal errors -----
<username&test.com>

----- Transcript of session follows -----
550 5.1.2 <username&test.com>... Host unknown (Name server: mailhost.localhost.localhost.com: host not found)



--w5RL4kWQ029892.1530133486/localhost.localhost.com
Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localhost.com
Received-From-MTA: DNS; localhost
Arrival-Date: Thu, 28 Jun 2018 00:04:46 +0300 (EEST)

Final-Recipient: RFC822; username&test.com
Action: failed
Status: 5.1.2
Remote-MTA: DNS; mailhost.localhost.localhost.com
Last-Attempt-Date: Thu, 28 Jun 2018 00:04:46 +0300 (EEST)

--w5RL4kWQ029892.1530133486/localhost.localhost.com

I've looked into the sendmail configuration files to change host mailhost.localhost.localhost.com with my smtp server, but it does not exist.

In /etc/mail/sendmail.cf to the line

# "Smart" relay host (may be null)
DS

... where is DS we put the smtp server, I restarted the services and unfortunately the hostname does not change.

Thanks in advance.

Can you show us the command you are using to send the mail? (The actual command, not a call to a script that has it embedded)

The output might suggest that you are trying to write to username&test.com and perhaps that should be username@test.com

It might be that simple, but if you can show us, then we will be better placed to help.

Kind regards,
Robin

@rbatte1

Thank you for your answer.

To send emails i am using the command sendmail & mailx echo "This is the test message" | sendmail -v -r "test@localhost.com" username@test.com
As you can see the error message, don't have anything to do whit the email address. (Name server: mailhost.localhost.localhost.com: host not found)

I put my self & becose forum wont let me put @ and cant open a new thread.

---------- Post updated at 12:55 AM ---------- Previous update was at 12:55 AM ----------