<div dir="ltr"><div></div><div>Actually, it seems I may have been wrong in initial assumption that the issue with the client was that it was being identified to mysql as coming from localhost when connecting via tcp.</div><div>This is what syslog indicated as a reason for the failure but its not the whole picture. <br></div><div><br></div><div>As John mentioned I am trying to have dovecot connect over TCP to mysql (not using the socket), and the issue looked like the cause was the identified by portion of mysql being read by either mysql incorrectly or the domain portion being overwritten on dovecot's end (I don't know about the internals enough to say for sure where).<br></div><div><br></div><div>Just as due dilligence, I added credentials for a mysql user identified by localhost and removed the jail since the dovecot error was stating that it failed for connection by user@'localhost' (where there weren't credentials).</div><div>After adding the credentials, I performed all the usual mysql tests before moving testing up to dovecot and still get an auth failure. The log seems to be a bit of a red herring or at the minimum doesn't show the whole picture. <br></div><div></div><div><br></div><div>Replacing the connection string host with the socket (host=localhost) and everything works, and using an external IP that's not 127.0.0.1 works as expected as well. (confirmed by standing up two isolated mysql and dovecot containers and setting auth up over the bridge). <br></div><div><br></div><div>If the issue was caused by user@'localhost' creating the credentials should have resolved it, and it didn't. So something weird is going on.<br></div><div></div><div>I've got the environment built up in a dockerfile I can provide if anyone wants to dig into what's causing it.<br></div><div><br></div><div>In the meantime due to time constraints, I'll just be working with the socket file from now for hosts running most of the mail stack all in one.<br></div><div><div><div><br><div>Best Regards,</div><div>Lorek.<br></div></div><div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jun 30, 2019 at 10:09 PM John Fawcett via dovecot <<a href="mailto:dovecot@dovecot.org">dovecot@dovecot.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 30/06/2019 13:36, Aki Tuomi via dovecot wrote:<br>
>><br>
>> Hello, I'm trying to work through an issue that cropped up on a server I've been working on and haven't found a very good workaround.<br>
>><br>
>> Dovecot is operating in a jailed environment.<br>
>><br>
>> The configuration in dovecot-sql.conf.ext has been set appropriately with the host=127.0.0.1 (which works from a jailed environment) and when dovecot attempts to auth it appears to perform a reverse dns lookup and overwrites the host with the result localhost before using the msql credentials 'user'@'localhost' which then fails after timing out. <br>
>><br>
>> I'm currently running version 2.2.33.2 of dovecot.<br>
>><br>
>> The workaround seems to be to have two credentials for the same user. <br>
>> 'user@'localhost' and 'user'@'127.0.0.1'; <br>
>> postfix operates in a jail as well and works around the jail issue in the same way but doesn't overwrite the specified host with a reverse dns lookup.<br>
>><br>
>> Anyone have any suggestions on how to handle this issue better? or maybe there's a way to force different behavior which I haven't yet found in the documentation?<br>
>><br>
>> Any help is much appreciated.<br>
>><br>
>> Best Regards.<br>
> Hi!<br>
><br>
> The 127.0.0.1 issue is actually a MySQL issue, unfortunately. <br>
><br>
> " On Unix, MySQL programs treat the host name localhost specially, in a way that is likely different from what you expect compared to other network-based programs: the client connects using a Unix socket file. The --socket option or the MYSQL_UNIX_PORT environment variable may be used to specify the socket name. "<br>
><br>
> So not really something we could do much about.<br>
><br>
> Aki<br>
<br>
Aki<br>
<br>
it is possible to force the use of tcp socket instead of unix socket by<br>
specifying an ip instead of the hostname localhost. As I understood it<br>
Nathan is specifying 127.0.0.1 so that will connect with tcp socket.<br>
<br>
John<br>
<br>
</blockquote></div>