IMAP fails trying to connect to IPv6 host


  • Used Zammad version: 3.3
  • Used Zammad installation source: (source, package, …) Package
  • Operating system: Centos8
  • Browser + version: Brave

I see that when Zammad tries to connect to an IMAP server, it tries to use the IPv6 address which is resolved even though IPv6 is disabled/not available on the host.

I, [2020-06-08T11:01:45.889192 #17293-47324879262320]  INFO -- : fetching imap ( port=993,ssl=true,starttls=false,folder=INBOX,keep_on_server=true)
E, [2020-06-08T11:01:45.890996 #17293-47324879262320] ERROR -- : Can't use Channel::Driver::Imap: #<Errno::EADDRNOTAVAIL: Cannot assign requested address - connect(2) for [2a00:1450:4025:402::6d]:993>
E, [2020-06-08T11:01:45.891048 #17293-47324879262320] ERROR -- : Cannot assign requested address - connect(2) for [2a00:1450:4025:402::6d]:993 (Errno::EADDRNOTAVAIL)
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/socket.rb:1213:in `__connect_nonblock'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/socket.rb:1213:in `connect_nonblock'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/socket.rb:56:in `connect_internal'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/socket.rb:137:in `connect'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/socket.rb:641:in `block in tcp'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/socket.rb:227:in `each'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/socket.rb:227:in `foreach'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/socket.rb:631:in `tcp'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/net/imap.rb:1132:in `tcp_socket'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/net/imap.rb:1089:in `initialize'
/opt/zammad/app/models/channel/driver/imap.rb:107:in `new'
/opt/zammad/app/models/channel/driver/imap.rb:107:in `block in fetch'
/opt/zammad/app/models/channel/driver/imap.rb:517:in `block in timeout'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/timeout.rb:33:in `block in catch'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/timeout.rb:33:in `catch'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/timeout.rb:33:in `catch'
/opt/zammad/vendor/ruby-2.5.5/lib/ruby/2.5.0/timeout.rb:108:in `timeout'
/opt/zammad/app/models/channel/driver/imap.rb:516:in `timeout'
/opt/zammad/app/models/channel/driver/imap.rb:106:in `fetch'
/opt/zammad/app/models/channel.rb:56:in `fetch'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/activerecord- `each'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/activerecord- `each'
/opt/zammad/app/models/channel.rb:30:in `fetch'
(eval):1:in `_start_job'
/opt/zammad/app/models/scheduler.rb:287:in `eval'
/opt/zammad/app/models/scheduler.rb:287:in `_start_job'
/opt/zammad/app/models/scheduler.rb:239:in `block (2 levels) in start_job'
/opt/zammad/app/models/scheduler.rb:237:in `loop'
/opt/zammad/app/models/scheduler.rb:237:in `block in start_job'
/opt/zammad/vendor/bundle/ruby/2.5.0/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'

This is because your DNS server still returns an IPv6 address which ruby eventually will try to priotize over IPv4. After talking to a developer, ruby technically -theoretically- should also not use IPv6 as soon as the support for it is disabled on system level.

That you did reboot after disabling IPv6 support.
If you didn’t, the change will not be fully active.

This is proberbly rather a ruby issue over an application issue.

No problem, Ill give this a go and check all areas of IPv6 on the system have been disabled.

Most DNS providers will return a V6 address if its available.

I have rebooted and checked the interfaces which have no IPv6 addresses anymore etc.

Zammad still tries to use V6 when connecting to an IMAP server.

Sorry, I currently am missing time capacity to reproduce this.
However, when I last used ipv6 mail servers on an ipv4 only system it was working without any issues on a stable 3.3.

This might be a combination of configuration I currently can’t dig deeper into. Sorry.

It does eventually collect over v4, but I thought id bring this to the forum for their review

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.