Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Christian Kivalo
On 2021-05-20 01:12, post...@ptld.com wrote: Best i can gather from your last few replies is to rsync a copy of the cert created on the load balancer to the backend servers and point postfix at that cert. Is that the answer? This is all ive been trying to ask from the beginning, best method

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Wed, May 19, 2021 at 07:45:17PM -0400, post...@ptld.com wrote: > > Letsencrypt will connect to the "submission" but request would go to > > the "backend" > > Which "backend"? Okay, say i setup port 443 for certbot to use for > verification on haproxy to proxy to the backend servers. The onl

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Wed, May 19, 2021 at 07:23:01PM -0400, post...@ptld.com wrote: > > On 05-19-2021 7:02 pm, Viktor Dukhovni wrote: > >> Well submission.example.com is a linux server running haproxy on it. > >> The only way (i know how) to create a certificate assigned to > >> submission.example.com is to create

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread IL Ka
> > > Which "backend"? > "random or designated" Viktor's comment: 7. Some suitable process arranges to update the peer servers whenever a new certificate is obtained by some ( *random ordesignated)* server in the cluster. Or some completely separate provisioning syst

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 7:32 pm, IL Ka wrote: I believe here is an answer: Viktor: No you just have to also proxy port 443 as well as 587, and then Let's Encrypt will issue a certificate for submission.example.com to (one of the) underlying servers. Letsencrypt will connect to the "submission" but requ

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread IL Ka
> Using certbot (with a validation method that works with auto renew) i > can create a certificate on the backend.exmample.com server and tell > certbot the certificate will be for submission.example.com even though > submission.example.com will not resolve to the server im running certbot > on? >

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 7:02 pm, Viktor Dukhovni wrote: Well submission.example.com is a linux server running haproxy on it. The only way (i know how) to create a certificate assigned to submission.example.com is to create that certificate using commands in a bash shell using certbot physically on that ser

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread IL Ka
> Proxies are only needed for very large mail plants, where the message > rate is too high for any one machine to handle, and you also need > GeoIP DNS load-balancing, front-end proxies per datacentre, ... > > For those of us not working for Google, much simpler approaches > are more robust (easier

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 6:48 pm, Viktor Dukhovni wrote:\ You're fixated on the backend server name matching the certificate, you really need to drop that assumption. You misunderstand me. I know the cert has to match whatever the client connected to, not the backend. Out of the box, postfix is using a ce

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
> On 19 May 2021, at 7:05 pm, post...@ptld.com wrote: > > This is where im getting confused. > > Before you said make a cert for the load balancer where clients connect, and > deploy it on the backend servers. The cerificate is NOT for the load balancer it is for the cluster of backend servers.

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 6:48 pm, Viktor Dukhovni wrote: 2. This (same) certificate chain and associated private key is deployed on all the backend servers that sit behind the load-balancer. Certificate renewal should happen on (one or all) the backend servers. If more than one, space out the cron

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Wed, May 19, 2021 at 06:57:42PM -0400, post...@ptld.com wrote: > > On 05-19-2021 6:48 pm, Viktor Dukhovni wrote: > > Why would the cert be created "on the load balancer"? The load > > balancer is just a TCP L4 proxy. Why does it need to be a trusted > > component in the system? > > The "load

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 6:48 pm, Viktor Dukhovni wrote: Why would the cert be created "on the load balancer"? The load balancer is just a TCP L4 proxy. Why does it need to be a trusted component in the system? The "load balancer" is haproxy running on a linux server. It needs a certificate because cl

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Thu, May 20, 2021 at 01:44:47AM +0300, IL Ka wrote: > So, each backend can have it's own certificate, but for the same DNS name ( > haproxy.example.com), right? Briefly during rollover. Not each its own, but some have a previous version briefly during rollover. > I didn't know that letsencry

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Wietse Venema
post...@ptld.com: > > On 05-19-2021 6:38 pm, Wietse Venema wrote: > > This is too complicated. > > > > With a load balancer, the backend hosts don't need to exist in DNS, > > and the backend hosts don't even need a globally unique IP address. > > They can sit on 10.0.0.1 and 10.0.0.2 and have fake

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Wed, May 19, 2021 at 06:38:16PM -0400, Wietse Venema wrote: > With a load balancer, the backend hosts don't need to exist in DNS, > and the backend hosts don't even need a globally unique IP address. > They can sit on 10.0.0.1 and 10.0.0.2 and have fake hostnames. > > What matters is that the

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 6:44 pm, IL Ka wrote: So, each backend can have it's own certificate, but for the same DNS name (haproxy.example.com), right? No. certbot will try to connect the server you are issuing the certificate for using the domain name you want the cert for. If the DNS (haproxy.example.co

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Wed, May 19, 2021 at 06:20:07PM -0400, post...@ptld.com wrote: > > 2. This (same) certificate chain and associated private key is > > deployed on all the backend servers that sit behind the > > load-balancer. > > 1) Should i just physically copy (scp?) the cert files created on th

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 6:38 pm, Wietse Venema wrote: This is too complicated. With a load balancer, the backend hosts don't need to exist in DNS, and the backend hosts don't even need a globally unique IP address. They can sit on 10.0.0.1 and 10.0.0.2 and have fake hostnames. But they do need public IP,

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread IL Ka
> > > 2. This (same) certificate chain and associated private key is > > > deployed > > > on all the backend servers that sit behind the load-balancer. > > > > > > I wrote that CNAME doesn't work with several backends. > > I now see it works if all backends share the same key and cert.

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 5:58 pm, Viktor Dukhovni wrote: 3. The hostname "submission.example.com" is a CNAME alias for the proxy: submission.example.com. IN CNAME haproxy.example.com. haproxy.example.com. IN A 192.0.2.1 I shouldn't have let us get side tracked on CNAM

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Wietse Venema
This is too complicated. With a load balancer, the backend hosts don't need to exist in DNS, and the backend hosts don't even need a globally unique IP address. They can sit on 10.0.0.1 and 10.0.0.2 and have fake hostnames. What matters is that the servers on those backend hosts greet and respond

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 5:58 pm, Viktor Dukhovni wrote: You're not paying careful attention, so I'll have spell it out in gory detail. No, follow all of that. I understand that and i *thought* i expressed as much in my opening email. 2. This (same) certificate chain and associated private key is

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Thu, May 20, 2021 at 01:10:51AM +0300, IL Ka wrote: > > 2. This (same) certificate chain and associated private key is > > deployed > > on all the backend servers that sit behind the load-balancer. > > > > I wrote that CNAME doesn't work with several backends. > I now see it works

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread IL Ka
> > > 2. This (same) certificate chain and associated private key is > deployed > on all the backend servers that sit behind the load-balancer. > > I wrote that CNAME doesn't work with several backends. I now see it works if all backends share the same key and cert. Sounds good) Thank

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Thu, May 20, 2021 at 01:06:38AM +0300, IL Ka wrote: > Disclaimer: I am not a network guru, but here is what I know. Then don't distract the OP with speculative non-answers. > WIth CNAME scenario you can't have more than one backend. Because HAProxy > acts as L4 (TCP) balancer, it has no idea

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread IL Ka
Disclaimer: I am not a network guru, but here is what I know. WIth CNAME scenario you can't have more than one backend. Because HAProxy acts as L4 (TCP) balancer, it has no idea which server you are trying to connect to and which server's certificate you are waiting for. It just sends your packe

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Wed, May 19, 2021 at 05:13:32PM -0400, post...@ptld.com wrote: > > On 05-19-2021 5:06 pm, Viktor Dukhovni wrote: > > > > Why would the Postfix server have a "different certificate". > > DON'T DO THAT. > > Something is being lost in translation here. How could you not have a > different certi

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 5:26 pm, dev...@dvb.homelinux.org wrote: You need one certificate for submission.example.com which is present on all servers. But the problem is email clients are connecting to haproxy.example.com, if they are given the certificate from submission.example.com it will not work.

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread devdas
On Wed, May 19, 2021 at 04:51:42PM -0400, post...@ptld.com wrote: > > On 05-19-2021 4:34 pm, IL Ka wrote: > > Do you really have such a big load so one submission postfix isn't > > enough? > > I don't know what i don't know. Im building it so i can easily add more > servers if/when needed. > On a

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 5:06 pm, Viktor Dukhovni wrote: Why would the Postfix server have a "different certificate". DON'T DO THAT. Something is being lost in translation here. How could you not have a different certificate? They are two different physical servers, with two different public IP's and tw

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 4:52 pm, Viktor Dukhovni wrote: Now the client connects to submission.example.com and is being given an certificate from balanced1.example.com. Same problem exist. Why would you get a certificate for the internal name? That's clearly silly. Get a certificate for the external n

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
> On 19 May 2021, at 5:03 pm, post...@ptld.com wrote: > >> It aliases the server's hostname to the proxy. Clients connect to the >> proxy thinking it is the server, and expect the server's certificate, >> which the server will present, because the proxy is just doing layer 4. > > This is the

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 4:52 pm, Viktor Dukhovni wrote: It aliases the server's hostname to the proxy. Clients connect to the proxy thinking it is the server, and expect the server's certificate, which the server will present, because the proxy is just doing layer 4. This is the part im not following yo

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
> On 19 May 2021, at 4:43 pm, post...@ptld.com wrote: > >> Don't misconfigure the client to connect to "haproxy.example.com", instead >> publish a CNAME: >> submission.example.com. IN CNAME haproxy.example.com. >> Have the client connect to submission.example.com. The load >> balancing in "h

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 4:34 pm, IL Ka wrote: Do you really have such a big load so one submission postfix isn't enough? I don't know what i don't know. Im building it so i can easily add more servers if/when needed. On a typical dedicated server (Intel Xeon E5, 128G ram) how many messages (ball park)

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 4:29 pm, Viktor Dukhovni wrote: Don't misconfigure the client to connect to "haproxy.example.com", instead publish a CNAME: submission.example.com. IN CNAME haproxy.example.com. Have the client connect to submission.example.com. The load balancing in "haproxy" can be by

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread IL Ka
> > Load balancing. > Do you really have such a big load so one submission postfix isn't enough? If you are speaking about fault tolerance only, then you could run "submission only" postfix instead of haproxy. This postfix will then store messages in queue and send them to the appropriate backend

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread IL Ka
> > > > The client is trying to TLS with postfix, who has a certificate for > submission.example.com > The client is connected to haproxy.example.com > > haproxy.example.com:587 != crt submission.example.com You can create a certificate with several domain names. Honestly, I have never tried that

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
> On 19 May 2021, at 4:26 pm, post...@ptld.com wrote: > > How do i put the "correct certificate" (what is the correct cert?) on > submission.example.com when the client is connecting to and expecting a > certificate from haproxy.example.com ? Don't misconfigure the client to connect to "haproxy

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 4:19 pm, Viktor Dukhovni wrote: Deploy the correct certificate on Postfix, DO NOT intercept TLS on the proxy. Now we back full circle to my first question lol. This is what im asking best advice to do correctly. How do i put the "correct certificate" (what is the correct cert?) on

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
> This is what i originally tried before email the list. With this kind of > setup thunderbird reported: > > Sending of message failed. > Unable to communicate securely with peer: requested domain name does not > match the server's certificate. > > Postfix logs reported: > > warning: T

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 4:07 pm, Viktor Dukhovni wrote: The correct solution is to NOT terminate TLS on haproxy, and do TLS end-to-end from client to Postfix, with haproxy only handling layer 4 TCP. This is what i originally tried before email the list. With this kind of setup thunderbird reported:

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 3:33 pm, Viktor Dukhovni wrote: The haproxy system just copies raw bytes between client and server, it is not involved in TLS. The haproxy server will NOT be making a TLS connection to Postfix, the remote client will do that. Yes, this is my understanding. haproxy only proxies tra

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
> On 19 May 2021, at 4:05 pm, post...@ptld.com wrote: > >> Sharing private keys between two servers is an extremely bad idea IMHO > > I agree, which is why im asking for ideas to solve this correctly. The correct solution is to NOT terminate TLS on haproxy, and do TLS end-to-end from client to P

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 3:28 pm, IL Ka wrote: Why forward it via haproxy? What is wrong with postfix connected to the public IP? Load balancing. +--+ | email client | +--+ | +--+ | haproxy | -+ +--+ | | |

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Wed, May 19, 2021 at 03:49:28PM -0400, Wietse Venema wrote: > > I haven't yet have cause to look closely at the Postfix "haproxy" code. > > So I could be mistaken, but at first blush it appears that Postfix > > handles the haproxy protocol *before* TLS, even in wrapper mode. > > Haproxy can te

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Wietse Venema
Viktor Dukhovni: > > On 19 May 2021, at 3:07 pm, Wietse Venema wrote: > > > >> Server haproxy.example.com:587 accepts public connections and proxies to > >> submission.example.com:587 > >> Each server was given its own SSL cert (Let's Encrypt certbot). > > > > If the remote SMTP client negotiat

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
On Wed, May 19, 2021 at 03:28:03PM -0400, post...@ptld.com wrote: > > In which case the communication between haproxy and Postfix is > > always in the clear. And especially on port 587 (STARTTLS, not > > wrapper mode) the client will not initiate TLS until it gets through > > the initial ESMTP gr

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread IL Ka
> > > Server haproxy.example.com:587 accepts public connections and proxies to > submission.example.com:587 Why forward it via haproxy? What is wrong with postfix connected to the public IP? > > Each server was given its own SSL cert (Let's Encrypt certbot). > If you use haproxy TLS support, th

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
So bottom line, the OPs use-case of TLS on both haproxy and Postfix does not appear to make much sense... Sorry if i wasn't clear. Im just saying each server has a cert installed, as in general setup. The cert on the haproxy server isn't currently being used, but its there if needed depending

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
On 05-19-2021 3:07 pm, Wietse Venema wrote: If the remote SMTP client negotiates a TLS handshake with haproxy.example.com:587, then that remote SMTP client will not negotiate a TLS handshake with submission.example.com:587. Wietse But does the haproxy negotiate a handshake with the clie

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Viktor Dukhovni
> On 19 May 2021, at 3:07 pm, Wietse Venema wrote: > >> Server haproxy.example.com:587 accepts public connections and proxies to >> submission.example.com:587 >> Each server was given its own SSL cert (Let's Encrypt certbot). > > If the remote SMTP client negotiates a TLS handshake with > hapro

Re: Submission behind haproxy, TLS issues

2021-05-19 Thread Wietse Venema
post...@ptld.com: > Server haproxy.example.com:587 accepts public connections and proxies to > submission.example.com:587 > Each server was given its own SSL cert (Let's Encrypt certbot). If the remote SMTP client negotiates a TLS handshake with haproxy.example.com:587, then that remote SMTP clie

Submission behind haproxy, TLS issues

2021-05-19 Thread postfix
Server haproxy.example.com:587 accepts public connections and proxies to submission.example.com:587 Each server was given its own SSL cert (Let's Encrypt certbot). Postfix main.cf is using certbot cert for TLS smtpd_tls_cert_file = /etc/letsencrypt/live/submission.example.com/fullchain.pem

Re: How do I integrate Postfix MTA/SMTP Server with Cybonet PineApp Secure Email Gateway?

2021-05-19 Thread Kris Deugau
Turritopsis Dohrnii Teo En Ming wrote: I have asked this question in iRedMail support forums but nobody knows the answer. I have sent an email to Cybonet Technical Support but received no replies. My Postfix (+Amavisd) Linux mail server was installed and configured automatically using iRedMail

Re: SASL and PAM

2021-05-19 Thread Ivan Avery Frey
I will need to pay more careful attention to man pages. Thank you, Viktor. On Mon., May 17, 2021, 12:11 Viktor Dukhovni, wrote: > On Mon, May 17, 2021 at 10:07:40AM -0400, Wietse Venema wrote: > > > Bill Cole: > > > On 2021-05-17 at 09:32:41 UTC-0400 (Mon, 17 May 2021 09:32:41 -0400 > (EDT)) > >

Re: Emails sent as an authenticated user does not route throu amavis

2021-05-19 Thread Matus UHLAR - fantomas
On 19.05.21 15:03, Jonathan Sélea wrote: I am having trouble to figure out why emails send as an authenticated user (saslauthd) seems to not be "routed" via milters or amavis? just authenticated? The milter can ignore authenticated users. Also, milter can ignore some sending IP address - look a

Re: Emails sent as an authenticated user does not route throu amavis

2021-05-19 Thread IL Ka
> Hi! > > I am having trouble to figure out why emails send as an authenticated > user (saslauthd) seems to not be "routed" via milters or amavis? > Does the user use SMTP or sendmail command? There are 2 types of milters: http://www.postfix.org/postconf.5.html#non_smtpd_milters http://www.postfix

Re: Cannot connect to email server with client; postfix logs errors

2021-05-19 Thread Nathan Dehnel
I changed postfix and opendkim to use unix:/run/opendkim/opendkim.sock to communicate instead and it works now. Thanks for the assistance. On Mon, May 17, 2021 at 8:28 PM Bill Cole < postfixlists-070...@billmail.scconsult.com> wrote: > On 2021-05-17 at 19:02:10 UTC-0400 (Mon, 17 May 2021 18:02:10

How do I integrate Postfix MTA/SMTP Server with Cybonet PineApp Secure Email Gateway?

2021-05-19 Thread Turritopsis Dohrnii Teo En Ming
Subject: How do I integrate Postfix MTA/SMTP Server with Cybonet PineApp Secure Email Gateway? Good day from Singapore, Can I ask in this mailing list? I have asked this question in iRedMail support forums but nobody knows the answer. I have sent an email to Cybonet Technical Support but receiv

Re: AW: mysql entry needed?

2021-05-19 Thread postfix
On 05-19-2021 4:07 am, mauri...@caloro.ch wrote: Thanks meny time for your answer Please i need little more help, friedly ask for little help to recieve any feedback from following request. Think possible here mailbox_domain will have been used a few times, but on me setup I am not so success

Emails sent as an authenticated user does not route throu amavis

2021-05-19 Thread Jonathan Sélea
Hi! I am having trouble to figure out why emails send as an authenticated user (saslauthd) seems to not be "routed" via milters or amavis? I have another host that has the same setup where is works as expected. The only difference is the following in main.cf: Working host: mynetworks = 192

Re: Mail sent thru submission to user on same server.

2021-05-19 Thread Matus UHLAR - fantomas
On 05-18-2021 2:12 pm, Matus UHLAR - fantomas wrote: so, you have multiple instances? On 18.05.21 14:37, post...@ptld.com wrote: No, i don't have multiple instances of a postfix install. Postfix has multiple instances as in: in your other mail you still refer to them as two separate servers -

AW: mysql entry needed?

2021-05-19 Thread Maurizio
Thanks meny time for your answer Please i need little more help, friedly ask for little help to recieve any feedback from following request. Think possible here mailbox_domain will have been used a few times, but on me setup I am not so successful. root@mail:/etc/postfix# cat mysql-virtual_mailbo