Kopano / Postfix doesn't send mails

hi guys,

i have a problem that my kopano / postfix on ubuntu 18.04 doesn’t send mails to my own domain.

My domain is for example: test.com

I try to send a mail from admin@test.com to admin2@test.com
there comes the following error:

Jun 19 07:40:36 exchange postfix/smtpd[17760]: connect from localhost[127.0.0.1]
Jun 19 07:40:36 exchange postfix/smtpd[17760]: 979F43A16D5: client=localhost[127.0.0.1]
Jun 19 07:40:36 exchange postfix/cleanup[17749]: 979F43A16D5: message-id=<kcis.4AA045DD550F44F2A667A59336ABCF3F@exchange.test.com>
Jun 19 07:40:36 exchange postfix/smtpd[17760]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Jun 19 07:40:36 exchange postfix/qmgr[17723]: 979F43A16D5: from=<admin@exchange.test.com>, size=3931, nrcpt=1 (queue active)
Jun 19 07:40:36 exchange amavis[2594]: (02594-12) Passed CLEAN {RelayedInbound}, [127.0.0.1]:44796 [164.25.200.241] <admin@test.com> -> <admin2@exchange.test.com>, Queue-ID: 059833A16D9, Message-ID: <kcis.4AA045DD550F44F2A667A59336ABCF3F@exchange.test.com>, mail_id: E5Hv-MpLBGh0, Hits: 0.987, size: 3133, queued_as: 979F43A16D5, 597 ms
Jun 19 07:40:36 exchange postfix/smtp[17750]: 059833A16D9: to=<admin2@exchange.test.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.61, delays=0.01/0.01/0/0.6, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 979F43A16D5)
Jun 19 07:40:36 exchange postfix/qmgr[17723]: 059833A16D9: removed
Jun 19 07:40:36 exchange postfix/lmtp[17761]: connect to localhost[127.0.0.1]:2003: Connection refused
Jun 19 07:40:36 exchange postfix/lmtp[17761]: 979F43A16D5: to=<admin2@exchange.test.com>, relay=none, delay=0.01, delays=0/0/0/0, dsn=4.4.1, status=deferred (connect to localhost[127.0.0.1]:2003: Connection refused)

here is my main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
smtp_bind_address = 164.25.200.241
smtpd_banner = $myhostname ESMTP
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/mailcert.pem
smtpd_tls_key_file = /etc/ssl/private/mailcert.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

#
# restrictions
#
smtpd_helo_required = yes
strict_rfc821_envelopes = yes
disable_vrfy_command = yes
smtpd_delay_reject = yes

#
# Recipient Restrictions
#
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, reject_non_fqdn_sender
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
myhostname = exchange.test.com
myorigin = exchange.test.com
mydestination = 
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_maps = mysql:/etc/postfix/mysql-users.cf
virtual_transport = lmtp:[localhost]:2003
virtual_mailbox_domains = test.com
mailbox_size_limit = 0
recipient_delimiter = +
inet_protocols = ipv4
inet_interfaces = all
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_rbl_client zen.spamhaus.org
smtpd_sender_restrictions = permit_sasl_authenticated
content_filter = smtp-amavis:[127.0.0.1]:10024
smtpd_tls_security_level=may
smtp_tls_security_level = may
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_protocols = !SSLv2, !SSLv3
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtp_tls_protocols = !SSLv2, !SSLv3
smtpd_tls_loglevel = 1
maximal_queue_lifetime = 10m
bounce_queue_lifetime = 10m
smtpd_timeout = 3600s
smtpd_proxy_timeout = 3600s
smtp_use_tls = no
message_size_limit = 10240000
virtual_mailbox_limit = 0
smtpd_sasl_auth_enable = no
mynetworks_style = subnet

here is my /etc/postfix/virtual

#Alias									primary mail
admin@test.com                                            admin@test.com
admin2@test.com                                          admin2@test.com

i apologise, the error is indeed something other than the linked post. Reopened.

Edit: but maybe a similar solution?

@nils50122 said in Kopano / Postfix doesn't send mails:

Jun 19 07:40:36 exchange postfix/lmtp[17761]: connect to localhost[127.0.0.1]:2003: Connection refused

has the dagent started?

what do you get from a manual
telnet 127.0.0.1 2003 and telnet ::1 2003

++umgfoin

ss -alntp

Looks like the Kopano-Dagent can’t start.

I set the log-level from dagent to 6.

With default dagent.cfg there comes the following error:

Thu Jun 28 11:44:18 2018: [info   ] Maximum LMTP threads set to 20
Thu Jun 28 11:44:18 2018: [crit   ] Unable to create socket(2,1,6) port 2003: Address already in use

When i adjust the dagent.cfg to:

lmtp_listen = [::1]:2003 127.0.0.1:2003
lmtp_port = ""

there comes no error in dagent.log, but the service can’t start again.

Thu Jun 28 12:01:40 2018: [warning] Config warning: Option "lmtp_port" is recognized but obsolete, and will be removed in a future release.
Thu Jun 28 12:01:40 2018: [notice ] Coredumps are disabled via configuration file.
Thu Jun 28 12:01:40 2018: [info   ] Maximum LMTP threads set to 20
Thu Jun 28 12:01:40 2018: [info   ] Listening on 127.0.0.1:2003 for LMTP
Thu Jun 28 12:01:40 2018: [info   ] Listening on [::1]:2003 for LMTP

Output from ss -alntp:

root@exchange:~# ss -alntp
State                  Recv-Q                  Send-Q                                    Local Address:Port                                     Peer Address:Port                  
LISTEN                 0                       128                                           127.0.0.1:10023                                         0.0.0.0:*                      users:(("postgrey --pidf",pid=1516,fd=6))
LISTEN                 0                       128                                           127.0.0.1:10024                                         0.0.0.0:*                      users:(("/usr/sbin/amavi",pid=2071,fd=5),("/usr/sbin/amavi",pid=2070,fd=5),("/usr/sbin/amavi",pid=1934,fd=5))
LISTEN                 0                       100                                           127.0.0.1:10025                                         0.0.0.0:*                      users:(("master",pid=2857,fd=112))
LISTEN                 0                       80                                            127.0.0.1:3306                                          0.0.0.0:*                      users:(("mysqld",pid=1105,fd=24))
LISTEN                 0                       100                                             0.0.0.0:236                                           0.0.0.0:*                      users:(("kopano-server",pid=1788,fd=6))
LISTEN                 0                       128                                           127.0.0.1:783                                           0.0.0.0:*                      users:(("spamd child",pid=1816,fd=6),("spamd child",pid=1815,fd=6),("/usr/sbin/spamd",pid=1149,fd=6))
LISTEN                 0                       128                                             0.0.0.0:10000                                         0.0.0.0:*                      users:(("miniserv.pl",pid=1828,fd=5))
LISTEN                 0                       100                                             0.0.0.0:465                                           0.0.0.0:*                      users:(("master",pid=2857,fd=17))
LISTEN                 0                       128                                       127.0.0.53%lo:53                                            0.0.0.0:*                      users:(("systemd-resolve",pid=826,fd=13))
LISTEN                 0                       128                                             0.0.0.0:22                                            0.0.0.0:*                      users:(("sshd",pid=1495,fd=3))
LISTEN                 0                       100                                             0.0.0.0:25                                            0.0.0.0:*                      users:(("master",pid=2857,fd=13))
LISTEN                 0                       128                                                   *:995                                                 *:*                      users:(("kopano-gateway",pid=997,fd=4))
LISTEN                 0                       128                                               [::1]:10023                                            [::]:*                      users:(("postgrey --pidf",pid=1516,fd=5))
LISTEN                 0                       128                                               [::1]:10024                                            [::]:*                      users:(("/usr/sbin/amavi",pid=2071,fd=6),("/usr/sbin/amavi",pid=2070,fd=6),("/usr/sbin/amavi",pid=1934,fd=6))
LISTEN                 0                       128                                                   *:143                                                 *:*                      users:(("kopano-gateway",pid=997,fd=5))
LISTEN                 0                       128                                               [::1]:783                                              [::]:*                      users:(("spamd child",pid=1816,fd=5),("spamd child",pid=1815,fd=5),("/usr/sbin/spamd",pid=1149,fd=5))
LISTEN                 0                       128                                                [::]:10000                                            [::]:*                      users:(("miniserv.pl",pid=1828,fd=6))
LISTEN                 0                       128                                                   *:80                                                  *:*                      users:(("apache2",pid=2303,fd=4),("apache2",pid=2302,fd=4),("apache2",pid=2276,fd=4),("apache2",pid=1935,fd=4),("apache2",pid=1933,fd=4),("apache2",pid=1930,fd=4),("apache2",pid=1929,fd=4),("apache2",pid=1928,fd=4),("apache2",pid=1767,fd=4))
LISTEN                 0                       128                                                   *:8080                                                *:*                      users:(("kopano-ical",pid=990,fd=3))
LISTEN                 0                       128                                                [::]:22                                               [::]:*                      users:(("sshd",pid=1495,fd=4))
LISTEN                 0                       128                                                   *:443                                                 *:*                      users:(("apache2",pid=2303,fd=6),("apache2",pid=2302,fd=6),("apache2",pid=2276,fd=6),("apache2",pid=1935,fd=6),("apache2",pid=1933,fd=6),("apache2",pid=1930,fd=6),("apache2",pid=1929,fd=6),("apache2",pid=1928,fd=6),("apache2",pid=1767,fd=6))

No one has an idea?

You have to remove lmtp_port = "" from your config, as it overrides lmtp_listen.

In fact you don’t need either of those as dagent will listen on :::2003 by default (all ipv4 and ipv6 addresses)

Neither overrides the other.
But "" is a silly value - it is not a valid integer and it is also not the empty value.