sendmail configuration with relay that requires authentication

Posted on

Hello;

my issue is the following one:
Today, I have a Red Hat v5.11 machine that works correctly with postfix: it's able to send email to a generic email adress (mailbox) located on my company email server.

I tried to configure sendmail to perform same action following:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-email-mta-sendmail.html

Almost everything is fine I guess as when trying to send an email as is:
[root@myRHLVM mail]# sendmail -Am -v -t
To: user@mydomain.com (my email adress)
From: root
Subject: test
this is a test

I get this:

EHLO myRHLVM_fqdnname
250-servername Hello [IP adress]
250-SIZE
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-X-ANONYMOUSTLS
250-AUTH NTLM
250-X-EXPS GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250-XEXCH50
250-XRDST
250 XSHADOW
STARTTLS
220 2.0.0 SMTP server ready
EHLO myRHLVM_fqdnname
250-servername Hello [IP adress]
250-SIZE
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH NTLM LOGIN
250-X-EXPS GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250-XEXCH50
250-XRDST
250 XSHADOW
AUTH LOGIN
334 VXNlcm5hbWU6
dmliZXMuMDE=
334 UGFzc3dvcmQ6
S3dyOCohbWJ1Qg==
235 2.7.0 Authentication successful
MAIL From:<root@myRHLVM_fqdnname> SIZE=77 AUTH=root@myRHLVM_fqdnname
250 2.1.0 Sender OK
RCPT To:user@mydomain.com
DATA
250 2.1.5 Recipient OK
354 Start mail input; end with .
.
550 5.7.1 Client does not have permissions to send as this sender
/root/dead.letter... Saved message in /root/dead.letter
Closing connection to relaymailservername
QUIT
221 2.0.0 Service closing transmission channel

I think the issue comes from the fact that emails are outgoing with root email adress from line:
MAIL From:<root@myRHLVM_fqdnname> SIZE=77 AUTH=root@myRHLVM_fqdnname

As in postfix a mapping is done and email are sent as coming from the distant mailbox.

I tried to configure sendmail using genericstables in order email be sent using mailbox adress but it seems to me it doesn't work:
I added:
define(SMART_HOST',relaymailservername)dnl
and
dnl # change identity for outgoing mails
FEATURE(genericstable',hash /etc/mail/genericstable')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')dnl

into sendmail;mc file (of course I restarted the sendmail service)

I also added this into generictables file (also constructed .db file):
root@myRHLVM_fqdnname mygenericmailboxaddress
root mygenericmailboxaddress

but it doesn't work.
Can someone help me please ?

Thanks a lot.

regards;
Guillaume.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.