Smarthost only with port 25

Moin,
in the last days I tried to configure a smarthost on my system.
Yesterday I followed the wonderful hints in
https://wiki.z-hub.io/display/K4U/Setting+up+Univention+to+allow+multiple+e-mail+addresses+per+user
But I have no incoming and outgoing mails.
A look in /var/log/mail.log shows the connection is refused because using Port 25.
Whats the missing switch?

it would probably be helpful to see the actual log message.

Thanks for your quick feedbacks.
This is my actual treat and status.
Whats the best way to bring the log messages in this forum. I did it not before.

Bildschirmfoto vom 2020-11-06 09-27-42
Sorry, I think its not the right way.
Please give me a int for the future.

I recommend to use the “Preformatted text” option of the editor. In the end this forum software is using Markdown so you could also just use markdown formatting for code blocks (both the button and the direct formatting do the same).

Please for beginners …
How should I use the log viewed in putty? Cut and paste?

https://www.alphr.com/copy-paste-putty/#:~:text=To%20copy%20text%20from%20Putty%20to%20your%20Windows%20clipboard%2C%20here’s,content%20to%20your%20clipboard%20automatically.

I would hope, though that german law enforcement has some budget for it training and service companies.

Nov  6 12:03:55 mose postfix/smtp[22262]: warning: database /etc/postfix/tls_policy.db is older than source file /etc/postfix/tls_policy
Nov  6 12:03:55 mose postfix/smtp[22262]: connect to send.one.com[46.30.211.140]:25: Connection refused
Nov  6 12:03:55 mose postfix/smtp[22262]: connect to send.one.com[46.30.211.141]:25: Connection refused
Nov  6 12:03:55 mose postfix/bounce[22263]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:03:55 mose postfix/smtp[22262]: 3D1D21105459: to=<thomas@morische.de>, relay=none, delay=34164, delays=34164/0.02/0.02/0, dsn=4.4.1, status=deferred (connect to send.one.com[46.30.211.141]:25: Connection refused)
Nov  6 12:05:26 mose kopano-server[1697]: LDAP search error: Can't contact LDAP server. Will unbind, reconnect and retry.
Nov  6 12:23:55 mose postfix/qmgr[4556]: 705501104E68: from=<thomas@morische.de>, size=1274, nrcpt=1 (queue active)
Nov  6 12:23:55 mose postfix/trivial-rewrite[32437]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:23:55 mose postfix/smtp[32438]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:23:55 mose postfix/smtp[32438]: warning: database /etc/postfix/tls_policy.db is older than source file /etc/postfix/tls_policy
Nov  6 12:23:55 mose postfix/smtp[32438]: connect to send.one.com[46.30.211.141]:25: Connection refused
Nov  6 12:23:55 mose postfix/smtp[32438]: connect to send.one.com[46.30.211.140]:25: Connection refused
Nov  6 12:23:55 mose postfix/bounce[32439]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:23:55 mose postfix/smtp[32438]: 705501104E68: to=<thomas.morische@polizei.hamburg.de>, relay=none, delay=46654, delays=46654/0.02/0.02/0, dsn=4.4.1, status=deferred (connect to send.one.com[46.30.211.140]:25: Connection refused)
Nov  6 12:28:55 mose postfix/qmgr[4556]: 6CEA6110542E: from=<thomas@morische.de>, size=1274, nrcpt=1 (queue active)
Nov  6 12:28:55 mose postfix/trivial-rewrite[32607]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:28:55 mose postfix/smtp[32608]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:28:55 mose postfix/smtp[32608]: warning: database /etc/postfix/tls_policy.db is older than source file /etc/postfix/tls_policy
Nov  6 12:28:55 mose postfix/smtp[32608]: connect to send.one.com[46.30.211.141]:25: Connection refused
Nov  6 12:28:55 mose postfix/smtp[32608]: connect to send.one.com[46.30.211.140]:25: Connection refused
Nov  6 12:28:55 mose postfix/bounce[32609]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:28:55 mose postfix/smtp[32608]: 6CEA6110542E: to=<thomas.morische@polizei.hamburg.de>, relay=none, delay=46739, delays=46739/0.02/0/0, dsn=4.4.1, status=deferred (connect to send.one.com[46.30.211.140]:25: Connection refused)
Nov  6 12:29:27 mose kopano-server[1697]: LDAP search error: Can't contact LDAP server. Will unbind, reconnect and retry.
Nov  6 12:33:55 mose postfix/qmgr[4556]: 0FB411103D99: from=<bounce_6065+caAAAGEDIAAACC6AAEZ42AAAAAAAAAIFTY5NUQ@newsletter.heise.de>, size=128581, nrcpt=1 (queue active)
Nov  6 12:33:55 mose postfix/trivial-rewrite[516]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:33:55 mose postfix/smtp[517]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:33:55 mose postfix/smtp[517]: warning: database /etc/postfix/tls_policy.db is older than source file /etc/postfix/tls_policy
Nov  6 12:33:55 mose postfix/smtp[517]: connect to morische.de[192.168.22.2]:25: Connection refused
Nov  6 12:33:55 mose postfix/bounce[518]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:33:55 mose postfix/smtp[517]: 0FB411103D99: to=<thomas@morische.de>, relay=none, delay=21343, delays=21343/0.02/0/0, dsn=4.4.1, status=deferred (connect to morische.de[192.168.22.2]:25: Connection refused)
Nov  6 12:47:12 mose postfix/pickup[1450]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:48:55 mose postfix/qmgr[4556]: C3DE5110545D: from=<info@pairsolutions.de>, size=3507, nrcpt=1 (queue active)
Nov  6 12:48:55 mose postfix/trivial-rewrite[1513]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:48:55 mose postfix/smtp[1514]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:48:55 mose postfix/smtp[1514]: warning: database /etc/postfix/tls_policy.db is older than source file /etc/postfix/tls_policy
Nov  6 12:48:55 mose postfix/smtp[1514]: connect to morische.de[192.168.22.2]:25: Connection refused
Nov  6 12:48:55 mose postfix/bounce[1515]: warning: /etc/postfix/main.cf, line 90: overriding earlier entry: sender_dependent_relayhost_maps=yes
Nov  6 12:48:55 mose postfix/smtp[1514]: C3DE5110545D: to=<thomas@morische.de>, relay=none, delay=34099, delays=34099/0.02/0/0, dsn=4.4.1, status=deferred (connect to morische.de[192.168.22.2]:25: Connection refused)

Haha, no it and no english.
Now without putty with ssh per console (but I checked the options in putty …)

You seem to have some duplicate lines in your main.cf. Its important to note that the file should not be changed manually, but only through ucr variables.

As for your connection refused messages it could be a good next step to check if this outgoing port is blocked by a firewall or maybe the internet provider.

The duplicate lines in my main.cf is the result of the tip in the forum?


sender_dependent_relayhost_maps = yes
and
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_dependent

in my fritzbox the port-blocking is deactivated
in my firewall-appliance I can see the packets accepted with port 25
it seems the provider doesnt accept port 25

how can I force outgoing mails to a secure port?

relayhost = my.relay.host:587

Yes, but …
I understood the hints from fbartels
https://wiki.z-hub.io/display/K4U/Setting+up+Univention+to+allow+multiple+e-mail+addresses+per+user
not to set the mail/relayhost variable in the Univention Configuration Registry (UCR), otherwise you can only use this single relayhost.
I tried it in the file “sender_dependent”. The result ist a secure connection for the outgoig mails but not for incoming mails.

This can be set with the ucr variable mail/relayhost

But in this case it doesnt work. I tested it.
And it isnt corresponding to the hints in Smarthost with multiple mail adresses per user.

What exactly did you test and how did you verify it?

I followed exactly your summarized hints
https://wiki.z-hub.io/display/K4U/Setting+up+Univention+to+allow+multiple+e-mail+addresses+per+user
The result is refused connections from the provider (see ahead in the log).
The reason is the use of port 25 (see the title).
An entry in the UCR-Variable “mail/relayhost” cant generate a secure connection on Port 587. In your article there is a warning about the using.
At first I have to use a secure connection. Afterwards I will see the function of my configuration about multiple mail-adresses per user.

Ah, those are not mine, though. They have been contributed in 2017 by another forum user and are therefore located under “community contributions”.

I am also not sure if the statement that you should not set mail/relayhost if you want per user relays. But even if you use per user relays, there you need to make the same change and use port 587 instead of 25.

OK.
But what is the right switch for the communication on a secure way?
send.one.com:587” changes not the port. Only writing /etc/postfix/sender_dependent causes a reaction.
I cant imagine thats the right way to configure.

Hi @Thomas_M,

I think you questions are very hard to answer without having a direct look at your system. If you have a valid Kopano subscription I would recommend to reach out to the Kopano support.

My general recommendation is to not use sender dependent relaying (which implies that your are using your server with mailboxes from a mixture of other mail providers) but instead make the investment to but a (mail) domain of your own and simply use this domain for all your mailboxes (which still would allow to fetch other mailboxes, but simply reply to these mails with your own domain instead).

Hi fbartels,
yes its the right way. I will delete my actual configuration and start again simply use this domain for all mailboxes.
I hope it will be successful. Otherwise I learned a lot in the last days :grinning:
Thanks for your patience.