# ssmtp problems - Cannot open 465:465



## jcarlson (Jul 8, 2010)

I'm running 7.2 and for some simple reason I'm unable to send mail out using ssmtp. 
I can ping the mailhub. I'm not sure which port I should use- someone said 465 instead of 25
if I execute 
	
	



```
ssmtp jcarlson@carlsonwireless.com < test &
```
then after 2 minutes I get 
	
	



```
ssmtp: Cannot open 465:465
```



```
fb72core# ping mail.carlsonwireless.com
PING mail.carlsonwireless.com (69.5.28.46): 56 data bytes
64 bytes from 69.5.28.46: icmp_seq=0 ttl=55 time=107.702 ms
```
ssmtp.conf 


```
Debug=YES
root=jcarlson@carlsonwireless.com
mailhub=mail.carlsonwireless.com:465
rewriteDomain=carlsonwireless.com
hostname=fb72core.carlsonwireless.com
FromLineOverride=YES
UseTLS=YES
#UseTLSCert=YES
#TLSCert=/usr/local/etc/ssmtp/ssmtp.pem
```

I'm sure its a simple answer and I just don't see it. 
My appreciation in advance for any help.


----------



## aragon (Jul 8, 2010)

Can you check your mail log for error messages?  Paste them here if they don't answer your question.


----------



## jcarlson (Jul 8, 2010)

```
Jul  8 00:00:00 fb72core newsyslog[1828]: logfile turned over
Jul  8 00:12:32 fb72core sm-mta[1848]: o67JnDRf007479: to=<jcarlson@carlsonwireless.com>, ctladdr=<root@fb72core.carlsonwireless.com> (0/0), 
delay=11:23:19, xdelay=00:03:44, mailer=esmtp, pri=2190425, relay=carlsonwireless.com. [169.254.195.138], dsn=4.0.0, stat=Deferred: Operation 
timed out with carlsonwireless.com.
```
As you can see my area of expertise is not in the OS, I've mostly worked in the atheros driver space.


----------



## aragon (Jul 8, 2010)

Run the test again and check your mail log immediately after it fails.  ssmtp logs additional information there.

I've tried to reproduce this using your mail server and ssmtp config, but I can't.


```
$ ssmtp noone@nowhere.org </tmp/test
ssmtp: RCPT TO:<noone@nowhere.org> (553 SMTP Relaying Denied: Visit http://www.error-553.net for more info.)

$ cat /tmp/test
From: <aragon@x>
To: <noone@x>
Subject: test

test

$ tail /var/log/maillog
Jul  8 18:59:12 <mail.info> igor sSMTP[13994]: Creating SSL connection to host
Jul  8 18:59:13 <mail.info> igor sSMTP[13994]: SSL connection using AES256-SHA
Jul  8 18:59:14 <mail.info> igor sSMTP[13994]: 220 x46.futurequest.net mailfront ESMTP
Jul  8 18:59:14 <mail.info> igor sSMTP[13994]: HELO fb72core.carlsonwireless.com
Jul  8 18:59:14 <mail.info> igor sSMTP[13994]: 250 x46.futurequest.net
Jul  8 18:59:14 <mail.info> igor sSMTP[13994]: MAIL FROM:<aragon@x>
Jul  8 18:59:15 <mail.info> igor sSMTP[13994]: 250 2.1.0 Sender accepted.
Jul  8 18:59:15 <mail.info> igor sSMTP[13994]: RCPT TO:<noone@x>
Jul  8 18:59:15 <mail.info> igor sSMTP[13994]: 553 SMTP Relaying Denied: Visit http://www.error-553.net for more info.
Jul  8 18:59:15 <mail.err> igor sSMTP[13994]: RCPT TO:<noone@nowhere.org> (553 SMTP Relaying Denied: Visit http://www.error-553.net for more info.)
```


----------



## jcarlson (Jul 8, 2010)

I'm very appreciative of the assistance. 
here is additional info:

```
fb72core# cat /etc/rc.conf

# -- sysinstall generated deltas -- # Tue Oct 27 17:58:15 2009
# Created: Tue Oct 27 17:58:15 2009
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
defaultrouter="192.168.1.3"
hostname="fb72core.carlsonwireless.com"
ifconfig_ed0="inet 192.168.1.34  netmask 255.255.255.0"
linux_enable="YES"
moused_enable="YES"
sshd_enable="YES"
# -- sysinstall generated deltas -- # Wed Oct 28 02:14:55 2009
sendmail_enable="NO"
send_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
linux_enable="YES"
lpd_enable="NO"
nis_server_enable="NO"
nis_client_enable="NO"
rpcbind_enable="YES"
nfs_server_enable="YES"
nfs_client_enable="YES"

fb72core# cat /tmp/test
From: <jcarlson@carlsonwireless.com>
To: <jcarlson@carlsonwireless.com>
Subject: test

test

fb72core# ssmtp jcarlson@carlsonwireless.com </tmp/test
[after 2 minutes with no prompt return]
ssmtp: Cannot open 465:465  

fb72core# tail -n 30 /var/log/maillog
Jul  8 12:24:13 fb72core sSMTP[1053]: Set Root="jcarlson@carlsonwireless.com"
Jul  8 12:24:13 fb72core sSMTP[1053]: Set MailHub="mail.carlsonwireless.com"
Jul  8 12:24:13 fb72core sSMTP[1053]: Set RemotePort="465"
Jul  8 12:24:13 fb72core sSMTP[1053]: Set RewriteDomain="carlsonwireless.com"
Jul  8 12:24:13 fb72core sSMTP[1053]: Set HostName="fb72core.carlsonwireless.com"
Jul  8 12:24:13 fb72core sSMTP[1053]: Set FromLineOverride="True"
Jul  8 12:24:13 fb72core sSMTP[1053]: Set UseTLS="True"
Jul  8 12:24:13 fb72core sSMTP[1053]: Set MailHub="465"
Jul  8 12:24:13 fb72core sSMTP[1053]: via SMTP Port Number="465"
Jul  8 12:25:28 fb72core sSMTP[1053]: Unable to connect to "465" port 465.
Jul  8 12:25:28 fb72core sSMTP[1053]: Cannot open 465:465
fb72core#
```

I included the rc.conf in case that was any help.


----------



## aragon (Jul 8, 2010)

In rc.conf, "send_submit_enable" should be "sendmail_submit_enable".



```
Jul  8 12:24:13 fb72core sSMTP[1053]: Set MailHub="465"
```

This is a problem.  Check your ssmtp config for two mailhub directives.  I presume you're running 2.62.3?


----------



## jcarlson (Jul 8, 2010)

```
fb72core# ssmtp -V
sSMTP 2.62.3 (Not sendmail at all)

fb72core# cat /etc/rc.conf

# -- sysinstall generated deltas -- # Tue Oct 27 17:58:15 2009
# Created: Tue Oct 27 17:58:15 2009
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
defaultrouter="192.168.1.3"
hostname="fb72core.carlsonwireless.com"
ifconfig_ed0="inet 192.168.1.34  netmask 255.255.255.0"
linux_enable="YES"
moused_enable="YES"
sshd_enable="YES"
# -- sysinstall generated deltas -- # Wed Oct 28 02:14:55 2009
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
linux_enable="YES"
lpd_enable="NO"
nis_server_enable="NO"
nis_client_enable="NO"
rpcbind_enable="YES"
nfs_server_enable="YES"
nfs_client_enable="YES"

fb72core# cat /usr/local/etc/ssmtp/ssmtp.conf
#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#

Debug=YES
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=jcarlson@carlsonwireless.com

#AuthUser=jcarlson

# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and your mailhub is so named.
# Secure SMTP (SSMTP) - port 465

mailhub=mail.carlsonwireless.com:465

# Example for SMTP port number 2525
# mailhub=mail.your.domain:2525
# Example for SMTP port number 25 (Standard/RFC)
# mailhub=mail.your.domain        
# Example for SSL encrypted connection
# mailhub=mail.your.domain:465

# Where will the mail seem to come from?
rewriteDomain=carlsonwireless.com

# The full hostname
hostname=fb72core.carlsonwireless.com

# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
FromLineOverride=YES

# Use SSL/TLS to send secure messages to server.
UseTLS=YES

# Use SSL/TLS certificate to authenticate against smtp host.
#UseTLSCert=YES

# Use this RSA certificate.
#TLSCert=/usr/local/etc/ssmtp/ssmtp.pem
```

I corrected rc.conf and rebooted, am running SMTP 2.62.3, only have one mailhub=mail.carlsonwireless.com:465
 directive. 

I tried to do an update but my system keep looking for older files 

```
fb72core# cd /usr/ports/mail/ssmtp/
fb72core# make install
If you don't want to let your users set their own revalias address
(in ~/.ssmtprc), please define WITHOUT_USERPREFS.
===>  Vulnerability check disabled, database not found
=> ssmtp_2.61.orig.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from http://www.gtlib.cc.gatech.edu/pub/debian/pool/main/s/ssmtp/.
fetch: http://www.gtlib.cc.gatech.edu/pub/debian/pool/main/s/ssmtp/ssmtp_2.61.orig.tar.gz: Not Found
=> Attempting to fetch from ftp://ftp.us.debian.org/debian/pool/main/s/ssmtp/.
fetch: ftp://ftp.us.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.61.orig.tar.gz: File unavailable (e.g., file not found, no access)
=> Attempting to fetch from ftp://ftp.au.debian.org/debian/pool/main/s/ssmtp/.
```

note that after entering "ssmtp jcarlson@carlsonwireless.com < /tmp/test " 
the console hangs for 2 minutes until 
"ssmtp: Cannot open 465:465"
is printed. 
top shows the ssmtp process running during this 2 min time interval.   Is that normal?


----------



## aragon (Jul 9, 2010)

jcarlson said:
			
		

> top shows the ssmtp process running during this 2 min time interval.   Is that normal?


No, it should be almost instant.  It's taking a long time because it's trying to connect to "465" instead of mail.carlsonwireless.com.  No idea why.  Unreproducible here.  Let us know if you figure it out...


----------



## jcarlson (Jul 10, 2010)

*Solved*

[solved]
The problem happened after revaliases was parsed it concatenated the port number to the mailhub - Much thanks Aragon - Jim


----------

