Discussion:
Patch to support multiple destination on transport
King Cao
2013-07-15 09:50:59 UTC
Permalink
Dears,

Currently Postfix doesn't support multiple destinations on transport (eg:
smtp: [192.168.0.1]:25, [192.168.0.2]:10025 this is not supported).
However Postfix support multiple destination on smtp_fallback_relay (eg:
smtp_fallback_relay = [192.168.0.1]:25, [192.168.0.2]:10025).
Now I have implemented this feature(support multiple destinations) based
on Postfix 2.8.8 (it's easy to add it on latest version).
My question is who can I contact with to check whether/how I add my patch
on source code tree.
Many thanks in advance.


Regards,
King Cao
Wietse Venema
2013-07-15 12:17:01 UTC
Permalink
Post by King Cao
Dears,
smtp: [192.168.0.1]:25, [192.168.0.2]:10025 this is not supported).
smtp_fallback_relay = [192.168.0.1]:25, [192.168.0.2]:10025).
Now I have implemented this feature(support multiple destinations) based
on Postfix 2.8.8 (it's easy to add it on latest version).
My question is who can I contact with to check whether/how I add my patch
on source code tree.
Use smtp_fallback_relay.

Wietse
King Cao
2013-07-15 13:16:43 UTC
Permalink
Hi Wietse,

I know smtp_fallback_relay can support multiple destinations, however,
this setting is for all domains. If I want to set different multiple
destinations for different domains/sub domains, the only workaround is to
use MX query (without square bracket[]), but such workaround can't set
different port for different destinations. That's why I want to add some
patch to support multiple destinations for transport (also support
different port).

Regards,
King Cao
Post by Wietse Venema
Post by King Cao
Dears,
Currently Postfix doesn't support multiple destinations on transport
smtp: [192.168.0.1]:25, [192.168.0.2]:10025 this is not supported).
smtp_fallback_relay = [192.168.0.1]:25, [192.168.0.2]:10025).
Now I have implemented this feature(support multiple destinations)
based
Post by King Cao
on Postfix 2.8.8 (it's easy to add it on latest version).
My question is who can I contact with to check whether/how I add my
patch
Post by King Cao
on source code tree.
Use smtp_fallback_relay.
Wietse
Wietse Venema
2013-07-15 13:38:31 UTC
Permalink
Post by King Cao
smtp: [192.168.0.1]:25, [192.168.0.2]:10025 this is not supported).
smtp_fallback_relay = [192.168.0.1]:25, [192.168.0.2]:10025).
Now I have implemented this feature(support multiple destinations) based
on Postfix 2.8.8 (it's easy to add it on latest version).
My question is who can I contact with to check whether/how I add my patch
on source code tree.
Use smtp_fallback_relay.
I know smtp_fallback_relay can support multiple destinations, however,
this setting is for all domains. If I want to set different multiple
destinations for different domains/sub domains, the only workaround is to
use MX query (without square bracket[]), but such workaround can't set
different port for different destinations. That's why I want to add some
patch to support multiple destinations for transport (also support
different port).
Multiple destinations per nexthop would break queue manager's
concurrency scheduling policies or it would would break the queue
manager's independence of nexthop syntax.

I am suspicious about applications that require manual configuration
of different fallback routes for different destinations. If you
really need such things then you can use different transports, each
having their own smtp_fallback_relay, smtp_bind_address and so on.

Wietse
King Cao
2013-07-16 06:36:11 UTC
Permalink
If you go thru sour code: "smtp/smtp_connect.c", it will merge both
destinations in transport and multiple destinations in smtp_fallback_relay,
then try these destinations one by one. If destination is MX record format
(without square bracket), it will query all DNS MX record and try them one
by one. So MX format can support multiple destination in workaround,
however such support depends on DNS server. If we add such support by
adding several codes in "smtp/smtp_connect.c", I think it's more convenient
for user to set different destinations. That's why I want to add such patch
to current Postfix source code.
Post by Wietse Venema
Post by King Cao
Currently Postfix doesn't support multiple destinations on transport
smtp: [192.168.0.1]:25, [192.168.0.2]:10025 this is not supported).
smtp_fallback_relay = [192.168.0.1]:25, [192.168.0.2]:10025).
Now I have implemented this feature(support multiple destinations)
based
Post by King Cao
on Postfix 2.8.8 (it's easy to add it on latest version).
My question is who can I contact with to check whether/how I add my
patch
Post by King Cao
on source code tree.
Use smtp_fallback_relay.
I know smtp_fallback_relay can support multiple destinations, however,
this setting is for all domains. If I want to set different multiple
destinations for different domains/sub domains, the only workaround is to
use MX query (without square bracket[]), but such workaround can't set
different port for different destinations. That's why I want to add some
patch to support multiple destinations for transport (also support
different port).
Multiple destinations per nexthop would break queue manager's
concurrency scheduling policies or it would would break the queue
manager's independence of nexthop syntax.
I am suspicious about applications that require manual configuration
of different fallback routes for different destinations. If you
really need such things then you can use different transports, each
having their own smtp_fallback_relay, smtp_bind_address and so on.
Wietse
Wietse Venema
2013-07-16 10:49:55 UTC
Permalink
Post by King Cao
adding several codes in "smtp/smtp_connect.c", I think it's more convenient
for user to set different destinations. That's why I want to add such patch
to current Postfix source code.
Multiple destinations per nexthop would break queue manager's
concurrency scheduling policies or it would would break the queue
manager's independence of nexthop syntax.

I am suspicious about applications that require manual configuration
of different fallback routes for different destinations. If you
really need such things then you can use different transports, each
having their own smtp_fallback_relay, smtp_bind_address and so on.

Got it?

Wietse
King Cao
2013-07-17 02:47:47 UTC
Permalink
Hi Wietse,

I see your point. But current MX support will also cause this problem.
For example, if we configure the transport: "example.com smtp:
mx.example.com:25" which is supported by all Postfix version. smtp
daemon(smtp/smtp_connect.c) will query all MX records of "mx.example.com"
and try these mx records one by one according to preference.
My suggestion is that can we put such MX records into transport directly
to avoid DNS querying?
Suppose "mx.example.com" will return two MX records with IP addresses:
192.168.0.1, 192.168.0.2, can we set them in transport directly like:
example.com smtp:192.168.0.1:25#10, 192.168.0.1:10025#20. (#10, #20 means
the preference)

Currently we are hosting mail service, so each domain need to have
different setting like above example, the workaround is to setup DNS server
but it's more convenient if we can configure them in transport directly.
I have also searched the internet and there are also several similar
requirement for such multiple destination support, and all answers are DNS
format. So I think this support will be useful in some scenarios.

BTW, smtp_fallback_relay also support multiple destination? Will this
feature enabled also impact the queue's manager? Because we also use this
feature as backup solution for mail service.

Regards,
King Cao
Post by King Cao
Post by King Cao
adding several codes in "smtp/smtp_connect.c", I think it's more
convenient
Post by King Cao
for user to set different destinations. That's why I want to add such
patch
Post by King Cao
to current Postfix source code.
Multiple destinations per nexthop would break queue manager's
concurrency scheduling policies or it would would break the queue
manager's independence of nexthop syntax.
I am suspicious about applications that require manual configuration
of different fallback routes for different destinations. If you
really need such things then you can use different transports, each
having their own smtp_fallback_relay, smtp_bind_address and so on.
Got it?
Wietse
Wietse Venema
2013-07-17 11:02:57 UTC
Permalink
Post by King Cao
I see your point. But current MX support will also cause this
problem. For example, if we configure the transport: "example.com
smtp: mx.example.com:25" which is supported by all Postfix version.
smtp daemon(smtp/smtp_connect.c) will query all MX records of
"mx.example.com" and try these mx records one by one according to
preference.
That is how SMTP is defined in the Internet mail standard.
Postfix is optimized for the common scenario.
Post by King Cao
My suggestion is that can we put such MX records into transport
directly to avoid DNS querying?
There is no need to optimize Postfix for uncommon use cases. Spammers
can use separate transports each with their own source IP address,
fallback relay settings, and so on.

Wietse
King Cao
2013-07-18 05:20:34 UTC
Permalink
Hi Wietse,

Okay, I got it.

PS:
Attachment is my patch for this support based on postfix 2.8.8. If
someone want to same support, you can use it or contact with me.

Regards,
King Cao
Post by Wietse Venema
Post by King Cao
I see your point. But current MX support will also cause this
problem. For example, if we configure the transport: "example.com
smtp: mx.example.com:25" which is supported by all Postfix version.
smtp daemon(smtp/smtp_connect.c) will query all MX records of
"mx.example.com" and try these mx records one by one according to
preference.
That is how SMTP is defined in the Internet mail standard.
Postfix is optimized for the common scenario.
Post by King Cao
My suggestion is that can we put such MX records into transport
directly to avoid DNS querying?
There is no need to optimize Postfix for uncommon use cases. Spammers
can use separate transports each with their own source IP address,
fallback relay settings, and so on.
Wietse
Loading...