make smtpd listen on IPv6 as well

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

make smtpd listen on IPv6 as well

Simon Brereton-3
Hi

Currently the smtpd for receiving mails from amavis is set up like:

119 #The amavis reciever
120 127.0.0.1:10025 inet n - - - - smtpd

Consequently it listens only IPv4

~# netstat -tulpn | grep 10025
tcp        0      0 127.0.0.1:10025         0.0.0.0:*
LISTEN      4849/master

Amavis is listening on both IPv4 and IPv6

# netstat -tulpn | grep 10024
tcp        0      0 127.0.0.1:10024         0.0.0.0:*
LISTEN      4135/amavisd-new (m
tcp6       0      0 ::1:10024               :::*
LISTEN      4135/amavisd-new (m

Do I need to duplicate the entry in master.cf or is there some more
elegant way to do it?

Currently inet is defined in main.cf as

 # postconf -n | grep -n inet
25:inet_interfaces = all

Thanks.

Simon
Reply | Threaded
Open this post in threaded view
|

Re: make smtpd listen on IPv6 as well

Wietse Venema
Simon B:

> Hi
>
> Currently the smtpd for receiving mails from amavis is set up like:
>
> 119 #The amavis reciever
> 120 127.0.0.1:10025 inet n - - - - smtpd
>
> Consequently it listens only IPv4
>
> ~# netstat -tulpn | grep 10025
> tcp        0      0 127.0.0.1:10025         0.0.0.0:*
> LISTEN      4849/master
>
> Amavis is listening on both IPv4 and IPv6
>
> # netstat -tulpn | grep 10024
> tcp        0      0 127.0.0.1:10024         0.0.0.0:*
> LISTEN      4135/amavisd-new (m
> tcp6       0      0 ::1:10024               :::*
> LISTEN      4135/amavisd-new (m
>
> Do I need to duplicate the entry in master.cf or is there some more
> elegant way to do it?

Specify 'localhost' instead of an IP address, and add 'localhost' entries
to /etc/hosts to avoid problems at boot time.

Alternatively specify no host, just 10025, in master.cf, and specify
inet_interfaces=loopback in main.cf.

        Wietse

> Currently inet is defined in main.cf as
>
>  # postconf -n | grep -n inet
> 25:inet_interfaces = all
>
> Thanks.
>
> Simon
>
Reply | Threaded
Open this post in threaded view
|

Re: make smtpd listen on IPv6 as well

Dominic Raferd


On Wed, 15 Jan 2020 at 17:03, Wietse Venema <[hidden email]> wrote:
Simon B:
> Hi
>
> Currently the smtpd for receiving mails from amavis is set up like:
>
> 119 #The amavis reciever
> 120 127.0.0.1:10025 inet n - - - - smtpd
>
> Consequently it listens only IPv4
>
> ~# netstat -tulpn | grep 10025
> tcp        0      0 127.0.0.1:10025         0.0.0.0:*
> LISTEN      4849/master
>
> Amavis is listening on both IPv4 and IPv6
>
> # netstat -tulpn | grep 10024
> tcp        0      0 127.0.0.1:10024         0.0.0.0:*
> LISTEN      4135/amavisd-new (m
> tcp6       0      0 ::1:10024               :::*
> LISTEN      4135/amavisd-new (m
>
> Do I need to duplicate the entry in master.cf or is there some more
> elegant way to do it?

Specify 'localhost' instead of an IP address, and add 'localhost' entries
to /etc/hosts to avoid problems at boot time.

Alternatively specify no host, just 10025, in master.cf, and specify
inet_interfaces=loopback in main.cf.

        Wietse

> Currently inet is defined in main.cf as
>
>  # postconf -n | grep -n inet
> 25:inet_interfaces = all

Or add
$inet_socket_bind = '127.0.0.1';
to your amavis configuration, which should stop it listening on ipv6
Reply | Threaded
Open this post in threaded view
|

Re: make smtpd listen on IPv6 as well

Simon Brereton-3
In reply to this post by Wietse Venema
On Wed, 15 Jan 2020 at 18:03, Wietse Venema <[hidden email]> wrote:

>
> Simon B:
> > Hi
> >
> > Currently the smtpd for receiving mails from amavis is set up like:
> >
> > 119 #The amavis reciever
> > 120 127.0.0.1:10025 inet n - - - - smtpd
> >
> > Consequently it listens only IPv4
> >
> > ~# netstat -tulpn | grep 10025
> > tcp        0      0 127.0.0.1:10025         0.0.0.0:*
> > LISTEN      4849/master
> >
> > Amavis is listening on both IPv4 and IPv6
> >
> > # netstat -tulpn | grep 10024
> > tcp        0      0 127.0.0.1:10024         0.0.0.0:*
> > LISTEN      4135/amavisd-new (m
> > tcp6       0      0 ::1:10024               :::*
> > LISTEN      4135/amavisd-new (m
> >
> > Do I need to duplicate the entry in master.cf or is there some more
> > elegant way to do it?
>
> Specify 'localhost' instead of an IP address, and add 'localhost' entries
> to /etc/hosts to avoid problems at boot time.

Thanks Wietse.  I went with this option.

> Alternatively specify no host, just 10025, in master.cf, and specify
> inet_interfaces=loopback in main.cf.

This option closes the submission port on the external interface.

(for anyone else reading the archives, postconf.5 says the accepted value is:

inet_interfaces = loopback-only (Postfix version 2.2 and later))

Regards

Simon