I'm trying to send emails from an ubuntu-server (14.04.2 LTS) via the command-line and later inside small scripts. To do so, I want to use ssmtp with an external mailserver, inside the network, that doesn't need any authentication. Meaning there is a smtp-server (external-server.com:25
) on another host, which I want to use to send mails. Since my host and the smtp-server are in the same network I can access the smtp-server without any authentication.
Therefore I configured ssmtp to use that external server, here is my ssmtp.conf:
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
[email protected]
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=external-server.com:25
# Where will the mail seem to come from?
rewriteDomain=external-server.com
# The full hostname
#hostname=
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
#FromLineOverride=YES
#Settings for sending logfiles as [email protected]
[email protected]
AuthPass=
UseTLS=YES
UseSTARTTLS=YES
I can now call ssmtp [email protected]
and type in a message like this:
To: [email protected]
From: [email protected]
Subject: Test
Lorem ipsum ...
If I now hit Ctrl+D simply nothing happens, I can literally wait for minutes. Also Ctrl+C seems to be ignored. Just Ctrl+Z works.
The mail.err
-log is empty and mail.log
just states
Mar 23 14:53:50 ubuntu-server sSMTP[2810]: Creating SSL connection to host
I also verified, that a connection is started using tcpdump. Therefore the only problem I can point out is, that Ctrl+D seems to be ignored. Does anyone know this problem or even better a solution?
EDIT
Actually the problem was, that the AuthUser
field wasn't empty and that other subnets were allowed to use the smtp-server, but not my subnet.
It was also very to uncomment FromLineOverride=YES, thus users could use their own mailaddresses.
Ctrl + D
I was also still able to type characters after pressingCtrl + D