unixmailx

mailx command giving authentication unsuccessful error even after right credentials


I want to send mail using mailx command, in more specific way.

So, I googled how to use mailx command, I searched some questions and answers on stackoverflow, I found common answer for it which is

mailx -r "fromAddr" -s "subject" toAddr : when i tried this command, it shows me nothing, instead it gone in infinite loop, I guess.

I am seeking information, that which SMTP server is used, what authentication is used, OR from where this command takes default values

Then I write a command by reading this and got the error

I am trying command as follows and getting error (executed with mailx -v option)

$ echo "This is the message body" | mailx -v \
> -r "abc@domain.com" \
> -s "hey, this is test" \
> -S smtp="192.168.XXX.XX:25" \
> -S smtp-use-starttls \
> -S smtp-auth=login \
> -S smtp-auth-user="abc@domain.com" \
> -S smtp-auth-password="xyz123" \
> -S ssl-verify=ignore \
> -S nss-config-dir=/etc/pki/nssdb/ \
> abc@domain.com

Resolving host 192.168.XXX.XX . . . done.
Connecting to 192.168.XXX.XX . . . connected.
220 something.domain.com Microsoft ESMTP MAIL Service ready at (time)
>>> EHLO localhost.localdomain
250-something.domain.com Hello [10.XX.XX.XXX]
250-SIZE 37748736
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-X-ANONYMOUSTLS
250-AUTH
250-X-EXPS GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 XRDST
>>> STARTTLS
220 2.0.0 SMTP server ready
Error in certificate: Issuer certificate is invalid.
Comparing DNS name: "something"
Comparing DNS name: "something.domain.com"
Comparing common name: "something"
host certificate does not match "192.168.XXX.XX"
SSL parameters: cipher=AES-128, keysize=128, secretkeysize=128,
issuer=CN=something
subject=CN=something
>>> EHLO localhost.localdomain
250-something.domain.com Hello [10.XX.XX.XXX]
250-SIZE 37748736
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN
250-X-EXPS GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 XRDST
>>> AUTH LOGIN
334 VXNlcm5hbWU6
>>> YXV0b21hdGlvbl90ZXN0QG5ld3Rlc3QuY29t
334 UGFzc3dvcmQ6
>>> SW5mb3N5czEyMw==
535 5.7.3 Authentication unsuccessful
smtp-server: 535 5.7.3 Authentication unsuccessful
"/home/user-group/user/dead.letter" 11/398
. . . message not sent.

I checked for my credentials, SMTP address for multiple times, they are correct, stil it is showing

smtp-server: 535 5.7.3 Authentication unsuccessful

I am not the root user

Thanks in advance for any suggestions, idea, which will make command executable.


Solution

  • I got this, It was the certificate issue, installed SSL certificate for the domain and it works.