2

I'm trying to use ssmtp to send a simple email from a server. There are loads of examples out there for configuring a gmail account and that's what I'm using. My /etc/ssmtp/ssmtp.conf tile contains the line:

mailhub=smtp.gmail.com:587

But when I try and send an email I get the error:

ssmtp: Cannot open mailhub:25

I've not a clue where it's pulling the port 25 from. I had installed postfix thinking of setting it up in satellite mode but removed it for ssmtp, thinking it was simpler given the limited requirements I have. So postfix was removed, don't know if that's had an effect.

heemayl
  • 90,425
  • 20
  • 200
  • 267
jwhitmore
  • 121
  • 2
  • 2
    Based on the answer, I'm reluctantly voting to close this as "a problem that cannot be reproduced." If you can give the full command used to run `ssmtp` (was it just `ssmtp -u`?), I think we should keep this open (or reopen it if closed) as it would show that `-u`, used that way, silently keeps the custom port from being used. Had you run it from an interactive shell? An init script? Most commands give an error or warning when an unrecognized option is passed. I considered editing "I used `-u`" into the question itself, but I don't know the circumstances where produces the described behavior. – Eliah Kagan Oct 07 '17 at 21:52

1 Answers1

0

Aragh...

I was trying to specify a subject with "-u" option. Don't know where I got that from probably another email utility.

ssmtp no subject works fine. Sorry about the noise.

jwhitmore
  • 121
  • 2