0

OS: xUbuntu 22.04

I am trying to setup the ability to send emails from the cli (and once successful, use for cron jobs and scripts).

Although the majority of help out there is for setting up smtp.gmail.com:587, I don't have a gmail account, and so I am trying to run emails thru smtp.elasticemails.com:2525.

I have installed and config'd ssmtp as follows:

/etc/ssmtp/ssmtp.config:

#TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt
[email protected]
#mailhub=smtp.elasticemail.com:25
#mailhub=smtp.elasticemail.com:465
#mailhub=smtp.elasticemail.com:587
mailhub=smtp.elasticemail.com:2525
hostname=home2.me
[email protected]
AuthPass=************************
useSTARTTLS=yes
useTLS=yes
FromLineOverride=yes

/etc/ssmtp/revaliases:

root:[email protected]:smtp.elasticemail.com:2525

And when I try to send an email from the cli, it looks promising:

xxxxxx@home2:~$ echo "Test message from Linux server using ssmtp" | sudo ssmtp -vvv [email protected]
[<-] 220 smtp.elasticemail.com ESMTP
[->] EHLO home2.me
[<-] 250 OK
[->] STARTTLS
[<-] 220 Begin TLS negotiation
[->] EHLO home2.me
[<-] 250 OK
[->] AUTH LOGIN
[<-] 334 VXNlcm5hbWU6
[->] bXVya3JlbGxAcHJvdG9ubWFpbC5jb20=
[<-] 334 UGFzc3dvcmQ6
[<-] 235 Authentication successful
[->] MAIL FROM:<[email protected]>
[<-] 250 OK
[->] RCPT TO:<[email protected]>
[<-] 250 OK
[->] DATA
[<-] 354 Begin send data. End with CRLF.CRLF
[->] Received: by home2.me (sSMTP sendmail emulation); Sat, 18 May 2024 03:00:04 -0500
[->] From: "root" <[email protected]>
[->] Date: Sat, 18 May 2024 03:00:04 -0500
[->] Test message from Linux server using ssmtp
[->] 
[->] .
[<-] 250 OK dd18f546-858a-4042-e046-acb37b9c3996
[->] QUIT
[<-] 221 Good bye

But the msg never arrives. However, there is nothing in /var/logs/mail.log that points to anything concerning (most recent logs for the echo mail msg above that never arrives at the Inbox of the TO email addy in the echo command):

May 18 03:00:04 home2 sSMTP[362829]: Creating SSL connection to host
May 18 03:00:05 home2 sSMTP[362829]: SSL connection using ECDHE_RSA_AES_256_GCM_SHA384
May 18 03:00:06 home2 sSMTP[362829]: Sent mail for [email protected] (221 Good bye) uid=0 username=root outbytes=406

BTW, I seem to need to run the piped ssmtp command as sudo or I get errors in verbose output as well as in logs:

...
235 Authentication successful
[->] MAIL FROM:<[email protected]>
[<-] 553 Envelope FROM '[email protected]' email address not allowed.
ssmtp: 553 Envelope FROM '[email protected]' email address not allowed.

/var/logs/mail.log:

May 18 03:16:44 home2 sSMTP[363545]: Creating SSL connection to host
May 18 03:16:45 home2 sSMTP[363545]: SSL connection using ECDHE_RSA_AES_256_GCM_SHA384
May 18 03:16:45 home2 sSMTP[363545]: 553 Envelope FROM '[email protected]' email address not allowed.

It looks as though I am knocking on the door but just not able to get through yet. Any ideas what I might be missing by looking at the configs, commands, and logs included above? Thanks

0

You must log in to answer this question.

Browse other questions tagged .