mailx syntax

Hello
I need help for this mailx command :

mailx -vvv \
  -r "superlinux" \
  -s "Subject: mailx send mail starttls fullsmtp fullname to some_user@isp.com" \
  -S smtp=smtp.isp.com:587 \
  -S smtp-use-starttls \
  -S smtp-auth=digest-md5  \
  -S smtp-auth-user=4aed0c8909e33260970ca8b0448cc065 \
  -S smtp-auth-password=f92b7d80ddb397a953b8d0748d1478bd \
  -S ssl-verify=ignore \
  some_user@isp.com <<< "some text"

isp mail server accept starttls and accept AUTH CRAM-MD DIGEST-MD

250-STARTTLS
250-AUTH CRAM-MD5 DIGEST-MD5 

When using

-S smtp-auth=digest-md5 

I got this error :

Unknown SMTP authentication method: "digest-md5"

or

Unknown SMTP authentication method: "DIGEST-MD5"

Any help is welcome.

On Wed 04 Jul 2018 01:16:03 PM CDT, jcdole wrote:

Hello
I need help for this mailx command :

Code:

mailx -vvv
-r “superlinux”
-s “Subject: mailx send mail starttls fullsmtp fullname to
some_user@isp.com” \ -S smtp:587=smtp.isp.com
-S smtp-use-starttls
-S smtp-auth=digest-md5
-S smtp-auth-user=4aed0c8909e33260970ca8b0448cc065
-S smtp-auth-password=f92b7d80ddb397a953b8d0748d1478bd
-S ssl-verify=ignore
some_user@isp.com <<< “some text”


isp mail server accept starttls and accept AUTH CRAM-MD DIGEST-MD

Code:

250-STARTTLS
250-AUTH CRAM-MD5 DIGEST-MD5

When using

Code:

-S smtp-auth=digest-md5

I got this error :

Code:

Unknown SMTP authentication method: “digest-md5”

or

Code:

Unknown SMTP authentication method: “DIGEST-MD5”

Any help is welcome.

Hi
From the mailx man page…


smtp-auth
Sets  the  SMTP  authentication method.  If set to
`login', or if unset and smtp-auth-user is set, AUTH LOGIN is used.  If
set to `cram-md5', AUTH CRAM-MD5 is used; if set to `plain', AUTH PLAIN
is used.  Otherwise, no SMTP authentication is performed.

So I would guess it needs to be login,/plain or use imap and would be
cram-md5?


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLES 15 | GNOME Shell 3.26.2 | 4.12.14-23-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

The error come from my local mail server :

Connecting to 192.168.130.80:25 . . . connected.
220 mydomain ESMTP
.........

not from recipient mail server ( smtp.isp.com: ) because I have just forgotten to configure the relayhost parameter on the local mail server.

So the story is not finished.

I finished the configuration, and give news as soon as possible.

After having configured postfix for relaying I am able to send mail using mailx for test.

1°) Add local mail server to /etc/mailrc on sender computer

set smtp=smtp://my_mailsrv.my_domain.net

2°) On the postfix mail server computer verify the /etc/postfix/generic table which contains (left side) the linux user and (right side ) the corresponding ISP user

3°) On the postfix mail server computer verify the /etc/postfix/sasl_passwd table which contains (left side) [smtp.isp_domain] port and (right side ) the corresponding isp user_name@isp_domain:user_password

4°) Use this command on the sender computer (which use smtp parameter which is in /etc/mailrc)

mailx -vvv \
        -r $USER@my_local_domain \
        -s "Subject: mailx send mail my_server_smtp sender_name to user_name@isp_domain" \
        user_name@isp_domain <<< "some text"

Bad parameters in /etc/mailrc prevent mailx to run as needed.
So when doing test check every things.
Obvious isn’t ;).

Any comment is welcome