<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0">director_mail_servers setting uses IP Adresses as values https://doc.dovecot.org/settings/core/#core_setting-director_mail_servers
<div class="ContentPasted0">As described in the documentation, hostnames are converted to addresses when the configuration is read https://doc.dovecot.org/settings/types/#ip-addresses</div>
<div class="ContentPasted0"><br>
</div>
<div class="ContentPasted0">This is acceptable in host or virtual machine environment, but becomes a problem in a containerized environment. When any backend container is restarted, its address will change and users related to this backend can no longer connect,
but backend (available with new IP address) can process request</div>
<div class="ContentPasted0">for example,</div>
<div class="ContentPasted0">director_mail_servers = dovecot-1 dovecot-2 dovecot-3</div>
<div class="ContentPasted0">becomes in runtime (with one successfully connectetd user foo@example.com)</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">doveadm director status</div>
<div class="ContentPasted0">mail server ip tag vhosts state state changed users</div>
<div class="ContentPasted0">10.0.71.3 100 up - 0</div>
<div class="ContentPasted0">10.0.71.4 100 up - 1</div>
<div class="ContentPasted0">10.0.71.5 100 up - 0</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">where</div>
<div class="ContentPasted0">dovecot-1 10.0.71.3, dovecot-2 10.0.71.4, dovecot-3 10.0.71.5</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">When dovevecot-2 backend container restarts, and becomes new IP address, user can't connect to related backend:</div>
<div class="ContentPasted0">imap-login: Info: proxy(foo@example.com,10.0.71.4:143): Started proxying to <10.0.71.4> (<dovecot-2>) (0.009 secs)</div>
<div class="ContentPasted0">imap-login: Error: proxy(foo@example.com,10.0.71.4:143): connect(10.0.71.4, 143) failed: No route to host (after 28 secs, 3 reconnects, local=10.0.71.13:41066)</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">My suggestion to developers: resolve backend hostnames to IP address on every request to director_mail_servers</div>
<div><br class="ContentPasted0">
</div>
It's not about dovemon service with active health checks from dovecot pro, just dynamic hostname resolve<br>
</span></div>
</body>
</html>