Hi, > Is "_submission._tcp" special only in the SMTP client? What happens > with "_submission._tcp.$mydomain in other Postfix programs?
_submission._tcp is special only to SMTP client. Behaviour of all other programs remains the same. > The patch changes the global proto_info structure. That is unnecessary, > and I have changed Postfix 3.6 to use "const INET_PROTO_INFO *" > pointers everywhere, to prevent such unnecessary changes in the future. You are right. Fixed in the new patch posted on https://tkorbar.fedorapeople.org/postfix-3.5.4-relayhost.patch > What is the difference in behavior between > > [_submission._tcp.$mydomain]:587 > > and > > _submission._tcp.$mydomain:587 In the first case, smtp client will perform directly lookup for SRV record of submission service of domain specified with $mydomain. In the second case, smtp client will at first try to perform lookup for MX record of "_submission._tcp.$mydomain" domain, which will most likely fail and in response to that, smtp_host_addr function will be called and that will cause the name to be resolved the same way as in the previous case. > What happens when DNS lookup is disabled (smtp_lookup = native)? > I suppose the same thing that happens in other Postfix programs? This behaviour is not changed in any way. if enclosed in square brackets smtp client will perform lookup in /etc/hosts for A record of "_submission._tcp.$mydomain". On the other hand, i either do not understand the code correctly or smtp_lookup option does not have any effect when the hostname is not enclosed in square brackets. Either way the result is the same as in the first case. Please correct me if i am wrong. > Where is the documentation that describes how this works? Please point me where I should write it. >The SRV handler in libpostfix-dns should parse the entire record. Ok. What is your preference on how this should be done? Should i leave it with hostname within the buffer that gets passed to dns_rr_create function and then handle it inside smtp_addr_one function or do you have something else in mind? > These questions may seem unhelpful, but the onus is not on me to > solve the problems when someone writes new code. On the contrary, they were very helpful. Thanks for your help. On Mon, Jul 27, 2020 at 4:04 PM Wietse Venema <wie...@porcupine.org> wrote: > Tomas Korbar: > > Hi guys, > > I would like to start a discussion about support for SRV records, mainly > > record for submission service of a domain. > > As is stated in [0], domain can publish dns record, which tells services > > where the submission service of this domain is. > > This could be used for auto configuration of postfixs relayhost option. > > I used this patch [1] to make postfix 3.5.4 support resolving of this: > > "relayhost = [_submission._tcp.$mydomain]:587" > > as a valid host for submission of mail in my domain. This will allow > users > > to automate their configurations a little more. > > I would like to know your opinion and whether this could be officially > > supported. > > Thanks for any help. > > > > [0] - https://tools.ietf.org/html/rfc6186#section-3 > > [1] - https://tkorbar.fedorapeople.org/postfix-3.5.4-relayhost.patch > > Is "_submission._tcp" special only in the SMTP client? What happens > with "_submission._tcp.$mydomain in other Postfix programs? > > The patch changes the global proto_info structure. That is unnecessary, > and I have changed Postfix 3.6 to use "const INET_PROTO_INFO *" > pointers everywhere, to prevent such unnecessary changes in the future. > > What is the difference in behavior between > > [_submission._tcp.$mydomain]:587 > > and > > _submission._tcp.$mydomain:587 > > What happens when DNS lookup is disabled (smtp_lookup = native)? > I suppose the same thing that happens in other Postfix programs? > > Where is the documentation that describes how this works? > > The SRV handler in libpostfix-dns should parse the entire record. > > These questions may seem unhelpful, but the onus is not on me to > solve the problems when someone writes new code. > > Wietse > >