1

I have postfix for smtp, and dovecot for imap/pop with FROXLOR. I have configured correctly, but I can't succeed in configuring an account in client mail programs. From Outlook, I receive Log on to incoming mail server (IMAP): Failed to connect to the server. . I get this when I try to use imap too. I am not using ssl or tls, but just for work, I have to set starttls for authenticate in Outlook (my research says this).

My main.cf of postfix is:

## General Postfix configuration
# should be the default domain from your provider eg. "server100.provider.tld"
mydomain = dominio.com.br

# should be different from $mydomain eg. "mail.$mydomain"
myhostname = email.$mydomain

mydestination = email.dominio.com.br, localhost.localdomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24
inet_interfaces = all
append_dot_mydomain = no
biff = no

# Postfix performance settings
default_destination_concurrency_limit = 20
local_destination_concurrency_limit = 2

# SMTPD Settings
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks, check_relay_domains
smtpd_sender_restrictions = reject_unknown_sender_domain, permit_mynetworks, permit_sasl_authenticated 
smtpd_client_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unknown_client_hostname

# Postfix 2.10 requires this option. Postfix < 2.10 ignores this.
# The option is intentionally left empty.
smtpd_relay_restrictions =

# Maximum size of Message in bytes (50MB)
message_size_limit = 52428800

## SASL Auth Settings
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = 
broken_sasl_auth_clients = yes
## Dovecot Settings for deliver, SASL Auth and virtual transport
smtpd_sasl_type = dovecot
dovecot_destination_recipient_limit = 1
smtpd_sasl_path = private/dovecot-auth

# Virtual delivery settings
virtual_mailbox_base = /var/customers/mail/
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_alias_maps.cf
smtpd_sender_login_maps = mysql:/etc/postfix/mysql-virtual_sender_permissions.cf
virtual_uid_maps = static:2000
virtual_gid_maps = static:2000

# Local delivery settings
local_transport = local
alias_maps = $alias_database

# Default Mailbox size, is set to 0 which means unlimited!
mailbox_size_limit = 0
virtual_mailbox_limit = 0

### TLS settings
###
## TLS for outgoing mails from the server to another server
#smtp_tls_security_level = may
#smtp_tls_note_starttls_offer = yes
## TLS for email client
#smtpd_tls_security_level = may
#smtpd_tls_cert_file = /etc/ssl/server/localhost.pem
#smtpd_tls_key_file = $smtpd_tls_cert_file
#smtpd_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
#smtpd_tls_loglevel = 1
#smtpd_tls_received_header = yes

debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5

home_mailbox = Maildir/
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous
mailbox_command = 
smtpd_tls_cert_file = /etc/ssl/certs/server.crt
smtpd_tls_key_file = /etc/ssl/private/server.key
smtpd_use_tls = yes
#smtp_use_tls = no
smtpd_tls_received_header = yes
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_mandatory_ciphers = medium
#smtpd_tls_auth_only = yes
tls_random_source = dev:/dev/urandom
myorigin = /etc/mailname
relayhost = 
recipient_delimiter = +
inet_protocols = all

smtpd_tls_auth_only = no
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_timeout = 3600s

And master.cf is:

#
# 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)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
26      inet  n       -       -       -       -       smtpd
#smtp      inet  n       -       -       -       1       postscreen
#smtpd     pass  -       -       -       -       -       smtpd
#dnsblog   unix  -       -       -       -       0       dnsblog
#tlsproxy  unix  -       -       -       -       0       tlsproxy
submission inet n       -       n       -       -       smtpd
   -o smtpd_enforce_tls=no
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=may
  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
  -o mynetworks=127.0.0.0/8 
  -o smtpd_client_restrictions=permit_sasl_authenticated,permit_mynetworks,reject
    -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
  -o smtpd_sender_restrictions=
  -o smtpd_proxy_filter=127.0.0.1
  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
   -o smtpd_sasl_type=dovecot
  -o smtpd_sasl_path=private/auth

#smtps     inet  n       -       -       -       -       smtpd
#  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=no

#628       inet  n       -       -       -       -       qmqpd
pickup    unix  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -   n   n   -   2   pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

  # Add these lines to be able to use dovecot as delivery agent
# Dovecot LDA
dovecot      unix    -    n    n    -    -    pipe
    flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-dovecot-postfix.conf -d ${recipient}

How can I solve the issue on every client email? In my localhost it works. In my roundcube too, I can send and receive email there, but I need to do this in Outlook or Thunderbird.

EDIT 1: my dovecont -n says:

# 2.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 3.13.0-43-generic x86_64 Ubuntu 14.04.2 LTS
auth_mechanisms = plain login
mail_location = maildir:~/Maildir
mail_privileged_group = mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacati                                on subaddress comparator-i;ascii-numeric relational regex imap4flags copy includ                                e variables body enotify environment mailbox date ihave
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  quota = maildir
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
protocols = imap pop3 sieve
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}
ssl_cert = </etc/dovecot/dovecot.pem
ssl_cipher_list = ALL:!LOW:!SSLv2:ALL:!aNULL:!ADH:!eNULL:!EXP:RC4+RSA:+HIGH:+MED                                IUM
ssl_key = </etc/dovecot/private/dovecot.pem
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocol imap {
  imap_client_workarounds = delay-newmail
  imap_logout_format = in=%i out=%o
  mail_max_userip_connections = 10
  mail_plugins = quota imap_quota
}
protocol pop3 {
  mail_max_userip_connections = 10
  mail_plugins = quota
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_logout_format = in=%i out=%o top=%t/%p retr=%r/%b del=%d/%m size=%s
  pop3_uidl_format = UID%u-%v
}
protocol lda {
  deliver_log_format = msgid=%m: %$
  mail_plugins = sieve
  postmaster_address = postmaster
  quota_full_tempfail = yes
  rejection_reason = Your message to <%t> was automatically rejected:%n%r
}

The command doveadm log find says:

root@email:~# doveadm log find
Looking for log files from /var/log
Debug: /var/log/syslog
Debug: /var/log/mail.log
Info: /var/log/syslog
Info: /var/log/mail.log
Warning: /var/log/syslog
Warning: /var/log/mail.log
Error: /var/log/syslog
Error: /var/log/mail.log
Error: /var/log/mail.err
Fatal: /var/log/syslog
Fatal: /var/log/mail.log
Fatal: /var/log/mail.err

The log syslog recent part is:

Aug 11 15:33:09 email postfix/smtpd[2009]: connect from unknown[IP.AD.RE.SS]
Aug 11 15:33:12 email postfix/smtpd[2009]: warning: unknown[IP.AD.RE.SS]: SASL LOGIN authentication failed: FGbzc3dvcmp6
Aug 11 15:33:12 email postfix/smtpd[2009]: disconnect from unknown[IP.AD.RE.SS]
~

MAIL.ERR

Aug 11 04:01:15 email postfix/submission/smtpd[18788]: fatal: no SASL authentication mechanisms
Aug 11 04:05:19 email postfix/submission/smtpd[18899]: fatal: no SASL authentication mechanisms
Aug 11 04:06:20 email postfix/submission/smtpd[18927]: fatal: no SASL authentication mechanisms
Aug 11 15:27:39 email dovecot: doveadm: Error: This is Dovecot's error log (1439321259)
Aug 11 15:27:39 email dovecot: doveadm: Fatal: This is Dovecot's fatal log (1439321259)
  • what is your dovecot settings (doveconf -n ) ? what do you see in dovecot logs when trying to connect from your outlook client? – clement Aug 11 '15 at 14:39
  • i edited the question with log of doveconf -n, with others logs, thanks in advance for reply, im waiting for news – Matheus Silva Itep Aug 11 '15 at 19:36
  • You've got two disconnected issues here. 1. Your postfix isn't configured to accept SMTP based authentication. 2. Your Dovecot doesn't look like you've configured it to even listen on the POP3 or IMAP ports (or the SSL equivalent ones). There are certainly no log files from a Dovecot connection attempt. I would recommend you split one of these off into a separate question. By all means reference one from the other if you feel that might help. – roaima Aug 11 '15 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.