Quantcast

IPv6 address format in -o content_filer in master.cf

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

IPv6 address format in -o content_filer in master.cf

Michael Konieczny
I'm running postfix + amavis, and I have the following in master.cf:

smtp      inet  n       -       n       -       -       smtpd
  -o content_filter=amavis:[127.0.0.1]:10024

amavis unix -      -       n       -       5       smtp
    -o smtp_bind_address=127.0.0.1

Works.

Now I'm trying to switch this to IPv6:

smtp      inet  n       -       n       -       -       smtpd
  -o content_filter=amavis:[::1]:10024

amavis unix -      -       n       -       5       smtp
    -o smtp_bind6_address=::1

And it doesn't work. I get the following in the log:

postfix/smtp[69016]: connect to ::1[::1]:10024: Operation timed out

Amavis is actually listening in IPv6:

/home/root # telnet -6 ::1 10024
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 [::1] ESMTP amavisd-new service ready

For my eye, IPv6 address in the log: ::1[::1]:10024 is suspisious,
there's doubled ::1 - looks strange.

How should I specify ::1 IPv6 address, for this to work?

Best regards,

--
Michael Konieczny
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IPv6 address format in -o content_filer in master.cf

Wietse Venema
Michael Konieczny:
> postfix/smtp[69016]: connect to ::1[::1]:10024: Operation timed out

If you don't like the ::1, specify a hostname. The logging format
is hostname[address]:port. If no hostname is available, it will log
the address instead.

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IPv6 address format in -o content_filer in master.cf

Michael Konieczny
>> postfix/smtp[69016]: connect to ::1[::1]:10024: Operation timed out
>
> If you don't like the ::1, specify a hostname. The logging format
> is hostname[address]:port. If no hostname is available, it will log
> the address instead.

OK, so log format is clarified.
Still, it doesn't connect to ::1, but connects to 127.0.0.1.
amavis listens on both ::1 and 127.0.0.1, confirmed using telnet, every
other local connection over ::1 works (I have several of them, for
example IPAP and SMTP with www interface to email, configured to use ::1).
Just this one is stubborn: -o content_filter=amavis:[::1]:10024
What am I missing?

--
Michael Konieczny

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IPv6 address format in -o content_filer in master.cf

Benny Pedersen-2
Michael Konieczny skrev den 2017-02-13 15:37:

> OK, so log format is clarified.
> Still, it doesn't connect to ::1, but connects to 127.0.0.1.
> amavis listens on both ::1 and 127.0.0.1, confirmed using telnet, every
> other local connection over ::1 works (I have several of them, for
> example IPAP and SMTP with www interface to email, configured to use
> ::1).
> Just this one is stubborn: -o content_filter=amavis:[::1]:10024
> What am I missing?

solution is to use 127.0.0.1 ip imho :=)

but more tecknicaly:

# /etc/hosts
::1 localhost.localdomain localhost ipv6

in your servers use amavis:[ipv6]:portnumber

it will possible soon be wildly used
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IPv6 address format in -o content_filer in master.cf

Wietse Venema
In reply to this post by Michael Konieczny
Michael Konieczny:
> >> postfix/smtp[69016]: connect to ::1[::1]:10024: Operation timed out

Of course that timeout problem is outside the scope of Postfix.

> > If you don't like the ::1, specify a hostname. The logging format
> > is hostname[address]:port. If no hostname is available, it will log
> > the address instead.
>
> OK, so log format is clarified.
> Still, it doesn't connect to ::1, but connects to 127.0.0.1.

If a connection request to ::1 fails, or results in a connection
to 127.0.0.1, then that is an issue with your IP stack, and should
be resolved in a different forum.  You're welcome to report the
resolution here, as that is relevant to Postfix.

Run the Postfix SMTP client under strace, see what syscalls it
makes, and how they fail.  http://www.postfix.org/DEBUG_README.html

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IPv6 address format in -o content_filer in master.cf

Michael Konieczny
>> Still, it doesn't connect to ::1, but connects to 127.0.0.1.
>
> If a connection request to ::1 fails, or results in a connection
> to 127.0.0.1, then that is an issue with your IP stack, and should
> be resolved in a different forum.  You're welcome to report the
> resolution here, as that is relevant to Postfix.
>
> Wietse

At last, works. My mistake, sorry to bother you with all this.

I turned on debugging, and got this in log:

postfix/smtp[40170]: smtp_connect_addr: bind 2001:1a68:1::3
postfix/smtp[40170]: smtp_connect_addr: trying: ::1[::1] port 10024...

Local bind address was wrong, i misplaced '6' character in parameter:

amavis unix -      -       n       -       5       smtp
    -o smtp_bind_address=127.0.0.1
    -o smtp_bind6_address=::1

Should be smtp_bind_address6 instead of smtp_bind6_address and now works
like a charm.

Thumbs up for all your work and 20 years of dedication.

Best regards,

--
Michael Konieczny
Loading...