smtp-sink on ipv4 and ipv6?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

smtp-sink on ipv4 and ipv6?

A. Schulze
Hello,

postfix usually listen on both protocols if main.cf contain "inet_protocols = all" and myhostname is setup properly.
May I expect that also for smtp-sink?

$ host mail.example.com
mail.example.com has address 192.0.2.25
mail.example.com has IPv6 address 2001:db8::25

$ smtp-sink inet:mail.example.com:25 &

now I've only a listener on 2001:db8::25 but not on 192.0.2.25, but I would like smtp-sink listen on ipv4 AND ipv6.
is that possible?

Andreas
Reply | Threaded
Open this post in threaded view
|

Re: smtp-sink on ipv4 and ipv6?

Wietse Venema
A. Schulze:
> Hello,
>
> postfix usually listen on both protocols if main.cf contain "inet_protocols = all" and myhostname is setup properly.
> May I expect that also for smtp-sink?

The manpage for these programs do not mention main.cf. They do
however describe command-line options to select protocols.

smtp-sink listens on one port. To listen on both IPv4 and IPv6
ports:

smtp-sink -4 ...
smtp-sink -6 ...

This is a test program, so it does not get the same level of support
as non-test code. If someonme feels strongly about this they can
submit a manpage change, or they can send me code that duplicates
parts from the master daemon's connection management (build an
inet_addr_list; for each address in that list call inet_listen();
wait for events on all sockets returned by inet_listen(). Maybe
some of that can be encapsulated in library functions that can
also be called by the master daemon).

        Wietse

> $ host mail.example.com
> mail.example.com has address 192.0.2.25
> mail.example.com has IPv6 address 2001:db8::25
>
> $ smtp-sink inet:mail.example.com:25 &
>
> now I've only a listener on 2001:db8::25 but not on 192.0.2.25, but I would like smtp-sink listen on ipv4 AND ipv6.
> is that possible?
>
> Andreas
>
Reply | Threaded
Open this post in threaded view
|

Re: smtp-sink on ipv4 and ipv6?

A. Schulze


Am 05.11.2017 um 19:40 schrieb Wietse Venema:

> A. Schulze:
>> Hello,
>>
>> postfix usually listen on both protocols if main.cf contain "inet_protocols = all" and myhostname is setup properly.
>> May I expect that also for smtp-sink?
>
> The manpage for these programs do not mention main.cf. They do
> however describe command-line options to select protocols.
>
> smtp-sink listens on one port. To listen on both IPv4 and IPv6
> ports:
>
> smtp-sink -4 ...
> smtp-sink -6 ...
>
> This is a test program, so it does not get the same level of support
> as non-test code. If someonme feels strongly about this they can
> submit a manpage change, or they can send me code that duplicates
> parts from the master daemon's connection management (build an
> inet_addr_list; for each address in that list call inet_listen();
> wait for events on all sockets returned by inet_listen(). Maybe
> some of that can be encapsulated in library functions that can
> also be called by the master daemon).

Hello Wietse,

I'm aware smpt-sink/source are programs with limited level of support.
I was able to setup listener on IPv4 using -4 OR on IPv6 using -6. That works. But the manpage say

  Connections  can  be  accepted  on  IPv4  or  IPv6  endpoints,  or   on
  UNIX-domain  sockets.   IPv4 and IPv6 are the default.

And exactly that default is what I like but can't manage to setup.
Therefore my question...
If I re-read it as "inet is default, UNIX-domain sockets must be specified explicit"
it matched the current behavior :-)

Currently I'm fine with two separate instances.

Thanks!
Andreas