# Can't connect to Postfix to send mail  [SOLVED]

## audiodef

I recently set up my own mail server. Thunderbird can connect and read IMAP mail, but I can only get as far as "connected to server" when trying to send. It just hangs there until it times out. What am I missing?

Thunderbird outgoing server settings:

Port 465

SSL/TLS

Normal password

Correct user name (user@server.com)

main.cf:

```

compatibility_level = 2

soft_bounce = yes

queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/libexec/postfix

data_directory = /var/lib/postfix

mail_owner = postfix

myhostname = (server.domain.com)

myorigin = $myhostname

mydestination = $myhostname, localhost.$mydomain, localhost

unknown_local_recipient_reject_code = 550

debug_peer_level = 2

debugger_command =

    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

    ddd $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail

newaliases_path = /usr/bin/newaliases

mailq_path = /usr/bin/mailq

setgid_group = postdrop

html_directory = no

manpage_directory = /usr/share/man

sample_directory = /etc/postfix

readme_directory = no

inet_protocols = ipv4

meta_directory = /etc/postfix

shlib_directory = /usr/lib64/postfix/${mail_version}

home_mailbox = .maildir/

#Guide config options

virtual_transport = dovecot

dovecot_destination_recipient_limit = 1

smtpd_sasl_auth_enable = yes

smtpd_sasl_type = dovecot

smtpd_sasl_path = private/auth

virtual_alias_maps = mysql:/etc/postfix/sql_virtual_alias_maps.cf

virtual_mailbox_domains = mysql:/etc/postfix/sql_virtual_domain_maps.cf

virtual_mailbox_maps = mysql:/etc/postfix/sql_virtual_mailbox_maps.cf

smtpd_sender_restrictions = reject_non_fqdn_sender

smtpd_reject_unlisted_sender = yes

smtpd_recipient_restrictions = 

   permit_mynetworks

   reject_non_fqdn_recipient

   permit_sasl_authenticated

   reject_unauth_destination

   reject_rbl_client zen.spamhaus.org

```

master.cf:

```

#

# Postfix master process configuration file.  For details on the format

# of the file, see the master(5) manual page (command: "man 5 master" or

# on-line: http://www.postfix.org/master.5.html).

#

# Do not forget to execute "postfix reload" after editing this file.

#

# ==========================================================================

# service type  private unpriv  chroot  wakeup  maxproc command + args

#               (yes)   (yes)   (no)    (never) (100)

# ==========================================================================

smtp      inet  n       -       n       -       -       smtpd

pickup    unix  n       -       n       60      1       pickup

cleanup   unix  n       -       n       -       0       cleanup

qmgr      unix  n       -       n       300     1       qmgr

#qmgr     unix  n       -       n       300     1       oqmgr

tlsmgr    unix  -       -       n       1000?   1       tlsmgr

rewrite   unix  -       -       n       -       -       trivial-rewrite

bounce    unix  -       -       n       -       0       bounce

defer     unix  -       -       n       -       0       bounce

trace     unix  -       -       n       -       0       bounce

verify    unix  -       -       n       -       1       verify

flush     unix  n       -       n       1000?   0       flush

proxymap  unix  -       -       n       -       -       proxymap

proxywrite unix -       -       n       -       1       proxymap

smtp      unix  -       -       n       -       -       smtp

relay     unix  -       -       n       -       -       smtp

showq     unix  n       -       n       -       -       showq

error     unix  -       -       n       -       -       error

retry     unix  -       -       n       -       -       error

discard   unix  -       -       n       -       -       discard

local     unix  -       n       n       -       -       local

virtual   unix  -       n       n       -       -       virtual

lmtp      unix  -       -       n       -       -       lmtp

anvil     unix  -       -       n       -       1       anvil

scache    unix  -       -       n       -       1       scache

dovecot   unix  -       n       n       -       -       pipe

  flags=DRhu user=mail:mail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}

```

/var/log/messages has this:

```

Jan 11 21:03:25 (servername) postfix/smtpd[18850]: connect from c-(ip-address).hsd1.(state).comcast.net[ip-address]

Jan 11 21:04:04 (servername) postfix/smtpd[18850]: lost connection after CONNECT from c-(ip-address).hsd1.(state).comcast.net[ip-address]

```

----------

## bbgermany

Hi,

looks like you are missing the section for tls in your main.cf. Check for the following options:

```

smtpd_tls_key_file 

smtpd_tls_cert_file 

smtpd_tls_loglevel 

smtpd_tls_received_header 

smtpd_tls_session_cache_timeout 

smtp_tls_mandatory_ciphers 

smtp_tls_security_level 

smtpd_tls_security_level 

smtpd_tls_auth_only

```

Additionally you need the following line in your master.cf. Otherwise port 465 is not available:

```

smtps     inet  n       -       -       -       -       smtpd

```

greets, bb

----------

## audiodef

Thanks, bb. 

Once I implemented those lines I was able to send mail from Thunderbird.   :Smile: 

----------

