# ssmtp issue.



## j0 (Dec 31, 2010)

Hi,

Actually am trying/searching alot around to find out or remmeber what i did to have this issue in my fresh box mailer but i cannot remmeber what did i do with sendmail configuration.

so i decide to go through sSMTP and replace it with sendmail... and still cannot open any port such like 25/465/993 etc.. as i can send email from webmail, but cannot send the email from Thunderbird ..


```
j0# kldstat
Id Refs Address    Size     Name
 1    8 0xc0400000 a220cc   kernel
 2    1 0xc0e23000 19cc     accf_data.ko
 3    1 0xc0e25000 2464     accf_http.ko
 4    1 0xc0e28000 3128     vmxnet.ko
 5    1 0xc0e2c000 6a500    acpi.ko
 6    1 0xc2a76000 4000     vmmemctl.ko
j0#
```


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

the ssmtp conf


```
Debug=YES
root=j0@XoX.com
mailhub=mail.XoX.com:465
rewriteDomain=XoX.com
#FromLineOverride=YES
hostname=j0.XoX.com
# Use SSL/TLS to send secure messages to server.
#UseTLS=YES
UseSTARTTLS=YES

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

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



```
j0# tail -F /var/log/maillog
Dec 31 20:23:31 j0 sSMTP[1994]: Set RewriteDomain="XoX.com"
Dec 31 20:23:31 j0 sSMTP[1994]: Set HostName="j0.XoX.com"
Dec 31 20:23:31 j0 sSMTP[1994]: Set UseSTARTTLS="True"
Dec 31 20:23:31 j0 sSMTP[1993]: Cannot open mail.XoX.com:465
Dec 31 20:23:31 j0 sSMTP[1994]: Unable to locate mail.XoX.com
Dec 31 20:23:31 j0 sSMTP[1994]: Cannot open mail.XoX.com:465
```



```
j0# sockstat -4
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
dovenull imap-login 2035  4  tcp4   *:143                 *:*
dovenull imap-login 2035  5  tcp4   *:993                 *:*
j0       sshd       2014  3  tcp4   serveripaddress:9796    92.241.36.211:8188
root     sshd       2011  3  tcp4   serveripaddress:9796    92.241.36.211:8188
apache   httpd      2010  3  tcp4 6 *:80                  *:*
apache   httpd      2010  4  tcp4   *:*                   *:*
apache   httpd      2010  5  tcp4 6 *:443                 *:*
apache   httpd      2010  6  tcp4   *:*                   *:*
bind     named      2005  20 tcp4   serveripaddress:53      *:*
bind     named      2005  21 tcp4   serveripaddress.no.2:53      *:*
bind     named      2005  22 tcp4   127.0.0.1:53          *:*
bind     named      2005  23 tcp4   127.0.0.1:953         *:*
bind     named      2005  512 udp4  serveripaddress:53      *:*
bind     named      2005  513 udp4  serveripaddress.no.2:53      *:*
bind     named      2005  514 udp4  127.0.0.1:53          *:*
mysql    mysqld     1489  11 tcp4   *:3306                *:*
root     inetd      1454  5  tcp4   *:23                  *:*
apache   httpd      1205  3  tcp4 6 *:80                  *:*
apache   httpd      1205  4  tcp4   *:*                   *:*
apache   httpd      1205  5  tcp4 6 *:443                 *:*
apache   httpd      1205  6  tcp4   *:*                   *:*
apache   httpd      1204  3  tcp4 6 *:80                  *:*
apache   httpd      1204  4  tcp4   *:*                   *:*
apache   httpd      1204  5  tcp4 6 *:443                 *:*
apache   httpd      1204  6  tcp4   *:*                   *:*
apache   httpd      1203  3  tcp4 6 *:80                  *:*
apache   httpd      1203  4  tcp4   *:*                   *:*
apache   httpd      1203  5  tcp4 6 *:443                 *:*
apache   httpd      1203  6  tcp4   *:*                   *:*
apache   httpd      1202  3  tcp4 6 *:80                  *:*
apache   httpd      1202  4  tcp4   *:*                   *:*
apache   httpd      1202  5  tcp4 6 *:443                 *:*
apache   httpd      1202  6  tcp4   *:*                   *:*
apache   httpd      1201  3  tcp4 6 *:80                  *:*
apache   httpd      1201  4  tcp4   *:*                   *:*
apache   httpd      1201  5  tcp4 6 *:443                 *:*
apache   httpd      1201  6  tcp4   *:*                   *:*
root     httpd      1151  3  tcp4 6 *:80                  *:*
root     httpd      1151  4  tcp4   *:*                   *:*
root     httpd      1151  5  tcp4 6 *:443                 *:*
root     httpd      1151  6  tcp4   *:*                   *:*
dovenull imap-login 1057  4  tcp4   *:143                 *:*
dovenull imap-login 1057  5  tcp4   *:993                 *:*
dovenull imap-login 1056  4  tcp4   *:143                 *:*
dovenull imap-login 1056  5  tcp4   *:993                 *:*
dovenull imap-login 1055  4  tcp4   *:143                 *:*
dovenull imap-login 1055  5  tcp4   *:993                 *:*
dovenull imap-login 1054  4  tcp4   *:143                 *:*
dovenull imap-login 1054  5  tcp4   *:993                 *:*
dovenull imap-login 1053  4  tcp4   *:143                 *:*
dovenull imap-login 1053  5  tcp4   *:993                 *:*
dovenull imap-login 1052  4  tcp4   *:143                 *:*
dovenull imap-login 1052  5  tcp4   *:993                 *:*
dovenull imap-login 1051  4  tcp4   *:143                 *:*
dovenull imap-login 1051  5  tcp4   *:993                 *:*
dovenull imap-login 1050  4  tcp4   *:143                 *:*
dovenull imap-login 1050  5  tcp4   *:993                 *:*
dovenull imap-login 1048  4  tcp4   *:143                 *:*
dovenull imap-login 1048  5  tcp4   *:993                 *:*
dovenull imap-login 1047  4  tcp4   *:143                 *:*
dovenull imap-login 1047  5  tcp4   *:993                 *:*
dovenull imap-login 1046  4  tcp4   *:143                 *:*
dovenull imap-login 1046  5  tcp4   *:993                 *:*
dovenull imap-login 1045  4  tcp4   *:143                 *:*
dovenull imap-login 1045  5  tcp4   *:993                 *:*
dovenull imap-login 1044  4  tcp4   *:143                 *:*
dovenull imap-login 1044  5  tcp4   *:993                 *:*
dovenull imap-login 1043  4  tcp4   *:143                 *:*
dovenull imap-login 1043  5  tcp4   *:993                 *:*
dovenull imap-login 1042  4  tcp4   *:143                 *:*
dovenull imap-login 1042  5  tcp4   *:993                 *:*
dovenull pop3-login 1041  4  tcp4   *:110                 *:*
dovenull pop3-login 1041  5  tcp4   *:995                 *:*
dovenull pop3-login 1040  4  tcp4   *:110                 *:*
dovenull pop3-login 1040  5  tcp4   *:995                 *:*
dovenull pop3-login 1039  4  tcp4   *:110                 *:*
dovenull pop3-login 1039  5  tcp4   *:995                 *:*
dovenull pop3-login 1038  4  tcp4   *:110                 *:*
dovenull pop3-login 1038  5  tcp4   *:995                 *:*
dovenull pop3-login 1037  4  tcp4   *:110                 *:*
dovenull pop3-login 1037  5  tcp4   *:995                 *:*
dovenull pop3-login 1036  4  tcp4   *:110                 *:*
dovenull pop3-login 1036  5  tcp4   *:995                 *:*
dovenull pop3-login 1035  4  tcp4   *:110                 *:*
dovenull pop3-login 1035  5  tcp4   *:995                 *:*
dovenull pop3-login 1034  4  tcp4   *:110                 *:*
dovenull pop3-login 1034  5  tcp4   *:995                 *:*
dovenull pop3-login 1033  4  tcp4   *:110                 *:*
dovenull pop3-login 1033  5  tcp4   *:995                 *:*
dovenull pop3-login 1032  4  tcp4   *:110                 *:*
dovenull pop3-login 1032  5  tcp4   *:995                 *:*
dovenull pop3-login 1031  4  tcp4   *:110                 *:*
dovenull pop3-login 1031  5  tcp4   *:995                 *:*
dovenull pop3-login 1030  4  tcp4   *:110                 *:*
dovenull pop3-login 1030  5  tcp4   *:995                 *:*
dovenull pop3-login 1029  4  tcp4   *:110                 *:*
dovenull pop3-login 1029  5  tcp4   *:995                 *:*
dovenull pop3-login 1028  4  tcp4   *:110                 *:*
dovenull pop3-login 1028  5  tcp4   *:995                 *:*
dovenull pop3-login 1027  4  tcp4   *:110                 *:*
dovenull pop3-login 1027  5  tcp4   *:995                 *:*
dovenull pop3-login 1026  4  tcp4   *:110                 *:*
dovenull pop3-login 1026  5  tcp4   *:995                 *:*
nobody   directadmi 971   0  tcp4   *:3664               *:*
nobody   directadmi 970   0  tcp4   *:3664               *:*
nobody   directadmi 969   0  tcp4   *:3664               *:*
nobody   directadmi 968   0  tcp4   *:3664               *:*
nobody   directadmi 967   0  tcp4   *:3664               *:*
nobody   proftpd    811   0  tcp4   *:21                  *:*
root     dovecot    802   6  tcp4   *:143                 *:*
root     dovecot    802   7  tcp4   *:993                 *:*
root     dovecot    802   8  tcp4   *:110                 *:*
root     dovecot    802   9  tcp4   *:995                 *:*
nobody   directadmi 796   0  tcp4   *:3664               *:*
mail     exim       762   4  tcp4   *:25                  *:*
mail     exim       762   6  tcp4   *:587                 *:*
mail     exim       762   8  tcp4   *:465                 *:*
root     sshd       702   4  tcp4   *:9796                *:*
root     syslogd    570   7  udp4   *:514                 *:*
j0#
```

Any tip/help would be great!


----------



## kpa (Jan 1, 2011)

You can't use mail/ssmtp for relaying (in other words sending mail from another machine on your network) mail, it only works for forwarding local mail to another mail server.


----------



## j0 (Jan 1, 2011)

sorry for that as am newbie with FreeBSD; but i tried to install sendmail with Dovecot but it's seems that the problem doesn't resolved.

what sendmail you advice me to install and easy to work with Dovecot?

Kind regards,
j0


----------



## ohauer (Jan 1, 2011)

j0 said:
			
		

> Hi,
> 
> 
> ```
> ...



That's your problem.

- test if your machine can resolve mail.XoX.com to an IP!
- test if you can open a telnet session `$ telnet mail.XoX.com 465`

Is the remote machine rally configured to listen on port 465?
Most of the servers allow these days TLS on port 25.

For the dovecot part go with mail/postfix instead of sendmail, there are some HOWTOS in this forum.


----------



## j0 (Jan 2, 2011)

Hi!

The machine 'mail.XoX.com' is responding to ping with the second ip address for the machine.

and when i try to telnet the machine 'mail.XoX.com' is open for the ports 465/993 but telnet port 25 doesn't open.


```
j0# telnet mail.XoX.com 465
Trying secondipaddress.2...
Connected to mail.XoX.com.
Escape character is '^]'.
```


```
j0# telnet mail.XoX.com 25
Trying secondipaddress.2...
Connected to mail.XoX.com.
Escape character is '^]'.
```

as i go with Dovecot + PostFix but it's seems that i have a problem in cyrus-sasl2-saslauthd; 

when i try to download this package i receive a error


```
cc: ../sasldb/.libs/libsasldb.al: No such file or directory
*** Error code 1

Stop in /usr/ports/security/cyrus-sasl2-saslauthd/work/cyrus-sasl-2.1.23/saslauthd.
*** Error code 1

Stop in /usr/ports/security/cyrus-sasl2-saslauthd/work/cyrus-sasl-2.1.23/saslauthd.
*** Error code 1

Stop in /usr/ports/security/cyrus-sasl2-saslauthd.
*** Error code 1

Stop in /usr/ports/security/cyrus-sasl2-saslauthd.
j0#
```

i found the patch for this error here;

```
http://osdir.com/ml/security.cyrus.sasl/2006-08/msg00027.html
```


```
http://peter.st/patches/cyrus-sasl-2.1.19-sql.c-patch.diff
```

but actually i don't have any idea how to patch it?


----------



## rghq (Jan 2, 2011)

j0 said:
			
		

> as i go with Dovecot + PostFix but it's seems that i have a problem in cyrus-sasl2-saslauthd;



If you plan to let Postfix use Dovecot's Auth, there's no need to install or better compile Postfix with SASL support.

Btw. - your netstat output shows there's already exim running at your host. Also mysqld listen on external interfaces  is this wanted ?


----------



## j0 (Jan 9, 2011)

rghq,

am trying to install postfix with courier now; as am following this link;

http://yocum.org/faqs/postfix-tls-sasl.html

section 7.

```
j0# ldd /usr/local/libexec/postfix/smtpd
/usr/local/libexec/postfix/smtpd:
        libpcre.so.0 => /usr/local/lib/libpcre.so.0 (0x280d9000)
        libssl.so.7 => /usr/local/lib/libssl.so.7 (0x28111000)
        libcrypto.so.7 => /usr/local/lib/libcrypto.so.7 (0x2815f000)
        libdb41.so.1 => /usr/local/lib/libdb41.so.1 (0x282c1000)
        libmysqlclient.so.16 => /usr/local/lib/mysql/libmysqlclient.so.16 (0x28370000)
        libz.so => /usr/local/lib/libz.so (0x283db000)
        libcrypt.so.4 => /lib/libcrypt.so.4 (0x283f0000)
        libm.so.5 => /lib/libm.so.5 (0x28409000)
        libc.so.7 => /lib/libc.so.7 (0x2841e000)
        libz.so.4 => /lib/libz.so.4 (0x28524000)
j0#
```

as you see i don't have 


```
libsasl2.so.2 => /usr/local/lib/libsasl2.so.2 (0x28096000)
```

installed, and when i try to i get this error for libtool;


```
cd /usr/ports/security/cyrus-sasl2
make all install clean

blablabl....
then

libtool: link: unable to infer tagged configuration
libtool: link: specify a tag with `--tag'
*** Error code 1

Stop in /usr/ports/security/cyrus-sasl2/work/cyrus-sasl-2.1.23/include.
*** Error code 1

Stop in /usr/ports/security/cyrus-sasl2/work/cyrus-sasl-2.1.23.
*** Error code 1

Stop in /usr/ports/security/cyrus-sasl2/work/cyrus-sasl-2.1.23.
*** Error code 1

Stop in /usr/ports/security/cyrus-sasl2.
*** Error code 1

Stop in /usr/ports/security/cyrus-sasl2.
j0#
```
??


----------



## j0 (Jan 9, 2011)

my postconf; maybe help,


```
j0# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/usr/local/etc/postfix/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
html_directory = /usr/local/share/doc/postfix
inet_interfaces = all
mail_owner = postfix
mailbox_size_limit = 0
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
mydestination =
mydomain = orientinfosec.com
myhostname = j0.orientinfosec.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks_style = host
myorigin = $myhostname
newaliases_path = /usr/local/bin/newaliases
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps 
$virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps 
$transport_maps $mynetworks $virtual_mailbox_limit_maps
queue_directory = /var/spool/postfix
readme_directory = /usr/local/share/doc/postfix
recipient_delimiter = +
relay_domains = proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf
relayhost =
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_recipient_restrictions = permit_mynetworks,  permit_sasl_authenticated,  reject_non_fqdn_hostname,  reject_non_fqdn_sender,  
reject_non_fqdn_recipient,  reject_unauth_destination,  reject_unauth_pipelining,  reject_invalid_hostname,  reject_rbl_client list.dsbl.org,  
reject_rbl_client bl.spamcop.net,  reject_rbl_client sbl-xbl.spamhaus.org
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks
smtpd_tls_CAfile = /etc/ssl/postfix/smtpd.pem
smtpd_tls_cert_file = /etc/ssl/postfix/smtpd.pem
smtpd_tls_key_file = /etc/ssl/postfix/smtpd.pem
smtpd_tls_loglevel = 0
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
soft_bounce = no
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf, mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_gid_maps = static:1014
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_limit_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_mailbox_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_maildir_limit_message = Sorry, this user has overdrawn their diskspace quota. Please try again later.
virtual_minimum_uid = 125
virtual_overquota_bounce = yes
virtual_transport = virtual
virtual_uid_maps = static:1017
j0#
```


----------

