Re: doveadm backup + ISO 8859-1 mailbox name

2019-04-04 Thread Michael Goth via dovecot




On 4/3/19 2:23 PM, Sami Ketola via dovecot wrote:




On 3 Apr 2019, at 13.40, Michael Goth via dovecot  wrote:

Hi!

I'm trying to migrate a mailbox from an old IMAP server (not Dovecot) to a new 
Dovecot server with 'doveadm backup'. The command fails because of an 
unexpected character in a mailbox name:


doveadm -o imapc_user=a...@example.org \
-o imapc_password=XXX \
-o imapc_host=old-mailserver.webflow.de \
-o imapc_port=993 \
-o imapc_ssl=imaps \
-o imapc_ssl_verify=no \
-o imapc_features=rfc822.size,fetch-headers \
-o ssl_client_ca_dir=/etc/ssl \
backup -R -f -x ~* -u migration...@example.org imapc:

dsync(migration...@example.org): Info: imapc(old-mailserver.webflow.de:993): 
Connected to 1.1.1.1:993 (local 2.2.2.2:46154)
dsync(migration...@example.org): Error: Failed to access mailbox Entw?rfe: 
mailbox does not exist


The problem is with "Entw?rfe" here. It's actually Entw<0xfc>rfe, which translates to 
"Entwürfe" in ISO-8859-1.

Why can't doveadm find that mailbox? Is the old mailserver misbehaving (I hope 
not because I have no idea how to change that...), or does this happen on the 
new server? Can I tell doveadm something that makes this work?



Can you log on the remote imap server with telnet or nc and ask for: A LIST "" 
"*"

I think your legacy server does not encode the folder names correctly.


That too includes the  byte in its output. But I've found that only 
a couple of mailboxes are affected, so i just renamed the folders.


Thanks for your help!

Michael


doveadm backup + ISO 8859-1 mailbox name

2019-04-03 Thread Michael Goth via dovecot

Hi!

I'm trying to migrate a mailbox from an old IMAP server (not Dovecot) to 
a new Dovecot server with 'doveadm backup'. The command fails because of 
an unexpected character in a mailbox name:



doveadm -o imapc_user=a...@example.org \
-o imapc_password=XXX \
-o imapc_host=old-mailserver.webflow.de \
-o imapc_port=993 \
-o imapc_ssl=imaps \
-o imapc_ssl_verify=no \
-o imapc_features=rfc822.size,fetch-headers \
-o ssl_client_ca_dir=/etc/ssl \
backup -R -f -x ~* -u migration...@example.org imapc:

dsync(migration...@example.org): Info: 
imapc(old-mailserver.webflow.de:993): Connected to 1.1.1.1:993 (local 
2.2.2.2:46154)
dsync(migration...@example.org): Error: Failed to access mailbox 
Entw?rfe: mailbox does not exist



The problem is with "Entw?rfe" here. It's actually Entw<0xfc>rfe, which 
translates to "Entwürfe" in ISO-8859-1.


Why can't doveadm find that mailbox? Is the old mailserver misbehaving 
(I hope not because I have no idea how to change that...), or does this 
happen on the new server? Can I tell doveadm something that makes this work?



Thank you

Michael



--
Michael Goth

.webflow GmbH

Geschäftsführer: Andreas Schrei
Wasserburger Straße 4
D - 83352 Altenmarkt a. d. Alz

Amtsgericht Traunstein HRB 18537

E-Mail:   m...@webflow.de
Tel:  +49 (0) 8621 - 99989 - 26
Fax:  +49 (0) 8621 - 99989 - 28
Web:  www.webflow.de


Re: [ext] Dovecot Wiki: Please disable edit on double click

2019-03-20 Thread Michael Goth via dovecot




On 3/20/19 12:02 PM, Aki Tuomi via dovecot wrote:


On 20.3.2019 12.59, Ralf Hildebrandt via dovecot wrote:

* Michael Goth via dovecot :


could you maybe disable the 'edit on doubleclick' feature on
wiki2.dovecot.org?

Everytime I try to select a word by double clicking on it, I end up in
editing mode. It's just a minor thing, but maybe I'm not the only one who's
annoyed by this ;)

Amen to that. I never bothered to ask, but it annoys the shit out of me!



It should be disabled now, unless you log into the wiki. Then you need
to disable it from preferences.


Works great, thanks!



Dovecot Wiki: Please disable edit on double click

2019-03-20 Thread Michael Goth via dovecot

Hi Aki,

could you maybe disable the 'edit on doubleclick' feature on 
wiki2.dovecot.org?


Everytime I try to select a word by double clicking on it, I end up in 
editing mode. It's just a minor thing, but maybe I'm not the only one 
who's annoyed by this ;)


Thanks!

Michael


Sieve fileinto copies messages instead of moving them

2019-03-06 Thread Michael Goth via dovecot

Hi,

we're running Doveocot 2.3.4.1 with Pigeonhole, from repo.webflow.org.

As far as I understand the RFC for 'fileinto', the following Sieve 
script should move a message either into the folder "SPAM" or "MaybeSPAM":



require ["fileinto"];
# rule:[SPAM]
if header :contains "subject" "SPAMSPAM"
{
fileinto "SPAM";
}
# rule:[SPAMSPAM]
if header :contains "subject" "SPAM"
{
fileinto "MaybeSPAM";
}


But when I receive a message with subject "SPAMSPAM", the message turns 
up in "SPAM" and "MaybeSPAM". Is this expected behaviour?



Thanks!

  Michael



--
Michael Goth

.webflow GmbH

Geschäftsführer: Andreas Schrei
Wasserburger Straße 4
D - 83352 Altenmarkt a. d. Alz

Amtsgericht Traunstein HRB 18537

E-Mail:   m...@webflow.de
Tel:  +49 (0) 8621 - 99989 - 26
Fax:  +49 (0) 8621 - 99989 - 28
Web:  www.webflow.de


Re: doveadm proxy list repeats header line

2018-12-12 Thread Michael Goth



On 12/12/2018 10:19 AM, Aki Tuomi wrote:

Looks like a bug, which version is this?


It's Dovecot 2.3.3

Regards,
  Michael


doveadm proxy list repeats header line

2018-12-12 Thread Michael Goth

Hi all,

just a minor thing: Why does `doveadm proxy list` repeat the header line 
after each entry? Too me, that just makes the output harder to read.


So instead of this:

root@mail1 ~ # doveadm proxy list
usernameproto   src ipdest ip port
i...@domain1.de imap80.152.196.98 222.133.127.53  993
usernameservice src-ipdest-ip dest-port
i...@domain1.de imap80.152.196.98 222.133.127.53  993
usernameservice src-ipdest-ip dest-port
i...@domain1.de imap80.152.196.98 222.133.127.53  993
usernameservice src-ipdest-ip dest-port
t...@domain1.de   imap83.149.131.71 222.133.127.53  993
usernameservice src-ipdest-ip dest-port
t...@domain1.de   imap83.149.131.71 222.133.127.53  993


I'd prefer this:

root@mail1 ~ # doveadm proxy list
usernameproto   src ipdest ip port
i...@domain1.de imap80.152.196.98 222.133.127.53  993
i...@domain1.de imap80.152.196.98 222.133.127.53  993
i...@domain1.de imap80.152.196.98 222.133.127.53  993
t...@domain1.de   imap83.149.131.71 222.133.127.53  993
t...@domain1.de   imap83.149.131.71 222.133.127.53  993


The repeated header lines also happen with other formatters.


Regards,
  Michael


Proxy + 2x static passdb not working as expected

2018-11-13 Thread Michael Goth

Hi all,

I'm trying to setup a Dovecot proxy that authenticates the user against 
two backend servers. If login server1 fails, server2 should be tried.


The problem: Only the first server seems to be tried, even if the login 
fails.


Config snippet:

  protocol imap {
passdb {
  driver = static
  args = proxy=y nopassword=y host=oldserver1.example.com port=993 
ssl=y

}

passdb {
  driver = static
  args = proxy=y nopassword=y host=oldserver2.example.com port=993 
ssl=y

}
  }

With this config, only accounts on oldserver1.example.com can login. If 
I reverse the two passdb entries, only accounts on 
oldserver2.example.com can login.


I've done the same with SQL passdb first + static passdb second. That 
worked as expected. Not sure what I'm doing wrong here.


Attached is the output of doveconf -n


Thanks

  Michael

Mit freundlichen Grüßen
--
Michael Goth

.webflow GmbH

Geschäftsführer: Andreas Schrei
Wasserburger Straße 4
D - 83352 Altenmarkt a. d. Alz

Amtsgericht Traunstein HRB 18537

E-Mail:   m...@webflow.de
Tel:  +49 (0) 8621 - 99989 - 26
Fax:  +49 (0) 8621 - 99989 - 28
Web:  www.webflow.de
# 2.3.3 (dcead646b): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.3 (f018bbab)
# OS: Linux 4.15.0-36-generic x86_64 Ubuntu 18.04.1 LTS
# Hostname: proxy.example.com
auth_mechanisms = plain login
auth_verbose = yes
disable_plaintext_auth = no
listen = *
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date index ihave duplicate 
mime foreverypart extracttext
passdb {
  args = /dev/null
  driver = passwd-file
}
protocols = imap pop3 submission sieve
ssl_ca = 

Re: Dovecot submission announces CHUNKING but backend Postfix does not support it

2018-09-28 Thread Michael Goth

On 09/20/2018 10:24 PM, Stephan Bosch wrote:



Op 20/09/2018 om 13:39 schreef Michael Goth:

On 09/20/2018 12:56 PM, Robert Schetterer wrote:

Am 20.09.2018 um 11:04 schrieb Michael Goth:

Hello,

I'm setting up Dovecot 2.3.2.1 as a submission proxy to a Postfix 
backend server. Dovecot announces CHUNKING, but the Postfix backend 
does not support (or announce) it.


HELO from Postfix:

   220 backend.mydomain.com ESMTP Postfix (Ubuntu)
   ehlo test
   250-backend.mydomain.com
   250-PIPELINING
   250-SIZE 104857600
   250-VRFY
   250-ETRN
   250-STARTTLS
   250-ENHANCEDSTATUSCODES
   250-8BITMIME
   250 DSN


HELO from Dovecot proxy:

   220 proxy.mydomain.com Dovecot ready.
   ehlo test
   250-proxy.mydomain.com
   250-8BITMIME
   250-AUTH PLAIN LOGIN
   250-BURL imap
   250-CHUNKING
   250-ENHANCEDSTATUSCODES
   250-SIZE
   250-STARTTLS
   250 PIPELINING


When a client sends BDAT, Postfix closes the connection. Here's a 
log snippet from Postfix:


   < MAIL FROM:
   > 250 2.1.0 Ok
   < RCPT TO:
   > 250 2.1.5 Ok
   < BDAT 114098 LAST
   > 502 5.5.2 Error: command not recognized
   < Content-Type: multipart/alternative; 
boundary=Apple-Mail-55D35F74-2EB7-4B3B-A607-E421DD71C07A

   > 221 2.7.0 Error: I can break rules, too. Goodbye.


Apple Mail seems to ignore the fact that Postfix does not understand 
BDAT and Postfix does not like that :-)



 From a quick glance at the code it seems CHUNKING is always added 
to the capabilities and that's not configurable. Is this a bug or am 
I doing something wrong?



Thanks,

  Michael


that "may" version depend

http://www.postfix.org/features.html
...
Postfix 3.4 SMTP server support for RFC 3030 CHUNKING (without 
BINARYMIME).

...



As far as I understand, Dovecot always adds certain capabilities. This 
is the responsible code (I think):


https://github.com/dovecot/core/blob/c8d03c3cab68328947a5afb47f48aef5b5a1e4ab/src/submission/submission-client.c#L95 



Dovecot adds the capability to the server side (facing the client), but 
not on the proxy client side (facing Postfix). If Postfix doesn't 
support CHUNKING, Dovecot will translate between BDAT from client and 
DATA towards Postfix. That's the way it is supposed to work anyway. I 
cannot reproduce your problem here with a quick test.


Can you enable mail_debug=yes (e.g. for that particular user) and show 
me the debug log of the proxy activity?


The output from `dovecot -n` would also be helpful.

Regards,

Stephan.



I think I found the problem:

I am not using the submission_* config directives to configure the relay 
SMTP server.
Instead, I'm using Dovecot's proxy feature for selecting a backend 
server based on the user's authentication. The submission_* directives 
are all unset.


When using the submission_* directives, Dovecot translates from BDAT to 
DATA. With my configuration, it seems to just relay all the commands to 
the backend server.


Now that I think about it, I'm not sure what dovecot can do in this 
case. It doesn't really know the supported capabilities until the user 
authenticates themself.



Regards,
  Michael


Re: Dovecot submission announces CHUNKING but backend Postfix does not support it

2018-09-21 Thread Michael Goth

On 09/20/2018 10:24 PM, Stephan Bosch wrote:

Op 20/09/2018 om 13:39 schreef Michael Goth:

On 09/20/2018 12:56 PM, Robert Schetterer wrote:

Am 20.09.2018 um 11:04 schrieb Michael Goth:

Hello,

I'm setting up Dovecot 2.3.2.1 as a submission proxy to a Postfix 
backend server. Dovecot announces CHUNKING, but the Postfix backend 
does not support (or announce) it.


HELO from Postfix:

   220 backend.mydomain.com ESMTP Postfix (Ubuntu)
   ehlo test
   250-backend.mydomain.com
   250-PIPELINING
   250-SIZE 104857600
   250-VRFY
   250-ETRN
   250-STARTTLS
   250-ENHANCEDSTATUSCODES
   250-8BITMIME
   250 DSN


HELO from Dovecot proxy:

   220 proxy.mydomain.com Dovecot ready.
   ehlo test
   250-proxy.mydomain.com
   250-8BITMIME
   250-AUTH PLAIN LOGIN
   250-BURL imap
   250-CHUNKING
   250-ENHANCEDSTATUSCODES
   250-SIZE
   250-STARTTLS
   250 PIPELINING


When a client sends BDAT, Postfix closes the connection. Here's a 
log snippet from Postfix:


   < MAIL FROM:
   > 250 2.1.0 Ok
   < RCPT TO:
   > 250 2.1.5 Ok
   < BDAT 114098 LAST
   > 502 5.5.2 Error: command not recognized
   < Content-Type: multipart/alternative; 
boundary=Apple-Mail-55D35F74-2EB7-4B3B-A607-E421DD71C07A

   > 221 2.7.0 Error: I can break rules, too. Goodbye.


Apple Mail seems to ignore the fact that Postfix does not understand 
BDAT and Postfix does not like that :-)



 From a quick glance at the code it seems CHUNKING is always added 
to the capabilities and that's not configurable. Is this a bug or am 
I doing something wrong?



Thanks,

  Michael


that "may" version depend

http://www.postfix.org/features.html
...
Postfix 3.4 SMTP server support for RFC 3030 CHUNKING (without 
BINARYMIME).

...



As far as I understand, Dovecot always adds certain capabilities. This 
is the responsible code (I think):


https://github.com/dovecot/core/blob/c8d03c3cab68328947a5afb47f48aef5b5a1e4ab/src/submission/submission-client.c#L95 



Dovecot adds the capability to the server side (facing the client), but 
not on the proxy client side (facing Postfix). If Postfix doesn't 
support CHUNKING, Dovecot will translate between BDAT from client and 
DATA towards Postfix. That's the way it is supposed to work anyway. I 
cannot reproduce your problem here with a quick test.


I just did a test with telnet and got the same results as before:

mg@mymachine:~$ telnet proxy.mydomain.com 25
Trying 195.201.36.46...
Connected to proxy.mydomain.com.
Escape character is '^]'.
220 proxy.mydomain.com Dovecot ready.
EHLO test
250-mail2.mydomain.com
250-8BITMIME
250-AUTH PLAIN LOGIN
250-BURL imap
250-CHUNKING
250-ENHANCEDSTATUSCODES
250-SIZE
250-STARTTLS
250 PIPELINING
AUTH PLAIN AHRlc3RAbXlkb21haW4uY29tAHBhc3N3b3Jk
235 2.7.0 Authentication successful
MAIL FROM:
250 2.1.0 Ok
RCPT TO:
250 2.1.5 Ok
BDAT 114098 LAST
502 5.5.2 Error: command not recognized
Content-Type: multipart/alternative; 
boundary=Apple-Mail-55D35F74-2EB7-4B3B-A607-E421DD71C07A

221 2.7.0 Error: I can break rules, too. Goodbye.
Connection closed by foreign host.


Can you enable mail_debug=yes (e.g. for that particular user) and show 
me the debug log of the proxy activity?


I did enable mail_debug=yes and restarted Dovecot, but I don't see any 
debug messages in /var/log/mail.log ?


'doveadm log find' tells me debug logging goes to /var/log/mail.log


The output from `dovecot -n` would also be helpful.


Please see the attached dovecot.conf, I'm running 2.3.2.1 installed from 
repo.dovecot.org



Regards,
  Michael

# 2.3.2.1 (0719df592): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.2 (5d6d7c92)
# OS: Linux 4.15.0-33-generic x86_64 Ubuntu 18.04.1 LTS
# Hostname: proxy.mydomain.com
auth_mechanisms = plain login
auth_verbose = yes
disable_plaintext_auth = no
listen = *
mail_debug = yes
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date index ihave duplicate 
mime foreverypart extracttext
passdb {
  args = /dev/null
  driver = passwd-file
}
protocols = imap pop3 submission sieve
service imap-login {
  inet_listener imap_10143 {
address = *
port = 10143
ssl = yes
  }
}
service pop3-login {
  inet_listener imap_10110 {
address = *
port = 10110
ssl = yes
  }
}
service submission-login {
  inet_listener smtp {
address = *
port = 25
  }
  inet_listener smtp_10025 {
address = *
port = 10025
ssl = yes
  }
  inet_listener smtps {
address = *
port = 465
ssl = yes
  }
  inet_listener submission {
address = *
port = 587
  }
}
ssl_ca = 

Re: Dovecot submission announces CHUNKING but backend Postfix does not support it

2018-09-20 Thread Michael Goth

On 09/20/2018 12:56 PM, Robert Schetterer wrote:

Am 20.09.2018 um 11:04 schrieb Michael Goth:

Hello,

I'm setting up Dovecot 2.3.2.1 as a submission proxy to a Postfix 
backend server. Dovecot announces CHUNKING, but the Postfix backend 
does not support (or announce) it.


HELO from Postfix:

   220 backend.mydomain.com ESMTP Postfix (Ubuntu)
   ehlo test
   250-backend.mydomain.com
   250-PIPELINING
   250-SIZE 104857600
   250-VRFY
   250-ETRN
   250-STARTTLS
   250-ENHANCEDSTATUSCODES
   250-8BITMIME
   250 DSN


HELO from Dovecot proxy:

   220 proxy.mydomain.com Dovecot ready.
   ehlo test
   250-proxy.mydomain.com
   250-8BITMIME
   250-AUTH PLAIN LOGIN
   250-BURL imap
   250-CHUNKING
   250-ENHANCEDSTATUSCODES
   250-SIZE
   250-STARTTLS
   250 PIPELINING


When a client sends BDAT, Postfix closes the connection. Here's a log 
snippet from Postfix:


   < MAIL FROM:
   > 250 2.1.0 Ok
   < RCPT TO:
   > 250 2.1.5 Ok
   < BDAT 114098 LAST
   > 502 5.5.2 Error: command not recognized
   < Content-Type: multipart/alternative; 
boundary=Apple-Mail-55D35F74-2EB7-4B3B-A607-E421DD71C07A

   > 221 2.7.0 Error: I can break rules, too. Goodbye.


Apple Mail seems to ignore the fact that Postfix does not understand 
BDAT and Postfix does not like that :-)



 From a quick glance at the code it seems CHUNKING is always added to 
the capabilities and that's not configurable. Is this a bug or am I 
doing something wrong?



Thanks,

  Michael


that "may" version depend

http://www.postfix.org/features.html
...
Postfix 3.4 SMTP server support for RFC 3030 CHUNKING (without 
BINARYMIME).

...



As far as I understand, Dovecot always adds certain capabilities. This 
is the responsible code (I think):


https://github.com/dovecot/core/blob/c8d03c3cab68328947a5afb47f48aef5b5a1e4ab/src/submission/submission-client.c#L95


Dovecot submission announces CHUNKING but backend Postfix does not support it

2018-09-20 Thread Michael Goth

Hello,

I'm setting up Dovecot 2.3.2.1 as a submission proxy to a Postfix 
backend server. Dovecot announces CHUNKING, but the Postfix backend does 
not support (or announce) it.


HELO from Postfix:

  220 backend.mydomain.com ESMTP Postfix (Ubuntu)
  ehlo test
  250-backend.mydomain.com
  250-PIPELINING
  250-SIZE 104857600
  250-VRFY
  250-ETRN
  250-STARTTLS
  250-ENHANCEDSTATUSCODES
  250-8BITMIME
  250 DSN


HELO from Dovecot proxy:

  220 proxy.mydomain.com Dovecot ready.
  ehlo test
  250-proxy.mydomain.com
  250-8BITMIME
  250-AUTH PLAIN LOGIN
  250-BURL imap
  250-CHUNKING
  250-ENHANCEDSTATUSCODES
  250-SIZE
  250-STARTTLS
  250 PIPELINING


When a client sends BDAT, Postfix closes the connection. Here's a log 
snippet from Postfix:


  < MAIL FROM:
  > 250 2.1.0 Ok
  < RCPT TO:
  > 250 2.1.5 Ok
  < BDAT 114098 LAST
  > 502 5.5.2 Error: command not recognized
  < Content-Type: multipart/alternative; 
boundary=Apple-Mail-55D35F74-2EB7-4B3B-A607-E421DD71C07A

  > 221 2.7.0 Error: I can break rules, too. Goodbye.


Apple Mail seems to ignore the fact that Postfix does not understand 
BDAT and Postfix does not like that :-)



From a quick glance at the code it seems CHUNKING is always added to 
the capabilities and that's not configurable. Is this a bug or am I 
doing something wrong?



Thanks,

 Michael