smtpd and submission inet_interfaces

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

smtpd and submission inet_interfaces

Nick-5
Can these be different - e.g. smtpd listens on 0.0.0.0  and [::], while
submission listens on 127.0.0.1 and [::1]?

Adding '-o inet_interfaces=loopback-only' in master.cf under the
submission service then restarting postfix made no difference, according
to 'ss'.

Thanks
--
Nick
Reply | Threaded
Open this post in threaded view
|

Re: smtpd and submission inet_interfaces

Wietse Venema
Nick:
> Can these be different - e.g. smtpd listens on 0.0.0.0  and [::], while
> submission listens on 127.0.0.1 and [::1]?
>
> Adding '-o inet_interfaces=loopback-only' in master.cf under the
> submission service then restarting postfix made no difference, according
> to 'ss'.

master.cf settings override main.cf settings, and main.cf settings
override built-in default settings.

You can configure Postfix receive email on any IP address, as long
as the IP address is configured (as primary or alias).

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: smtpd and submission inet_interfaces

Nick-5
On 2020-05-08 18:41 BST, Wietse Venema wrote:
> master.cf settings override main.cf settings, and main.cf settings
> override built-in default settings.
>
> You can configure Postfix receive email on any IP address, as long
> as the IP address is configured (as primary or alias).

I'll try again at my question, maybe it wasn't clear.  On my server,
'ss -l -4 -t' show postfix listening on these addresses:

   0.0.0.0:submission
   0.0.0.0:smtp

Can postfix be configured such that it changes to

 127.0.0.1:submission
   0.0.0.0:smtp

(and similarly for ipv6)?

Thanks,
--
Nick
Reply | Threaded
Open this post in threaded view
|

Re: smtpd and submission inet_interfaces

Wietse Venema
Nick:

> On 2020-05-08 18:41 BST, Wietse Venema wrote:
> > master.cf settings override main.cf settings, and main.cf settings
> > override built-in default settings.
> >
> > You can configure Postfix receive email on any IP address, as long
> > as the IP address is configured (as primary or alias).
>
> I'll try again at my question, maybe it wasn't clear.  On my server,
> 'ss -l -4 -t' show postfix listening on these addresses:
>
>    0.0.0.0:submission
>    0.0.0.0:smtp
>
> Can postfix be configured such that it changes to
>
>  127.0.0.1:submission
>    0.0.0.0:smtp
>
> (and similarly for ipv6)?

If you want two services to listen on different IP addresses, then
that requires an override in master.cf for at last one of the two
services. I am just repeating information that I already gave.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: smtpd and submission inet_interfaces

Nick-5
On 2020-05-08 18:59 BST, Wietse Venema wrote:

> Nick:
> > Can postfix be configured such that it changes to
> >
> >  127.0.0.1:submission
> >    0.0.0.0:smtp
> >
> > (and similarly for ipv6)?
>
> If you want two services to listen on different IP addresses, then
> that requires an override in master.cf for at last one of the two
> services. I am just repeating information that I already gave.

As I said in my original question, I added '-o
inet_interfaces=loopback-only' under submission in master.cf and
restarted postfix.  It made no difference, according to 'ss'.
--
Nick
Reply | Threaded
Open this post in threaded view
|

Re: smtpd and submission inet_interfaces

Wietse Venema
Nick:

> On 2020-05-08 18:59 BST, Wietse Venema wrote:
> > Nick:
> > > Can postfix be configured such that it changes to
> > >
> > >  127.0.0.1:submission
> > >    0.0.0.0:smtp
> > >
> > > (and similarly for ipv6)?
> >
> > If you want two services to listen on different IP addresses, then
> > that requires an override in master.cf for at last one of the two
> > services. I am just repeating information that I already gave.
>
> As I said in my original question, I added '-o
> inet_interfaces=loopback-only' under submission in master.cf and
> restarted postfix.  It made no difference, according to 'ss'.

You need to specify the IP address override as

    127.0.0.1:submission  ..  ..  ..  ..  ..  ..  smtpd

in master.cf.

The master daemon determines what IP address a service will listen
on, therefore giving that address as a parameter to the submission
daemon is too late.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: smtpd and submission inet_interfaces

Nick-5
On 2020-05-08 19:26 BST, Wietse Venema wrote:
> You need to specify the IP address override as
>
>     127.0.0.1:submission  ..  ..  ..  ..  ..  ..  smtpd
>
> in master.cf.

That works for ipv4 and "[::1]:submission ..." works for ipv6.  I'm
further than I was, thanks.

Is there a way to make it work for both ipv4 and ipv6 at the same time?
I tried "127.0.0.1,[::1]:submission ..." but postfix wouldn't start.
--
Nick
Reply | Threaded
Open this post in threaded view
|

Re: smtpd and submission inet_interfaces

Wietse Venema
Nick:

> On 2020-05-08 19:26 BST, Wietse Venema wrote:
> > You need to specify the IP address override as
> >
> >     127.0.0.1:submission  ..  ..  ..  ..  ..  ..  smtpd
> >
> > in master.cf.
>
> That works for ipv4 and "[::1]:submission ..." works for ipv6.  I'm
> further than I was, thanks.
>
> Is there a way to make it work for both ipv4 and ipv6 at the same time?
> I tried "127.0.0.1,[::1]:submission ..." but postfix wouldn't start.

See: http://www.postfix.org/master.5.html

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: smtpd and submission inet_interfaces

Nick-5
On 2020-05-08 20:03 BST, Wietse Venema wrote:
> Nick:
> > Is there a way to make it work for both ipv4 and ipv6 at the same time?
> > I tried "127.0.0.1,[::1]:submission ..." but postfix wouldn't start.
>
> See: http://www.postfix.org/master.5.html

I think I found the way, which is to repeat the entire submission
definition in master.cf and c h a n g e the a d d r e s s [my previous
post was bounced so I'm trying those words with spaces].  If there is a
more succinct way, that would be welcome.

Thanks
--
Nick
Reply | Threaded
Open this post in threaded view
|

Re: smtpd and submission inet_interfaces

Wietse Venema
Nick:

> On 2020-05-08 20:03 BST, Wietse Venema wrote:
> > Nick:
> > > Is there a way to make it work for both ipv4 and ipv6 at the same time?
> > > I tried "127.0.0.1,[::1]:submission ..." but postfix wouldn't start.
> >
> > See: http://www.postfix.org/master.5.html
>
> I think I found the way, which is to repeat the entire submission
> definition in master.cf and c h a n g e the a d d r e s s [my previous
> post was bounced so I'm trying those words with spaces].  If there is a
> more succinct way, that would be welcome.

Alternatively, specify localhost:submission.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: smtpd and submission inet_interfaces

Nick-5
On 2020-05-08 20:15 BST, Wietse Venema wrote:
> Nick:
> > I think I found the way, which is to repeat the entire submission
> > definition in master.cf and c h a n g e the a d d r e s s [my previous
> > post was bounced so I'm trying those words with spaces].  If there is a
> > more succinct way, that would be welcome.
>
> Alternatively, specify localhost:submission.

That's exactly what I needed - thanks.
--
Nick