<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Just an update that I think I know what has been going on.</p>
<p>I believe I've been tripped up by two things.</p>
<p>1) Not always clearly reading the actual component being referred
to when "userid", "user" and "username" are used in official
online documentation or other web sources.</p>
<p>2) Setting up dovecot to accept delivery / auth on %n and
dropping the domain.<br>
</p>
<p><br>
</p>
<p>For #1 it is descriptions such as the following from the online
documentation which tripped me up</p>
<table style="margin: 0.5em 0px 0px 0.5em; border-collapse:
collapse; color: rgb(0, 0, 0); font-family: Arial, "Lucida
Grande", sans-serif; font-size: 16px; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2; text-align:
left; text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); text-decoration-style:
initial; text-decoration-color: initial;">
<tbody>
<tr>
<td style="padding: 0.25em 0.5em; border: 1pt solid rgb(173,
185, 204);">
<p class="line862" style="margin: 0px; padding: 0px;">%u</p>
</td>
<td style="padding: 0.25em 0.5em; border: 1pt solid rgb(173,
185, 204);">
<p class="line862" style="margin: 0px; padding: 0px;">user</p>
</td>
<td style="padding: 0.25em 0.5em; border: 1pt solid rgb(173,
185, 204);">
<p class="line862" style="margin: 0px; padding: 0px;">full
username (e.g. user@domain)</p>
</td>
</tr>
</tbody>
</table>
<table style="margin: 0.5em 0px 0px 0.5em; border-collapse:
collapse; color: rgb(0, 0, 0); font-family: Arial, "Lucida
Grande", sans-serif; font-size: 16px; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2; text-align:
left; text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); text-decoration-style:
initial; text-decoration-color: initial;">
<tbody>
<tr>
<td style="padding: 0.25em 0.5em; border: 1pt solid rgb(173,
185, 204);">
<p class="line862" style="margin: 0px; padding: 0px;">%n</p>
</td>
<td style="padding: 0.25em 0.5em; border: 1pt solid rgb(173,
185, 204);">
<p class="line862" style="margin: 0px; padding: 0px;">username</p>
</td>
<td style="padding: 0.25em 0.5em; border: 1pt solid rgb(173,
185, 204);">
<p class="line862" style="margin: 0px; padding: 0px;">user
part in user@domain, same as %u if there's no domain</p>
</td>
</tr>
</tbody>
</table>
<p>i.e. %n referring both to "username" and "user" where for
<a class="moz-txt-link-abbreviated" href="mailto:testing@example.com">testing@example.com</a> %n is testing and %u is <a class="moz-txt-link-abbreviated" href="mailto:testing@example.com">testing@example.com</a></p>
<p>Another one which could be clearer is the dovecot-sql.conf.ext
file gives a example database with username and domain fields and
the same file has an example password_query with the userid field.<br>
</p>
<p>For #2 failure to get to grips with #1 and also various examples
online which aren't fully context explained meant I had an
inconsistent set of queries.</p>
After getting to grips with that I changed my mysql auth to be
consistent and always return username and domain e.g.
<p>[Note in my database username contains "testing" and domain
"example.com")<br>
</p>
<p>password_query = SELECT username, domain [etc]</p>
<p>user_query = [does not return username or domain]</p>
<p>iterate_query = SELECT username,domain FROM users</p>
<p>i.e. note they all now return two separate fields with "testing"
and "example.com" which dovecot is merging as per the
documentation.<br>
</p>
<p>With that set up both <br>
</p>
<p>dovadm user '*'</p>
<p>and <br>
</p>
<p>doveadm -A [etc]</p>
<p>return and use <a class="moz-txt-link-abbreviated" href="mailto:testing@example.com">testing@example.com</a> <br>
</p>
<p>The last problem I had was that in my mail delivery (from an
alias file) I was using</p>
<p>testing: "dovecot-lda -d testing"</p>
<p>And that seems to trigger replication to trigger on testing as
well as <a class="moz-txt-link-abbreviated" href="mailto:testing@example.com">testing@example.com</a> being triggered when the user made
changes to their account.</p>
<p>So having changed the mysql as per above and the delivery to</p>
<p>testing: "dovecot-lda -d <a class="moz-txt-link-abbreviated" href="mailto:testing@example.com">testing@example.com</a>"</p>
<p>and having removed all entries without @domain from replication
with <br>
</p>
<p>doveadm replicator remove [entries without domains]</p>
<p>doveadm repliciator status <br>
</p>
<p>now returns the correct number of accounts and <br>
</p>
<p>doveadm repliciator status '*' <br>
</p>
<p>does not have "duplicate" entries.</p>
<p>Fingers crossed that is it and there are no other call which will
cause replication on "testing" as separate from
<a class="moz-txt-link-rfc2396E" href="mailto:testing@example.com">"testing@example.com"</a><br>
</p>
<p><br>
</p>
<p><br>
</p>
On 04/01/19 09:11, Daniel Schütze wrote:<br>
<blockquote type="cite"
cite="mid:04f20366-523a-fce2-42fe-9c23af5cf4f9@cwa.uk.com">I have
a replication set up with two dovecot 2.3.4 servers.
<br>
<br>
Messages appear to be replicating fine between them, however there
is an oddity when I run doveadm replicator status '*' and I'm
worried work is being carried out needlessly.
<br>
<br>
Both machines have identical configs and have a mysql backend for
username/passwords. Both machines point to the same mysql server
and same tables.
<br>
<br>
When I run
<br>
<br>
doveadm user '*'
<br>
<br>
On either machine I am presented with the same correct list of
users. The users are presented in the form: username and not
username@domain.
<br>
<br>
When I run
<br>
<br>
doveadm replicator status '*'
<br>
<br>
On either machine I receive a list of usernames which includes not
only username but also username@domain. Both of these "accounts"
have fast sync, full sync and success sync entries and these are
not the same times between username and username@domain (hence I'm
worried unnecessary work is being carried out).
<br>
<br>
My ee dovecot-sql.conf.ext
<br>
<br>
Has these entires re usernames
<br>
<br>
user_query = SELECT home, uid, gid FROM users WHERE username =
'%n'
<br>
<br>
password_query = SELECT username AS user, domain, password, home
AS userdb_home, uid AS userdb_uid, gid AS userdb_gid FROM users
WHERE username = '%u'
<br>
<br>
[Having copied these in I do see the different usage of %u and %n]
<br>
<br>
iterate_query = SELECT username AS user,domain FROM users
<br>
<br>
The users table is as follows
<br>
<br>
+--------------+--------------+------+-----+---------+-------+
<br>
| Field | Type | Null | Key | Default | Extra |
<br>
+--------------+--------------+------+-----+---------+-------+
<br>
| username | varchar(128) | NO | | NULL | |
<br>
| domain | varchar(128) | NO | | NULL | |
<br>
| password | varchar(64) | NO | | NULL | |
<br>
| home | varchar(255) | NO | | NULL | |
<br>
| uid | int(11) | NO | | NULL | |
<br>
| gid | int(11) | NO | | NULL | |
<br>
| active | char(1) | NO | | Y | |
<br>
| mail_replica | varchar(255) | NO | | NULL | |
<br>
+--------------+--------------+------+-----+---------+-------+
<br>
<br>
I assume that the duplication of username with and without domains
isn't as intended, any suggestions where I am going wrong?
<br>
<br>
I did previously have the servers running with the iterate query
commented out and when that was the case
<br>
<br>
doveadm user '*'
<br>
<br>
returned the correct number of accounts but in the format
username@domain and the replicator status again 'double listed'
accounts as described above.
<br>
<br>
Thank you for any tips!
<br>
<br>
<br>
<br>
</blockquote>
</body>
</html>