Issue getting ssmtp to work

Hi.

I am trying to send emails via SMTP. I am using Email::Sender::Transport::SMTPS, which internally uses Net::SMTPS. I have installed the mail/ssmtp port by following the steps in http://easyos.net/articles/bsd/freebsd/using_gmail_smtp_to_send_email_in_freebsd. I know that ssmtp works correctly because I receive emails sent with it. The output in verbose mode is:

Code:
[<-] 220 [my email provider SMTP server] SMTP Server ready April 18, 2018 8:23:43 PM PDT
[->] EHLO [hostname]
[<-] 250 SIZE 53477376
[->] STARTTLS
[<-] 220 Ready to start TLS.
[->] EHLO [hostname]
[<-] 250 SIZE 53477376
[->] AUTH LOGIN
[<-] 334 ...
[->] ...
[<-] 334 ...
[<-] 235 Authentication Successful
[->] MAIL FROM:<me@domain.com>
[<-] 250 Sender <me@domain.com> OK
[->] RCPT TO:<recipient@otherdomain.com>
[<-] 250 Recipient <recipient@otherdomain.com> OK
[->] DATA
[<-] 354 Ok Send data ending with <CRLF>.<CRLF>
[->] Received: by [hostname] (sSMTP sendmail emulation); Thu, 19 Apr 2018 03:23:42 +0000
[->] Date: Thu, 19 Apr 2018 03:23:42 +0000
[->] To: recipient@otherdomain.com
[->] From: me@domain.com
[->] Subject: Test
[->]
[->] This is a test for sending
[->]
[->] .
[<-] 250 Message received
[->] QUIT
[<-] 221 [my email provider SMTP server] closing connection

However, when I try to send it with my perl script, Net::SMTPS gives the following debug output:

Code:
Net::SMTPS>>> Net::SMTPS(0.09)
Net::SMTPS>>>   IO::Socket::IP(0.37)
Net::SMTPS>>>     IO::Socket(1.38)
Net::SMTPS>>>       IO::Handle(1.36)
Net::SMTPS>>>         Exporter(5.72)
Net::SMTPS>>>   Net::SMTP(3.10)
Net::SMTPS>>>     Net::Cmd(3.10)
Net::SMTPS=GLOB(0x808f7ca08)<<< 220 [my email provider SMTP server] SMTP Server ready April 18, 2018 8:56:57 PM PDT
Net::SMTPS=GLOB(0x808f7ca08)>>> EHLO [hostname]
Net::SMTPS=GLOB(0x808f7ca08)<<< 250-[my email provider SMTP server] Hello [hostname] ([my IP address] ([my IP address]))
Net::SMTPS=GLOB(0x808f7ca08)<<< 250-STARTTLS
Net::SMTPS=GLOB(0x808f7ca08)<<< 250 SIZE 53477376
Net::SMTPS=GLOB(0x808f7ca08)>>> STARTTLS
Net::SMTPS=GLOB(0x808f7ca08)<<< 220 Ready to start TLS.
Net::SMTPS=GLOB(0x808f7ca08)>>> EHLO [hostname]
Net::SMTPS=GLOB(0x808f7ca08)<<< 250-[my email provider SMTP server] Hello [hostname] ([my IP address] ([my IP address]))
Net::SMTPS=GLOB(0x808f7ca08)<<< 250-AUTH LOGIN PLAIN
Net::SMTPS=GLOB(0x808f7ca08)<<< 250 SIZE 53477376
failed AUTH: [my email provider SMTP server] Hello [hostname] ([my IP address] ([my IP address]))
AUTH LOGIN PLAIN
SIZE 53477376

It seems like when in the perl script, it's not using ssmtp but maybe sendmail? I realiae this might belong in another forum, if so please let me know.

Thanks,
Marc.
 
it's not using ssmtp but maybe sendmail
It's not. You can tell the difference by looking at the banner:
Code:
220 molly.dicelan.home ESMTP Sendmail 8.15.2/8.15.2; Thu, 19 Apr 2018 08:38:57 +0200 (CEST)

The issue seems to be the authentication method that's used.
 
Back
Top