Re: Slow imap connection to local dovecot server

2018-03-26 Thread Joseph Tam

On Sun, 25 Mar 2018, Lothar Paltins wrote:


But very often the login from thunderbird to the dovecot server takes a
very long time, even if thunderbird and dovecot are running on the same
machine.  It can take more than a minute until I can read a message.  I
dont't have this problem with the remote imap servers of my mail
providers.


Sounds vaguely like a file locking problem.


Does anybody know, why this happens or how I could debug this issue?


Turn on verbose logging, then see if you can trigger the problem.  Also,
doveconf -n would help.

Joseph Tam 


Re: murmurhash3 test failures on big-endian systems

2018-03-26 Thread Josef 'Jeff' Sipek
On Mon, Mar 26, 2018 at 15:57:01 +0300, Apollon Oikonomopoulos wrote:
...
> I'd be happy to test the patch, thanks!

Ok, try the attached patch.  (It is a first pass at the issue, so it may not
be the final diff that'll end up getting committed.  It'd be good to know if
it actually fixes the issue for you - sadly, I don't have a big endian
system to play with.)

Thanks,

Jeff.

-- 
The obvious mathematical breakthrough would be development of an easy way to
factor large prime numbers.
- Bill Gates, The Road Ahead, pg. 265
diff --git a/src/lib/murmurhash3.c b/src/lib/murmurhash3.c
index 45dcc22..d0336a1 100644
--- a/src/lib/murmurhash3.c
+++ b/src/lib/murmurhash3.c
@@ -94,6 +94,8 @@ void murmurhash3_32 (const void *key, size_t len, uint32_t 
seed,
 
   h1 = fmix32(h1);
 
+  h1 = cpu32_to_be(h1);
+
   memcpy(out, &h1, sizeof(h1));
 }
 
@@ -206,6 +208,9 @@ void murmurhash3_128(const void *key, size_t len, uint32_t 
seed,
   h1 += h2;
   h2 += h1;
 
+  h1 = cpu64_to_be(h1);
+  h2 = cpu64_to_be(h2);
+
   memcpy(out, &h1, sizeof(h1));
   memcpy(out+sizeof(h1), &h2, sizeof(h2));
 }
@@ -323,6 +328,11 @@ void murmurhash3_128(const void *key, size_t len, uint32_t 
seed,
   h1 += h2; h1 += h3; h1 += h4;
   h2 += h1; h3 += h1; h4 += h1;
 
+  h1 = cpu32_to_be(h1);
+  h2 = cpu32_to_be(h2);
+  h3 = cpu32_to_be(h3);
+  h4 = cpu32_to_be(h4);
+
   memcpy(out, &h1, sizeof(h1));
   memcpy(out+sizeof(h1), &h2, sizeof(h2));
   memcpy(out+sizeof(h1)*2, &h3, sizeof(h3));
diff --git a/src/lib/test-murmurhash3.c b/src/lib/test-murmurhash3.c
index 9da3d28..4848fbd 100644
--- a/src/lib/test-murmurhash3.c
+++ b/src/lib/test-murmurhash3.c
@@ -7,7 +7,19 @@ struct murmur3_test_vectors {
const char *input;
size_t len;
uint32_t seed;
-   uint32_t result[4]; /* fits all results */
+
+   /* murmurhash3_128() produces a different output on ILP32 and LP64
+  systems (by design).  Therefore, we must use different expected
+  results based on what system we're on.  We define both all the
+  time, but use the below pre-processor magic to select which
+  version we'll use. */
+   uint8_t result_ilp32[MURMURHASH3_128_RESULTBYTES]; /* fits all results 
*/
+   uint8_t result_lp64[MURMURHASH3_128_RESULTBYTES]; /* fits all results */
+#ifdef _LP64
+#define result result_lp64
+#else
+#define result result_ilp32
+#endif
 };
 
 static void test_murmurhash3_algorithm(const char *name,
@@ -29,24 +41,49 @@ static void test_murmurhash3_algorithm(const char *name,
 
 static void test_murmurhash3_32(void)
 {
+   /* murmurhash3_32() produces the same output on both ILP32 and LP64
+  systems, so use the same expected outputs for both */
struct murmur3_test_vectors vectors[] = {
-   { "", 0, 0, { 0, 0, 0, 0}},
-   { "", 0, 0x1, { 0x514E28B7, 0, 0, 0 }},
-   { "", 0, 0x, { 0x81F16F39, 0, 0, 0 }},
-   { "\0\0\0\0", 4, 0, { 0x2362F9DE, 0, 0, 0 }},
-   { "", 4, 0x9747b28c, { 0x5A97808A, 0, 0, 0 }},
-   { "aaa", 3, 0x9747b28c, { 0x283E0130, 0, 0, 0 }},
-   { "aa", 2, 0x9747b28c, { 0x5D211726, 0, 0, 0 }},
-   { "a", 1, 0x9747b28c, { 0x7FA09EA6, 0, 0, 0 }},
-   { "abcd", 4, 0x9747b28c, { 0xF0478627, 0, 0, 0 }},
-   { "abc", 3, 0x9747b28c, { 0xC84A62DD, 0, 0, 0 }},
-   { "ab", 2, 0x9747b28c, { 0x74875592, 0, 0, 0 }},
-   { "Hello, world!", 13, 0x9747b28c, { 0x24884CBA, 0, 0, 0 }},
+   { "", 0, 0, { 0, }, { 0, } },
+   { "", 0, 0x1,
+ { 0x51, 0x4E, 0x28, 0xB7, },
+ { 0x51, 0x4E, 0x28, 0xB7, } },
+   { "", 0, 0x,
+ { 0x81, 0xF1, 0x6F, 0x39, },
+ { 0x81, 0xF1, 0x6F, 0x39, } },
+   { "\0\0\0\0", 4, 0,
+ { 0x23, 0x62, 0xF9, 0xDE, },
+ { 0x23, 0x62, 0xF9, 0xDE, } },
+   { "", 4, 0x9747b28c,
+ { 0x5A, 0x97, 0x80, 0x8A, },
+ { 0x5A, 0x97, 0x80, 0x8A, } },
+   { "aaa", 3, 0x9747b28c,
+ { 0x28, 0x3E, 0x01, 0x30, },
+ { 0x28, 0x3E, 0x01, 0x30, } },
+   { "aa", 2, 0x9747b28c,
+ { 0x5D, 0x21, 0x17, 0x26, },
+ { 0x5D, 0x21, 0x17, 0x26, } },
+   { "a", 1, 0x9747b28c,
+ { 0x7F, 0xA0, 0x9E, 0xA6, },
+ { 0x7F, 0xA0, 0x9E, 0xA6, } },
+   { "abcd", 4, 0x9747b28c,
+ { 0xF0, 0x47, 0x86, 0x27, },
+ { 0xF0, 0x47, 0x86, 0x27, } },
+   { "abc", 3, 0x9747b28c,
+ { 0xC8, 0x4A, 0x62, 0xDD, },
+ { 0xC8, 0x4A, 0x62, 0xDD, } },
+   { "ab", 2, 0x9747b28c,
+ { 0x74, 0x87, 0x55, 0x92, },
+ { 0x74, 0x87, 0x55, 0x92, } },
+   { "Hello, world!", 13, 0x9747b28c,
+ { 0x

Re: murmurhash3 test failures on big-endian systems

2018-03-26 Thread Apollon Oikonomopoulos
Hi Aki,

On 15:55 Mon 26 Mar , Aki Tuomi wrote:
> On 26.03.2018 15:49, Apollon Oikonomopoulos wrote:
> > Hi,
> >
> > The dovecot 2.3.0.1 Debian package currently fails to build on all 
> > big-endian architectures[1], due to murmurhash3 tests failing. The 
> > relevant output from e.g. s390x is:
> >
> >  test-murmurhash3.c:22: Assert(#8) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#11) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#12) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  murmurhash3 (murmurhash3_32) . : 
> > FAILED
> >  test-murmurhash3.c:22: Assert(#1) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#2) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#3) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#4) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#5) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#6) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#7) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#8) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#9) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#10) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#11) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#12) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  test-murmurhash3.c:22: Assert(#13) failed: memcmp(result, 
> > vectors[i].result, sizeof(result)) == 0
> >  murmurhash3 (murmurhash3_128)  : 
> > FAILED
> >
> > Looks like the murmurhash3 implementation in Dovecot is currently broken on
> > big-endian systems.
> >
> > Regards,
> > Apollon
> >
> > [1] 
> > https://buildd.debian.org/status/package.php?p=dovecot&suite=experimental
> Hi!
> 
> Thanks for reporting this, we'll look at it. It's not going to get fixed
> on 2.3.1 though, but we can provide a patch for that.

I'd be happy to test the patch, thanks!

Apollon


Re: murmurhash3 test failures on big-endian systems

2018-03-26 Thread Aki Tuomi


On 26.03.2018 15:49, Apollon Oikonomopoulos wrote:
> Hi,
>
> The dovecot 2.3.0.1 Debian package currently fails to build on all 
> big-endian architectures[1], due to murmurhash3 tests failing. The 
> relevant output from e.g. s390x is:
>
>  test-murmurhash3.c:22: Assert(#8) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#11) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#12) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  murmurhash3 (murmurhash3_32) . : 
> FAILED
>  test-murmurhash3.c:22: Assert(#1) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#2) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#3) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#4) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#5) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#6) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#7) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#8) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#9) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#10) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#11) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#12) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  test-murmurhash3.c:22: Assert(#13) failed: memcmp(result, vectors[i].result, 
> sizeof(result)) == 0
>  murmurhash3 (murmurhash3_128)  : 
> FAILED
>
> Looks like the murmurhash3 implementation in Dovecot is currently broken on
> big-endian systems.
>
> Regards,
> Apollon
>
> [1] https://buildd.debian.org/status/package.php?p=dovecot&suite=experimental
Hi!

Thanks for reporting this, we'll look at it. It's not going to get fixed
on 2.3.1 though, but we can provide a patch for that.

Aki


murmurhash3 test failures on big-endian systems

2018-03-26 Thread Apollon Oikonomopoulos
Hi,

The dovecot 2.3.0.1 Debian package currently fails to build on all 
big-endian architectures[1], due to murmurhash3 tests failing. The 
relevant output from e.g. s390x is:

 test-murmurhash3.c:22: Assert(#8) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#11) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#12) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 murmurhash3 (murmurhash3_32) . : FAILED
 test-murmurhash3.c:22: Assert(#1) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#2) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#3) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#4) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#5) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#6) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#7) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#8) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#9) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#10) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#11) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#12) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 test-murmurhash3.c:22: Assert(#13) failed: memcmp(result, vectors[i].result, 
sizeof(result)) == 0
 murmurhash3 (murmurhash3_128)  : FAILED

Looks like the murmurhash3 implementation in Dovecot is currently broken on
big-endian systems.

Regards,
Apollon

[1] https://buildd.debian.org/status/package.php?p=dovecot&suite=experimental


Re: BUG: Unknown command in userdb socket: CPID?2625

2018-03-26 Thread Gedalya
On 03/26/2018 02:03 PM, Vladimir Tiukhtin wrote:
> Do you have any document describing "special" names? Thanks

It's documented here.

https://wiki2.dovecot.org/Services#auth

I have to agree that it's kind of confusing. Would be clearer if it had a e.g. 
type=userdb setting.




dsync backuping folders only, not emails

2018-03-26 Thread Istvan Prosinger

Hi guys,

I have an issue when I try to backup a remote mailbox, apparently it 
exits with no errors, it creates the mailbox folders in local, but it 
doesn't copy any email.


doveadm -Dv -o dsync_features=empty-header-workaround -o 
imapc_host=secure.emailsrvr.com -o imapc_password='passwd' backup -R -u 
somem...@counselorinberlin.de imapc:


Any hints?

All the best,
Istvan


Re: BUG: Unknown command in userdb socket: CPID?2625

2018-03-26 Thread Aki Tuomi
Nothing definitive. It's just that the socket expects certain type of
input, this is comparable of trying to configure postfix to speak to
imap-master socket. There is no reason why it should work.

Aki


On 26.03.2018 15:03, Vladimir Tiukhtin wrote:
>
> Hi
>
> And why it is not working with that name? Do you have any document
> describing "special" names? Thanks
>
> Vladimir
>
>
> On 26/03/18 13:02, Aki Tuomi wrote:
>>
>> Dovecot has some special socket names, auth-userdb is one of those.
>>
>> Aki
>>
>>
>> On 26.03.2018 14:47, Vladimir Tiukhtin wrote:
>>>
>>> Hi
>>>
>>> What you have suggested works.
>>>
>>> service auth {
>>>    unix_listener /var/spool/postfix/private/auth {
>>>  user = postfix
>>>  group = postfix
>>>  mode = 0600
>>>   }
>>> }
>>>
>>> This works as well:
>>>
>>> service auth {
>>>    unix_listener /var/run/dovecot/auth {
>>>  owner = postfix
>>>  group = postfix
>>>  mode = 0600
>>>   }
>>> }
>>>
>>> And this works as well:
>>>
>>> service auth {
>>>    unix_listener /var/run/dovecot/auth-test-test {
>>>  owner = postfix
>>>  group = postfix
>>>  mode = 0600
>>>   }
>>> }
>>>
>>> And only when socket has name "auth-userdb"
>>>
>>> service auth {
>>>    unix_listener auth-userdb {
>>>  owner = postfix
>>>  group = postfix
>>>  mode = 0600
>>>   }
>>> }
>>>
>>> it doesn't.
>>>
>>> When socket name is "auth-userdb" I can see in the log:
>>>
>>> Mar 26 11:43:59 mail-server postfix/smtpd[3648]: connect from
>>> unknown[10.15.5.127]
>>> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Loading
>>> modules from directory: /usr/lib64/dovecot/auth
>>> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Module
>>> loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
>>> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Module
>>> loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
>>> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Wrote new
>>> auth token secret to /var/run/dovecot//auth-token-secret.dat
>>> Mar 26 11:43:59 mail-server postfix/smtpd[3648]: fatal: no SASL
>>> authentication mechanisms
>>> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: master in:
>>> CPID    3648
>>> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Error: BUG: Unknown
>>> command in userdb socket: CPID?3648
>>> Mar 26 11:44:00 mail-server postfix/master[3644]: warning: process
>>> /usr/libexec/postfix/smtpd pid 3648 exit status 1
>>> Mar 26 11:44:00 mail-server postfix/master[3644]: warning:
>>> /usr/libexec/postfix/smtpd: bad command startup -- throttling
>>>
>>> Vladimir
>>>
>>> On 26/03/18 09:55, Aki Tuomi wrote:
 Ah i see.

 try this:

 dovecot.conf:

 service auth {
    unix_listener /var/spool/postfix/private/auth {
  owner = postfix
  group = postfix
  mode = 0600
   }
 }

 postfix.conf:

 smtpd_sasl_path = private/auth

 Aki

 On 26.03.2018 11:25, Vladimir Tiukhtin wrote:
>
> Hello
>
> Yes, please find my postfix config:
>
> smtpd_sasl_type = dovecot
> #smtpd_sasl_path = /var/run/dovecot/auth
> smtpd_sasl_path = /var/run/dovecot/auth-userdb
> smtpd_sasl_auth_enable = yes
> smtpd_relay_restrictions = permit_mynetworks,
> permit_sasl_authenticated, reject_unauth_destination
>
> As I mentioned if I remove minus from socket name everything works
> perfect. Thanks
>
> Vladimir
>
>
> On 26/03/18 08:37, Aki Tuomi wrote:
>>
>> Did you tell postfix it's talking to dovecot?
>>
>> Aki
>>
>>
>> On 25.03.2018 20:29, Vladimir Tiukhtin wrote:
>>>
>>> Hi guys.
>>>
>>> I am getting strange error:
>>>
>>>
>>> BUG: Unknown command in userdb socket: CPID?2625
>>>
>>>
>>> I am using service auth  to authenticate users on postfix.
>>>
>>> *My OS*:
>>>
>>> # cat /etc/os-release
>>> NAME="CentOS Linux"
>>> VERSION="7 (Core)"
>>> ID="centos"
>>> ID_LIKE="rhel fedora"
>>> VERSION_ID="7"
>>> PRETTY_NAME="CentOS Linux 7 (Core)"
>>> ANSI_COLOR="0;31"
>>> CPE_NAME="cpe:/o:centos:centos:7"
>>> HOME_URL="https://www.centos.org/";
>>> BUG_REPORT_URL="https://bugs.centos.org/";
>>>
>>> CENTOS_MANTISBT_PROJECT="CentOS-7"
>>> CENTOS_MANTISBT_PROJECT_VERSION="7"
>>> REDHAT_SUPPORT_PRODUCT="centos"
>>> REDHAT_SUPPORT_PRODUCT_VERSION="
>>>
>>> *My dovecot:*
>>>
>>> # dovecot --version
>>> 2.2.10
>>>
>>> *My config*:
>>>
>>> service auth {
>>>   unix_listener auth-userdb {
>>>     mode = 0600
>>>     user = postfix
>>>     group = postfix
>>>   }
>>> }
>>>
>>> *My Postfix:*
>>>
>>> # rpm -qa | grep postf
>>> postfix-2.10.1-6.el7.x86_64
>>>
>>> *Log*:
>>>
>>> Mar 25 16:52:33 mail-server postfix/smtp

Re: BUG: Unknown command in userdb socket: CPID?2625

2018-03-26 Thread Vladimir Tiukhtin

Hi

And why it is not working with that name? Do you have any document 
describing "special" names? Thanks


Vladimir


On 26/03/18 13:02, Aki Tuomi wrote:


Dovecot has some special socket names, auth-userdb is one of those.

Aki


On 26.03.2018 14:47, Vladimir Tiukhtin wrote:


Hi

What you have suggested works.

service auth {
   unix_listener /var/spool/postfix/private/auth {
 user = postfix
 group = postfix
 mode = 0600
  }
}

This works as well:

service auth {
   unix_listener /var/run/dovecot/auth {
 owner = postfix
 group = postfix
 mode = 0600
  }
}

And this works as well:

service auth {
   unix_listener /var/run/dovecot/auth-test-test {
 owner = postfix
 group = postfix
 mode = 0600
  }
}

And only when socket has name "auth-userdb"

service auth {
   unix_listener auth-userdb {
 owner = postfix
 group = postfix
 mode = 0600
  }
}

it doesn't.

When socket name is "auth-userdb" I can see in the log:

Mar 26 11:43:59 mail-server postfix/smtpd[3648]: connect from 
unknown[10.15.5.127]
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Loading 
modules from directory: /usr/lib64/dovecot/auth
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Wrote new 
auth token secret to /var/run/dovecot//auth-token-secret.dat
Mar 26 11:43:59 mail-server postfix/smtpd[3648]: fatal: no SASL 
authentication mechanisms
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: master in: 
CPID    3648
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Error: BUG: Unknown 
command in userdb socket: CPID?3648
Mar 26 11:44:00 mail-server postfix/master[3644]: warning: process 
/usr/libexec/postfix/smtpd pid 3648 exit status 1
Mar 26 11:44:00 mail-server postfix/master[3644]: warning: 
/usr/libexec/postfix/smtpd: bad command startup -- throttling


Vladimir

On 26/03/18 09:55, Aki Tuomi wrote:

Ah i see.

try this:

dovecot.conf:

service auth {
   unix_listener /var/spool/postfix/private/auth {
 owner = postfix
 group = postfix
 mode = 0600
  }
}

postfix.conf:

smtpd_sasl_path = private/auth

Aki

On 26.03.2018 11:25, Vladimir Tiukhtin wrote:


Hello

Yes, please find my postfix config:

smtpd_sasl_type = dovecot
#smtpd_sasl_path = /var/run/dovecot/auth
smtpd_sasl_path = /var/run/dovecot/auth-userdb
smtpd_sasl_auth_enable = yes
smtpd_relay_restrictions = permit_mynetworks, 
permit_sasl_authenticated, reject_unauth_destination


As I mentioned if I remove minus from socket name everything works 
perfect. Thanks


Vladimir


On 26/03/18 08:37, Aki Tuomi wrote:


Did you tell postfix it's talking to dovecot?

Aki


On 25.03.2018 20:29, Vladimir Tiukhtin wrote:


Hi guys.

I am getting strange error:


BUG: Unknown command in userdb socket: CPID?2625


I am using service auth  to authenticate users on postfix.

*My OS*:

# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/";
BUG_REPORT_URL="https://bugs.centos.org/";

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="

*My dovecot:*

# dovecot --version
2.2.10

*My config*:

service auth {
  unix_listener auth-userdb {
    mode = 0600
    user = postfix
    group = postfix
  }
}

*My Postfix:*

# rpm -qa | grep postf
postfix-2.10.1-6.el7.x86_64

*Log*:

Mar 25 16:52:33 mail-server postfix/smtpd[2625]: connect from 
unknown[10.254.200.202]
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Loading 
modules from directory: /usr/lib64/dovecot/auth
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Read auth 
token secret from /var/run/dovecot//auth-token-secret.dat
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: master 
in: CPID    2625
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Error: BUG: 
Unknown command in userdb socket: CPID?2625
Mar 25 16:52:33 mail-server postfix/smtpd[2625]: fatal: no SASL 
authentication mechanisms
Mar 25 16:52:34 mail-server postfix/master[2424]: warning: 
process /usr/libexec/postfix/smtpd pid 2625 exit status 1
Mar 25 16:52:34 mail-server postfix/master[2424]: warning: 
/usr/libexec/postfix/smtpd: bad command startup -- throttling


The interesting thing is IF I am taking off "-" (minus) from the 
socket name, everything works just perfect! So if I change config to:


service a

Re: BUG: Unknown command in userdb socket: CPID?2625

2018-03-26 Thread Aki Tuomi
Dovecot has some special socket names, auth-userdb is one of those.

Aki


On 26.03.2018 14:47, Vladimir Tiukhtin wrote:
>
> Hi
>
> What you have suggested works.
>
> service auth {
>    unix_listener /var/spool/postfix/private/auth {
>  user = postfix
>  group = postfix
>  mode = 0600
>   }
> }
>
> This works as well:
>
> service auth {
>    unix_listener /var/run/dovecot/auth {
>  owner = postfix
>  group = postfix
>  mode = 0600
>   }
> }
>
> And this works as well:
>
> service auth {
>    unix_listener /var/run/dovecot/auth-test-test {
>  owner = postfix
>  group = postfix
>  mode = 0600
>   }
> }
>
> And only when socket has name "auth-userdb"
>
> service auth {
>    unix_listener auth-userdb {
>  owner = postfix
>  group = postfix
>  mode = 0600
>   }
> }
>
> it doesn't.
>
> When socket name is "auth-userdb" I can see in the log:
>
> Mar 26 11:43:59 mail-server postfix/smtpd[3648]: connect from
> unknown[10.15.5.127]
> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Loading
> modules from directory: /usr/lib64/dovecot/auth
> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Module loaded:
> /usr/lib64/dovecot/auth/libdriver_mysql.so
> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Module loaded:
> /usr/lib64/dovecot/auth/libdriver_sqlite.so
> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Wrote new auth
> token secret to /var/run/dovecot//auth-token-secret.dat
> Mar 26 11:43:59 mail-server postfix/smtpd[3648]: fatal: no SASL
> authentication mechanisms
> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: master in:
> CPID    3648
> Mar 26 11:43:59 mail-server dovecot[3577]: auth: Error: BUG: Unknown
> command in userdb socket: CPID?3648
> Mar 26 11:44:00 mail-server postfix/master[3644]: warning: process
> /usr/libexec/postfix/smtpd pid 3648 exit status 1
> Mar 26 11:44:00 mail-server postfix/master[3644]: warning:
> /usr/libexec/postfix/smtpd: bad command startup -- throttling
>
> Vladimir
>
> On 26/03/18 09:55, Aki Tuomi wrote:
>> Ah i see.
>>
>> try this:
>>
>> dovecot.conf:
>>
>> service auth {
>>    unix_listener /var/spool/postfix/private/auth {
>>  owner = postfix
>>  group = postfix
>>  mode = 0600
>>   }
>> }
>>
>> postfix.conf:
>>
>> smtpd_sasl_path = private/auth
>>
>> Aki
>>
>> On 26.03.2018 11:25, Vladimir Tiukhtin wrote:
>>>
>>> Hello
>>>
>>> Yes, please find my postfix config:
>>>
>>> smtpd_sasl_type = dovecot
>>> #smtpd_sasl_path = /var/run/dovecot/auth
>>> smtpd_sasl_path = /var/run/dovecot/auth-userdb
>>> smtpd_sasl_auth_enable = yes
>>> smtpd_relay_restrictions = permit_mynetworks,
>>> permit_sasl_authenticated, reject_unauth_destination
>>>
>>> As I mentioned if I remove minus from socket name everything works
>>> perfect. Thanks
>>>
>>> Vladimir
>>>
>>>
>>> On 26/03/18 08:37, Aki Tuomi wrote:

 Did you tell postfix it's talking to dovecot?

 Aki


 On 25.03.2018 20:29, Vladimir Tiukhtin wrote:
>
> Hi guys.
>
> I am getting strange error:
>
>
> BUG: Unknown command in userdb socket: CPID?2625
>
>
> I am using service auth  to authenticate users on postfix.
>
> *My OS*:
>
> # cat /etc/os-release
> NAME="CentOS Linux"
> VERSION="7 (Core)"
> ID="centos"
> ID_LIKE="rhel fedora"
> VERSION_ID="7"
> PRETTY_NAME="CentOS Linux 7 (Core)"
> ANSI_COLOR="0;31"
> CPE_NAME="cpe:/o:centos:centos:7"
> HOME_URL="https://www.centos.org/";
> BUG_REPORT_URL="https://bugs.centos.org/";
>
> CENTOS_MANTISBT_PROJECT="CentOS-7"
> CENTOS_MANTISBT_PROJECT_VERSION="7"
> REDHAT_SUPPORT_PRODUCT="centos"
> REDHAT_SUPPORT_PRODUCT_VERSION="
>
> *My dovecot:*
>
> # dovecot --version
> 2.2.10
>
> *My config*:
>
> service auth {
>   unix_listener auth-userdb {
>     mode = 0600
>     user = postfix
>     group = postfix
>   }
> }
>
> *My Postfix:*
>
> # rpm -qa | grep postf
> postfix-2.10.1-6.el7.x86_64
>
> *Log*:
>
> Mar 25 16:52:33 mail-server postfix/smtpd[2625]: connect from
> unknown[10.254.200.202]
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Loading
> modules from directory: /usr/lib64/dovecot/auth
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module
> loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module
> loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Read auth
> token secret from /var/run/dovecot//auth-token-secret.dat
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: master in:
> CPID    2625
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Error: BUG:
> Unknown command in userdb socket: CPID?2625
>>>

Re: BUG: Unknown command in userdb socket: CPID?2625

2018-03-26 Thread Vladimir Tiukhtin

Hi

What you have suggested works.

service auth {
   unix_listener /var/spool/postfix/private/auth {
 user = postfix
 group = postfix
 mode = 0600
  }
}

This works as well:

service auth {
   unix_listener /var/run/dovecot/auth {
 owner = postfix
 group = postfix
 mode = 0600
  }
}

And this works as well:

service auth {
   unix_listener /var/run/dovecot/auth-test-test {
 owner = postfix
 group = postfix
 mode = 0600
  }
}

And only when socket has name "auth-userdb"

service auth {
   unix_listener auth-userdb {
 owner = postfix
 group = postfix
 mode = 0600
  }
}

it doesn't.

When socket name is "auth-userdb" I can see in the log:

Mar 26 11:43:59 mail-server postfix/smtpd[3648]: connect from 
unknown[10.15.5.127]
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Loading modules 
from directory: /usr/lib64/dovecot/auth
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Module loaded: 
/usr/lib64/dovecot/auth/libdriver_mysql.so
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Module loaded: 
/usr/lib64/dovecot/auth/libdriver_sqlite.so
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: Wrote new auth 
token secret to /var/run/dovecot//auth-token-secret.dat
Mar 26 11:43:59 mail-server postfix/smtpd[3648]: fatal: no SASL 
authentication mechanisms
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Debug: master in: 
CPID    3648
Mar 26 11:43:59 mail-server dovecot[3577]: auth: Error: BUG: Unknown 
command in userdb socket: CPID?3648
Mar 26 11:44:00 mail-server postfix/master[3644]: warning: process 
/usr/libexec/postfix/smtpd pid 3648 exit status 1
Mar 26 11:44:00 mail-server postfix/master[3644]: warning: 
/usr/libexec/postfix/smtpd: bad command startup -- throttling


Vladimir

On 26/03/18 09:55, Aki Tuomi wrote:

Ah i see.

try this:

dovecot.conf:

service auth {
   unix_listener /var/spool/postfix/private/auth {
 owner = postfix
 group = postfix
 mode = 0600
  }
}

postfix.conf:

smtpd_sasl_path = private/auth

Aki

On 26.03.2018 11:25, Vladimir Tiukhtin wrote:


Hello

Yes, please find my postfix config:

smtpd_sasl_type = dovecot
#smtpd_sasl_path = /var/run/dovecot/auth
smtpd_sasl_path = /var/run/dovecot/auth-userdb
smtpd_sasl_auth_enable = yes
smtpd_relay_restrictions = permit_mynetworks, 
permit_sasl_authenticated, reject_unauth_destination


As I mentioned if I remove minus from socket name everything works 
perfect. Thanks


Vladimir


On 26/03/18 08:37, Aki Tuomi wrote:


Did you tell postfix it's talking to dovecot?

Aki


On 25.03.2018 20:29, Vladimir Tiukhtin wrote:


Hi guys.

I am getting strange error:


BUG: Unknown command in userdb socket: CPID?2625


I am using service auth  to authenticate users on postfix.

*My OS*:

# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/";
BUG_REPORT_URL="https://bugs.centos.org/";

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="

*My dovecot:*

# dovecot --version
2.2.10

*My config*:

service auth {
  unix_listener auth-userdb {
    mode = 0600
    user = postfix
    group = postfix
  }
}

*My Postfix:*

# rpm -qa | grep postf
postfix-2.10.1-6.el7.x86_64

*Log*:

Mar 25 16:52:33 mail-server postfix/smtpd[2625]: connect from 
unknown[10.254.200.202]
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Loading 
modules from directory: /usr/lib64/dovecot/auth
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Read auth 
token secret from /var/run/dovecot//auth-token-secret.dat
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: master in: 
CPID    2625
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Error: BUG: 
Unknown command in userdb socket: CPID?2625
Mar 25 16:52:33 mail-server postfix/smtpd[2625]: fatal: no SASL 
authentication mechanisms
Mar 25 16:52:34 mail-server postfix/master[2424]: warning: process 
/usr/libexec/postfix/smtpd pid 2625 exit status 1
Mar 25 16:52:34 mail-server postfix/master[2424]: warning: 
/usr/libexec/postfix/smtpd: bad command startup -- throttling


The interesting thing is IF I am taking off "-" (minus) from the 
socket name, everything works just perfect! So if I change config to:


service auth {
  unix_listener blabla {
    mode = 0600
    user = postfix
    group = postfix
  }
}

Mar 25 16:55:12 mail-server postfix/smtpd[2872]: connect from 
unknown[10.254.200.202]
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Loading 
modules from directory: /usr/lib64/d

Re: How to format auth-worker logs ?

2018-03-26 Thread chaouche yacine

Hello list,

Here's how auth-worker logs : 

Mar 26 10:56:38 auth-worker(1753): Info: 
sql(someu...@mydomain.tld,202.107.34.250): Password mismatch

I would like to add the service used, like this :

Mar 26 10:56:38 auth-worker(1753): Info: service=smtp 
sql(someu...@mydomain.tld,202.107.34.250): Password mismatch

Any hints on how to acheive this ? 

Yassine.




Quota set-up problems

2018-03-26 Thread Marcin Norek

Hi,

I've recently started using Dovecot as our main mail storage, and it's 
performing great. But I have a question/problems with quotas.


First of we are using:

dovecot --version
2.2.32 (dfbe293d4)

Dovecot is a part of a pre set environment (mailcow-dockerized)

Aside the inbox namespace we have set-up an additional archive ns 
(Archiwum) like this


namespace Archiwum {
    type = private
    separator = /
    prefix = Archiwum/
    location = maildir:/var/vmail/arch/%n:INDEXPVT=~/Maildir/Archiwum
    subscriptions = yes
    list = yes
    mailbox "Wyslane" {
  auto = subscribe
    }
}

It is on an separate disk array, and works well.

The problem is that this namespace and all its sub mailboxes should have 
different quota then the main storage


so the config is like this

  quota = dict:Userquota::proxy::sqlquota
  quota2 = maildir:ns=Archiwum
  quota_rule = Trash:storage=+100%
  quota2_rule = *:ignore

It works.. but not as intender. While mail located directly in the name 
space are ignored everything in sub mailbox of the Archiwum is still 
accounted to the main quota.


I've been fighting this for some time now and can not find the solution. 
So help would be appreciated.


Regards
Marcin


Re: BUG: Unknown command in userdb socket: CPID?2625

2018-03-26 Thread Reio Remma

To quote Night On Earth, huomenta Aki!

owner = postfix should be user = postfix

doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf 
line 4: Unknown setting: service { unix_listener { owner


Thanks and good luck!
Reio


On 26.03.18 11:55, Aki Tuomi wrote:

Ah i see.

try this:

dovecot.conf:

service auth {
   unix_listener /var/spool/postfix/private/auth {
 owner = postfix
 group = postfix
 mode = 0600
  }
}

postfix.conf:

smtpd_sasl_path = private/auth

Aki

On 26.03.2018 11:25, Vladimir Tiukhtin wrote:


Hello

Yes, please find my postfix config:

smtpd_sasl_type = dovecot
#smtpd_sasl_path = /var/run/dovecot/auth
smtpd_sasl_path = /var/run/dovecot/auth-userdb
smtpd_sasl_auth_enable = yes
smtpd_relay_restrictions = permit_mynetworks, 
permit_sasl_authenticated, reject_unauth_destination


As I mentioned if I remove minus from socket name everything works 
perfect. Thanks


Vladimir


On 26/03/18 08:37, Aki Tuomi wrote:


Did you tell postfix it's talking to dovecot?

Aki


On 25.03.2018 20:29, Vladimir Tiukhtin wrote:


Hi guys.

I am getting strange error:


BUG: Unknown command in userdb socket: CPID?2625


I am using service auth  to authenticate users on postfix.

*My OS*:

# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/";
BUG_REPORT_URL="https://bugs.centos.org/";

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="

*My dovecot:*

# dovecot --version
2.2.10

*My config*:

service auth {
  unix_listener auth-userdb {
mode = 0600
user = postfix
group = postfix
  }
}

*My Postfix:*

# rpm -qa | grep postf
postfix-2.10.1-6.el7.x86_64

*Log*:

Mar 25 16:52:33 mail-server postfix/smtpd[2625]: connect from 
unknown[10.254.200.202]
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Loading 
modules from directory: /usr/lib64/dovecot/auth
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Read auth 
token secret from /var/run/dovecot//auth-token-secret.dat
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: master in: 
CPID2625
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Error: BUG: 
Unknown command in userdb socket: CPID?2625
Mar 25 16:52:33 mail-server postfix/smtpd[2625]: fatal: no SASL 
authentication mechanisms
Mar 25 16:52:34 mail-server postfix/master[2424]: warning: process 
/usr/libexec/postfix/smtpd pid 2625 exit status 1
Mar 25 16:52:34 mail-server postfix/master[2424]: warning: 
/usr/libexec/postfix/smtpd: bad command startup -- throttling


The interesting thing is IF I am taking off "-" (minus) from the 
socket name, everything works just perfect! So if I change config to:


service auth {
  unix_listener blabla {
mode = 0600
user = postfix
group = postfix
  }
}

Mar 25 16:55:12 mail-server postfix/smtpd[2872]: connect from 
unknown[10.254.200.202]
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Loading 
modules from directory: /usr/lib64/dovecot/auth
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Read auth 
token secret from /var/run/dovecot//auth-token-secret.dat
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: auth client 
connected (pid=0)
Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug: client in: 
AUTH1PLAIN service=smtpnologin 
lip=192.168.101.24rip=10.254.200.202 secured
resp=
Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug: 
cache(ad...@asergis.com,10.254.200.202): miss
Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): 
Debug: Loading modules from directory: /usr/lib64/dovecot/auth
Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): 
Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): 
Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): 
Debug: sql(ad...@asergis.com,10.254.200.202): query: SELECT userid 
AS username, domain, password FROM users WHERE userid = 'admin' AND 
domain = 'asergis.com'
Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug: client 
passdb out: OK1 user=ad...@asergis.com
Mar 25 16:55:13 mail-server postfix/smtpd[2872]: 5C63030208: 
client=unknown[10.254.200.202], sasl_method=PLAIN, 
sasl_usern

Re: BUG: Unknown command in userdb socket: CPID?2625

2018-03-26 Thread Aki Tuomi
Ah i see.

try this:

dovecot.conf:

service auth {
   unix_listener /var/spool/postfix/private/auth {
 owner = postfix
 group = postfix
 mode = 0600
  }
}

postfix.conf:

smtpd_sasl_path = private/auth

Aki

On 26.03.2018 11:25, Vladimir Tiukhtin wrote:
>
> Hello
>
> Yes, please find my postfix config:
>
> smtpd_sasl_type = dovecot
> #smtpd_sasl_path = /var/run/dovecot/auth
> smtpd_sasl_path = /var/run/dovecot/auth-userdb
> smtpd_sasl_auth_enable = yes
> smtpd_relay_restrictions = permit_mynetworks,
> permit_sasl_authenticated, reject_unauth_destination
>
> As I mentioned if I remove minus from socket name everything works
> perfect. Thanks
>
> Vladimir
>
>
> On 26/03/18 08:37, Aki Tuomi wrote:
>>
>> Did you tell postfix it's talking to dovecot?
>>
>> Aki
>>
>>
>> On 25.03.2018 20:29, Vladimir Tiukhtin wrote:
>>>
>>> Hi guys.
>>>
>>> I am getting strange error:
>>>
>>>
>>> BUG: Unknown command in userdb socket: CPID?2625
>>>
>>>
>>> I am using service auth  to authenticate users on postfix.
>>>
>>> *My OS*:
>>>
>>> # cat /etc/os-release
>>> NAME="CentOS Linux"
>>> VERSION="7 (Core)"
>>> ID="centos"
>>> ID_LIKE="rhel fedora"
>>> VERSION_ID="7"
>>> PRETTY_NAME="CentOS Linux 7 (Core)"
>>> ANSI_COLOR="0;31"
>>> CPE_NAME="cpe:/o:centos:centos:7"
>>> HOME_URL="https://www.centos.org/";
>>> BUG_REPORT_URL="https://bugs.centos.org/";
>>>
>>> CENTOS_MANTISBT_PROJECT="CentOS-7"
>>> CENTOS_MANTISBT_PROJECT_VERSION="7"
>>> REDHAT_SUPPORT_PRODUCT="centos"
>>> REDHAT_SUPPORT_PRODUCT_VERSION="
>>>
>>> *My dovecot:*
>>>
>>> # dovecot --version
>>> 2.2.10
>>>
>>> *My config*:
>>>
>>> service auth {
>>>   unix_listener auth-userdb {
>>>     mode = 0600
>>>     user = postfix
>>>     group = postfix
>>>   }
>>> }
>>>
>>> *My Postfix:*
>>>
>>> # rpm -qa | grep postf
>>> postfix-2.10.1-6.el7.x86_64
>>>
>>> *Log*:
>>>
>>> Mar 25 16:52:33 mail-server postfix/smtpd[2625]: connect from
>>> unknown[10.254.200.202]
>>> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Loading
>>> modules from directory: /usr/lib64/dovecot/auth
>>> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module
>>> loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
>>> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module
>>> loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
>>> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Read auth
>>> token secret from /var/run/dovecot//auth-token-secret.dat
>>> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: master in:
>>> CPID    2625
>>> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Error: BUG: Unknown
>>> command in userdb socket: CPID?2625
>>> Mar 25 16:52:33 mail-server postfix/smtpd[2625]: fatal: no SASL
>>> authentication mechanisms
>>> Mar 25 16:52:34 mail-server postfix/master[2424]: warning: process
>>> /usr/libexec/postfix/smtpd pid 2625 exit status 1
>>> Mar 25 16:52:34 mail-server postfix/master[2424]: warning:
>>> /usr/libexec/postfix/smtpd: bad command startup -- throttling
>>>
>>> The interesting thing is IF I am taking off "-" (minus) from the
>>> socket name, everything works just perfect! So if I change config to:
>>>
>>> service auth {
>>>   unix_listener blabla {
>>>     mode = 0600
>>>     user = postfix
>>>     group = postfix
>>>   }
>>> }
>>>
>>> Mar 25 16:55:12 mail-server postfix/smtpd[2872]: connect from
>>> unknown[10.254.200.202]
>>> Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Loading
>>> modules from directory: /usr/lib64/dovecot/auth
>>> Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Module
>>> loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
>>> Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Module
>>> loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
>>> Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Read auth
>>> token secret from /var/run/dovecot//auth-token-secret.dat
>>> Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: auth client
>>> connected (pid=0)
>>> Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug: client in:
>>> AUTH    1    PLAIN    service=smtp    nologin   
>>> lip=192.168.101.24    rip=10.254.200.202    secured   
>>> resp=
>>> Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug:
>>> cache(ad...@asergis.com,10.254.200.202): miss
>>> Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug:
>>> Loading modules from directory: /usr/lib64/dovecot/auth
>>> Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug:
>>> Module loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
>>> Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug:
>>> Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
>>> Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug:
>>> sql(ad...@asergis.com,10.254.200.202): query: SELECT userid AS
>>> username, domain, password FROM users WHERE userid = 'admin' AND
>>> domain = 'asergis.com'
>>> Mar 25 16:55:13 mail-server dovecot[2786]: auth: D

Re: BUG: Unknown command in userdb socket: CPID?2625

2018-03-26 Thread Vladimir Tiukhtin

Hello

Yes, please find my postfix config:

smtpd_sasl_type = dovecot
#smtpd_sasl_path = /var/run/dovecot/auth
smtpd_sasl_path = /var/run/dovecot/auth-userdb
smtpd_sasl_auth_enable = yes
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, 
reject_unauth_destination


As I mentioned if I remove minus from socket name everything works 
perfect. Thanks


Vladimir


On 26/03/18 08:37, Aki Tuomi wrote:


Did you tell postfix it's talking to dovecot?

Aki


On 25.03.2018 20:29, Vladimir Tiukhtin wrote:


Hi guys.

I am getting strange error:


BUG: Unknown command in userdb socket: CPID?2625


I am using service auth  to authenticate users on postfix.

*My OS*:

# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/";
BUG_REPORT_URL="https://bugs.centos.org/";

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="

*My dovecot:*

# dovecot --version
2.2.10

*My config*:

service auth {
  unix_listener auth-userdb {
    mode = 0600
    user = postfix
    group = postfix
  }
}

*My Postfix:*

# rpm -qa | grep postf
postfix-2.10.1-6.el7.x86_64

*Log*:

Mar 25 16:52:33 mail-server postfix/smtpd[2625]: connect from 
unknown[10.254.200.202]
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Loading 
modules from directory: /usr/lib64/dovecot/auth
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Read auth 
token secret from /var/run/dovecot//auth-token-secret.dat
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: master in: 
CPID    2625
Mar 25 16:52:33 mail-server dovecot[2621]: auth: Error: BUG: Unknown 
command in userdb socket: CPID?2625
Mar 25 16:52:33 mail-server postfix/smtpd[2625]: fatal: no SASL 
authentication mechanisms
Mar 25 16:52:34 mail-server postfix/master[2424]: warning: process 
/usr/libexec/postfix/smtpd pid 2625 exit status 1
Mar 25 16:52:34 mail-server postfix/master[2424]: warning: 
/usr/libexec/postfix/smtpd: bad command startup -- throttling


The interesting thing is IF I am taking off "-" (minus) from the 
socket name, everything works just perfect! So if I change config to:


service auth {
  unix_listener blabla {
    mode = 0600
    user = postfix
    group = postfix
  }
}

Mar 25 16:55:12 mail-server postfix/smtpd[2872]: connect from 
unknown[10.254.200.202]
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Loading 
modules from directory: /usr/lib64/dovecot/auth
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Module 
loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Read auth 
token secret from /var/run/dovecot//auth-token-secret.dat
Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: auth client 
connected (pid=0)
Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug: client in: 
AUTH    1    PLAIN    service=smtp nologin    
lip=192.168.101.24 rip=10.254.200.202    secured    resp=
Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug: 
cache(ad...@asergis.com,10.254.200.202): miss
Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug: 
Loading modules from directory: /usr/lib64/dovecot/auth
Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug: 
Module loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug: 
Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug: 
sql(ad...@asergis.com,10.254.200.202): query: SELECT userid AS 
username, domain, password FROM users WHERE userid = 'admin' AND 
domain = 'asergis.com'
Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug: client passdb 
out: OK    1 user=ad...@asergis.com
Mar 25 16:55:13 mail-server postfix/smtpd[2872]: 5C63030208: 
client=unknown[10.254.200.202], sasl_method=PLAIN, 
sasl_username=ad...@asergis.com
Mar 25 16:55:13 mail-server postfix/cleanup[2881]: 5C63030208: 
message-id=
Mar 25 16:55:13 mail-server postfix/qmgr[2870]: 5C63030208: 
from=, size=622, nrcpt=1 (queue active)



P.s. I don't mind to use socket without minus on its name. But this 
looks really strange. Thanks. You are awesome



Vladimir







Re: destuser setting useless on LMTP proxy

2018-03-26 Thread Aki Tuomi


On 26.03.2018 10:42, Jan-Pieter Cornet wrote:
> I tried setting the "destuser" setting on the LMTP director as
> follows, to preserve the original envelope rcpt:
>
> protocol lmtp {
>   auth_socket_path = director-userdb
>   passdb {
>     driver = ...
>     override_fields = destuser=%{orig_user}
>   }
> }
>
> The passdb driver would return the appropriate "user" for each alias.
> Suppose, for example, user1 has emails us...@domain.tld, but also
> ali...@domain.tld.
>
> Now, it turns out that setting the destuser *changes* the backend. It
> seems that when the passdb returns "destuser", that username is
> completely ignored and the hashing of the destuser determines the
> backend chosen.
>
> This is incorrect, the backend should be chosen based on the returned
> "user", and the "destuser" should only be used for the remote login
> (or rcpt, in case of LMTP).
>
> I'm using version 2.2.35. The problem seems to be in lmtp/commands.c,
> in client_proxy_rcpt_parse_fields, line 281-285 says:
>     } else if (strcmp(key, "user") == 0 ||
>    strcmp(key, "destuser") == 0) {
>     /* changing the username */
>     *address = value;
>     } ...
>
> So it looks as if "user" and "destuser" are treated equally in the
> LMTP proxy.
>

Hi!

Thanks for reporting this, we'll take a look

Aki


destuser setting useless on LMTP proxy

2018-03-26 Thread Jan-Pieter Cornet

I tried setting the "destuser" setting on the LMTP director as follows, to 
preserve the original envelope rcpt:

protocol lmtp {
  auth_socket_path = director-userdb
  passdb {
driver = ...
override_fields = destuser=%{orig_user}
  }
}

The passdb driver would return the appropriate "user" for each alias. Suppose, 
for example, user1 has emails us...@domain.tld, but also ali...@domain.tld.

Now, it turns out that setting the destuser *changes* the backend. It seems that when the 
passdb returns "destuser", that username is completely ignored and the hashing 
of the destuser determines the backend chosen.

This is incorrect, the backend should be chosen based on the returned "user", and the 
"destuser" should only be used for the remote login (or rcpt, in case of LMTP).

I'm using version 2.2.35. The problem seems to be in lmtp/commands.c, in 
client_proxy_rcpt_parse_fields, line 281-285 says:
} else if (strcmp(key, "user") == 0 ||
   strcmp(key, "destuser") == 0) {
/* changing the username */
*address = value;
} ...

So it looks as if "user" and "destuser" are treated equally in the LMTP proxy.

--
Jan-Pieter Cornet 
Systeembeheer XS4ALL Internet bv
www.xs4all.nl



signature.asc
Description: OpenPGP digital signature


Re: BUG: Unknown command in userdb socket: CPID?2625

2018-03-26 Thread Aki Tuomi
Did you tell postfix it's talking to dovecot?

Aki


On 25.03.2018 20:29, Vladimir Tiukhtin wrote:
>
> Hi guys.
>
> I am getting strange error:
>
>
> BUG: Unknown command in userdb socket: CPID?2625
>
>
> I am using service auth  to authenticate users on postfix.
>
> *My OS*:
>
> # cat /etc/os-release
> NAME="CentOS Linux"
> VERSION="7 (Core)"
> ID="centos"
> ID_LIKE="rhel fedora"
> VERSION_ID="7"
> PRETTY_NAME="CentOS Linux 7 (Core)"
> ANSI_COLOR="0;31"
> CPE_NAME="cpe:/o:centos:centos:7"
> HOME_URL="https://www.centos.org/";
> BUG_REPORT_URL="https://bugs.centos.org/";
>
> CENTOS_MANTISBT_PROJECT="CentOS-7"
> CENTOS_MANTISBT_PROJECT_VERSION="7"
> REDHAT_SUPPORT_PRODUCT="centos"
> REDHAT_SUPPORT_PRODUCT_VERSION="
>
> *My dovecot:*
>
> # dovecot --version
> 2.2.10
>
> *My config*:
>
> service auth {
>   unix_listener auth-userdb {
>     mode = 0600
>     user = postfix
>     group = postfix
>   }
> }
>
> *My Postfix:*
>
> # rpm -qa | grep postf
> postfix-2.10.1-6.el7.x86_64
>
> *Log*:
>
> Mar 25 16:52:33 mail-server postfix/smtpd[2625]: connect from
> unknown[10.254.200.202]
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Loading
> modules from directory: /usr/lib64/dovecot/auth
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module loaded:
> /usr/lib64/dovecot/auth/libdriver_mysql.so
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Module loaded:
> /usr/lib64/dovecot/auth/libdriver_sqlite.so
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: Read auth
> token secret from /var/run/dovecot//auth-token-secret.dat
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Debug: master in:
> CPID    2625
> Mar 25 16:52:33 mail-server dovecot[2621]: auth: Error: BUG: Unknown
> command in userdb socket: CPID?2625
> Mar 25 16:52:33 mail-server postfix/smtpd[2625]: fatal: no SASL
> authentication mechanisms
> Mar 25 16:52:34 mail-server postfix/master[2424]: warning: process
> /usr/libexec/postfix/smtpd pid 2625 exit status 1
> Mar 25 16:52:34 mail-server postfix/master[2424]: warning:
> /usr/libexec/postfix/smtpd: bad command startup -- throttling
>
> The interesting thing is IF I am taking off "-" (minus) from the
> socket name, everything works just perfect! So if I change config to:
>
> service auth {
>   unix_listener blabla {
>     mode = 0600
>     user = postfix
>     group = postfix
>   }
> }
>
> Mar 25 16:55:12 mail-server postfix/smtpd[2872]: connect from
> unknown[10.254.200.202]
> Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Loading
> modules from directory: /usr/lib64/dovecot/auth
> Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Module loaded:
> /usr/lib64/dovecot/auth/libdriver_mysql.so
> Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Module loaded:
> /usr/lib64/dovecot/auth/libdriver_sqlite.so
> Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: Read auth
> token secret from /var/run/dovecot//auth-token-secret.dat
> Mar 25 16:55:12 mail-server dovecot[2786]: auth: Debug: auth client
> connected (pid=0)
> Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug: client in:
> AUTH    1    PLAIN    service=smtp    nologin   
> lip=192.168.101.24    rip=10.254.200.202    secured   
> resp=
> Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug:
> cache(ad...@asergis.com,10.254.200.202): miss
> Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug:
> Loading modules from directory: /usr/lib64/dovecot/auth
> Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug:
> Module loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
> Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug:
> Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
> Mar 25 16:55:13 mail-server dovecot[2786]: auth-worker(2878): Debug:
> sql(ad...@asergis.com,10.254.200.202): query: SELECT userid AS
> username, domain, password FROM users WHERE userid = 'admin' AND
> domain = 'asergis.com'
> Mar 25 16:55:13 mail-server dovecot[2786]: auth: Debug: client passdb
> out: OK    1    user=ad...@asergis.com
> Mar 25 16:55:13 mail-server postfix/smtpd[2872]: 5C63030208:
> client=unknown[10.254.200.202], sasl_method=PLAIN,
> sasl_username=ad...@asergis.com
> Mar 25 16:55:13 mail-server postfix/cleanup[2881]: 5C63030208:
> message-id=
> Mar 25 16:55:13 mail-server postfix/qmgr[2870]: 5C63030208:
> from=, size=622, nrcpt=1 (queue active)
>
>
> P.s. I don't mind to use socket without minus on its name. But this
> looks really strange. Thanks. You are awesome
>
>
> Vladimir
>