Re: Doveadm Backup issues

2020-06-05 Thread Francis Augusto Medeiros-Logeay


On 6 Jun 2020, at 01:10, Bernardo Reino  wrote:
> 
> On Fri, 5 Jun 2020, Francis Augusto Medeiros-Logeay wrote:
> 
>> Another related question: if backing up on another location on the same 
>> computer, using -A doesn't seem to recreate the structure of the original 
>> Maildir (for example, /var/mail/%d%n).
>> 
>> Is there a way to do that?
> 
> If I understand your question correctly (I may be missing context), you can 
> use dsync for that, e.g.:
> 
> DEST=mdbox:/path/to/$MAILBOX/mdbox
> dsync -u $MAILBOX backup $DEST
> 
> where DEST is in "mail location" format (could also be 
> "maildir:/path/to/Maildir")
> and $MAILBOX is a dovecot (virtual) user.
> 
> My backup script does this:
> 
> USERS=$(cat /etc/dovecot/virtual_passwd | cut -d: -f1)
> for MAILBOX in $USERS; do
>DEST=mdbox:/encrypted/snap_mail/$MAILBOX/mdbox
>dsync -v -u $MAILBOX backup $DEST
> done
> 
> This runs periodically and does the local "backup".
> Another server picks that up, also periodically, using rsync, which is the 
> real backup.
> 
> Cheers.

Thanks Bernardo. That’s what I want to do. But it’s just that it is confusing 
when there is a -A parameter that backups up all users, but apparently no way 
to specify individual paths on the destination. So I guess the -A option is 
only useful when backing up to a remote location that already has the same set 
of users. 

It would be nice to be able to soecify a format for the destination path 
without having use loops. But loop it is, then. :)

Best, 

Francis 

Re: Doveadm Backup issues

2020-06-05 Thread Bernardo Reino

On Fri, 5 Jun 2020, Francis Augusto Medeiros-Logeay wrote:

Another related question: if backing up on another location on the same 
computer, using -A doesn't seem to recreate the structure of the original 
Maildir (for example, /var/mail/%d%n).


Is there a way to do that?


If I understand your question correctly (I may be missing context), you 
can use dsync for that, e.g.:


DEST=mdbox:/path/to/$MAILBOX/mdbox
dsync -u $MAILBOX backup $DEST

where DEST is in "mail location" format (could also be 
"maildir:/path/to/Maildir")
and $MAILBOX is a dovecot (virtual) user.

My backup script does this:

USERS=$(cat /etc/dovecot/virtual_passwd | cut -d: -f1)
for MAILBOX in $USERS; do
DEST=mdbox:/encrypted/snap_mail/$MAILBOX/mdbox
dsync -v -u $MAILBOX backup $DEST
done

This runs periodically and does the local "backup".
Another server picks that up, also periodically, using rsync, which is the 
real backup.


Cheers.


Re: Cannot log in to IMAP server and logs are unclear as to why

2020-06-05 Thread Scott A. Wozny
Hi Aki,


Again, thanks very much for your response. Your solution of adding the colons 
worked. Actually, I futzed with it a little bit and it works with as few as 2 
added colons.


This is interesting since in the examples section of 
https://doc.dovecot.org/configuration_manual/authentication/passwd_file/ it 
explicitly states:


---


This file can be used as a passdb:


user:{plain}password

user2:{plain}password2


---


So I took that to mean it could also be used as a userdb (since I couldn’t find 
anything explicitly defining the minimum allowed userdb) as long as the needed 
values of UID, GID and HOME were somehow provided (in my case, these were set 
in global configuration). The examples had default_fields values provided for 
UID, GID and HOME, so I moved the setting of those fields there and tried again 
in case that was what was messing things up.


Here is the revised doveconf -n:


# 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf

# OS: Linux 3.10.0-1062.12.1.el7.x86_64 x86_64 CentOS Linux release 7.7.1908 
(Core)

# Hostname: imap

first_valid_uid = 1000

listen = 192.168.1.207

mail_location = sdbox:~/mail

mbox_write_locks = fcntl

namespace inbox {

inbox = yes

location =

mailbox Drafts {

special_use = \Drafts

}

mailbox Junk {

special_use = \Junk

}

mailbox Sent {

special_use = \Sent

}

mailbox "Sent Messages" {

special_use = \Sent

}

mailbox Trash {

special_use = \Trash

}

prefix =

separator = /

}

passdb {

args = scheme=PLAIN username_format=%u /etc/dovecot/users

driver = passwd-file

}

protocols = imap lmtp

service lmtp {

group = vmail

unix_listener /var/spool/postfix/private/dovecot-lmtp {

group = postfix

mode = 0600

user = postfix

}

user = vmail

}

ssl = no

ssl_cert = 
Sent: June 5, 2020 1:44 AM
To: Scott A. Wozny ; dovecot@dovecot.org 

Subject: Re: Cannot log in to IMAP server and logs are unclear as to why

Hi!

I tried with your config and I got:

Jun 05 08:43:30 auth-worker(11465): Error: passwd-file /etc/dovecot/users: User 
t...@test.com is missing userdb info

This is because your line is missing sufficient amount of colons, try changing

t...@test.com:{plain}test

into

t...@test.com:{plain}test:::

Aki

> On 05/06/2020 02:31 Scott A. Wozny  wrote:
>
>
> Hi Aki,
>
>
> Thanks for the response. I'm, unfortunately, a little confused. This is the 
> only line in /etc/dovecot/users:
>
>
> t...@test.com:{plain}test
>
>
> Which matches your suggestion to use the full smtp address as the username 
> and log in with it, which I did for my test. Can you specify what it was you 
> thought I should try differently?
>
>
> Regardless, I see your point about trying a less complex username. In the 
> end, I want to host 3 small domains on one server which looks well within 
> Dovecot's capability, but I'll try taking the use of the domain name out of 
> the equation for now to try and narrow down / correct the errors.
>
>
> Thanks,
>
>
> Scott
>
>
>
> --
> From: Aki Tuomi 
>  Sent: June 4, 2020 3:14 AM
>  To: Scott A. Wozny ; dovecot@dovecot.org 
> 
>  Subject: Re: Cannot log in to IMAP server and logs are unclear as to why
>
>  > On 04/06/2020 02:51 Scott A. Wozny  wrote:
>  >
>  >
>  > I’m trying a super basic config based upon 
> https://wiki.dovecot.org/HowTo/PostfixDovecotLMTP but before I work on 
> shipping mail through Postfix to DoveCot, I wanted to make sure IMAP is 
> working first, but I can’t even get a basic login to so I thought I’d see if 
> the gurus on the list might be able to point out I’m doing wrong. The 
> documentation is pretty good, but there were some gaps I had to guess at and 
> I’m presuming that’s where I went wrong. I’ve turned SELinux to permissive 
> mode, for now.
>  >
>  >
>  > Here’s the doveconf -n:
>  >
>  >
>  > # 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf
>
>  
>
>  auth_username_format = %Ln
>
>  should fix your problem.
>
>  alternatively you need to change /etc/dovecot/users to have
>
>  t...@test.com:
>
>  instead of
>
>  test:
>
>  and log in always with full username.
>
>  Aki
>


Re: Doveadm Backup issues

2020-06-05 Thread Francis Augusto Medeiros-Logeay

Hi,

As said below, I am trying to use doveadm backup. I made some progress, 
but I think I misunderstand some of the basic principles behind the 
command.


My main issue is: when using the -A flag, is there a way to create the 
backup user on the remote server if it doesn't exist there?


Another related question: if backing up on another location on the same 
computer, using -A doesn't seem to recreate the structure of the 
original Maildir (for example, /var/mail/%d%n).


Is there a way to do that?

Best,

Francis

On 02.06.2020 14:31, Francis Augusto Medeiros-Logeay wrote:

Hi,

I'm trying to use doveadm backup but I'm having a few issues.

When trying locally:

`doveadm backup -D -A maildir:/usr/local/backup`

It results that no mailbox is separated by user - all seems to sync on
the same folder, messing up with the folder structure of the original
maildir.

When trying remotely:

`doveadm backup -D -A -N ssh -i mykey r...@myremotebackup.com:/backup
doveadmin dsync-server -A`

I get this error line for each user:

dsync-local(theu...@thedomain.com)<5DNrEXdG1l5tAgAAqsACHw>: Error:
read(remote) failed: EOF (version not received)
doveadm(theu...@thedomain.com): Fatal: execvp(ssh) failed: No such
file or directory

I'd be very thankful if someone could help me with this.

Best,

Francis


Re:

2020-06-05 Thread John Stoffel
> "Stephen" == Stephen Blackwell  writes:

Stephen> I want to disable the time penalty for dovecot imap
Stephen> authentication. When receiving a valid user-password combo
Stephen> the server responds in .04 seconds. When I send in an invalid
Stephen> comination it will either respond in 1.544 or 2.044 seconds
Stephen> += .002

Stephen> I am using dovecot to test a program that sends a login
Stephen> request to a server and processes the response. I want to be
Stephen> able to send a series of valid and invalid login attempts.

Stephen> The issue is that with the 2 seconds delay for a bad login
Stephen> attempt, the tests are too slow to run in production

Why are you running tests on production?  Hmm?

Stephen> I can see that the delay is defined in auth-penalty.h Is
Stephen> there a way, in the config file, to set
Stephen> AUTH_PENALTY_INIT_SECS = 0, or any other way to remove the
Stephen> time delay for an invalid login.

Take a look at this page:

https://wiki.dovecot.org/Authentication/Penalty

but maybe you can put your test IP into the list of trusted networks?

John


Re: Only show mails within 30 days or 60 days?

2020-06-05 Thread Ralph Seichter
* h...@cndns.com:

> For example, in the mail client tool, the user clicks the inbox button
> and only sees the mail within 30 days.

You pretty much answered your own question there. The mail user agent
(MUA, what you called "mail client tool") is the one responsible for
showing only a subset of available messages.

-Ralph


[no subject]

2020-06-05 Thread Stephen Blackwell
I want to disable the time penalty for dovecot imap authentication. When
receiving a valid user-password combo the server responds in .04 seconds.
When I send in an invalid comination it will either respond in 1.544 or
2.044 seconds += .002

I am using dovecot to test a program that sends a login request to a server
and processes the response. I want to be able to send a series of valid and
invalid login attempts.

The issue is that with the 2 seconds delay for a bad login attempt, the
tests are too slow to run in production

I can see that the delay is defined in auth-penalty.h Is there a way, in
the config file, to set AUTH_PENALTY_INIT_SECS = 0, or any other way to
remove the time delay for an invalid login.

I am running dovecot version 2.2.33.2
I am running without root permissions
I do not want to make changes outside of the dovecot config file, password
file, or run folder.

-- 
Stephen


manual mdbox lock

2020-06-05 Thread rudolf
Good Morning,

 

i have a question about the mdbox dotlock technique.

 

We create a new backup strategy for our mailservers because we want to
switch the mailformat from mbox to mdbox.

 

Our recent backup plan works mainly with rsync and the inbuild tar function.
We want to hande the backups with mdbox similar.

 

Is there a way, how i can write-lock a mail user via the doveadm command or
with dotlock files? I have searched the doveadm-sync code but i cant make
out the point where the command lock the mailbox for write access.

 

We work with Ubuntu 18, dovecot 2.33.2

 

 

Mit freundlichen Grüßen

Yours sincerely

 


  


Pascal Rudolf | Geschäftsführer


PADARU-IT | Bielebohstraße 10 | 02736  Beiersdorf
@: rud...@padaru.de | www:   padaru.de
mobil: +49 (0) 17 772 595 32

 

 



Re: Only show mails within 30 days or 60 days?

2020-06-05 Thread Aki Tuomi


> On 05/06/2020 10:27 Benny Pedersen  wrote:
> 
>  
> On 2020-06-05 06:16, h...@cndns.com wrote:
> > How to display emails within 30 days or 60 days in inbox, sent box,
> > etc. For example, in the mail client tool, the user clicks the inbox
> > button and only sees the mail within 30 days. The virtual mailbox
> > plugin will only generate a new mailbox.
> 
> roundcube archive by month
> 
> IMHO its not a dovecot option
> 
> Thunderbird and roundcube can share same archive format

Dovecot has sieve refilter as well, so you could use that to do archivals.

But I suspect in this case, the correct solution is indeed in MUA. There is no 
option (except virtual folders) to limit mails to 30 days.

Aki


Re: Only show mails within 30 days or 60 days?

2020-06-05 Thread Benny Pedersen

On 2020-06-05 06:16, h...@cndns.com wrote:

How to display emails within 30 days or 60 days in inbox, sent box,
etc. For example, in the mail client tool, the user clicks the inbox
button and only sees the mail within 30 days. The virtual mailbox
plugin will only generate a new mailbox.


roundcube archive by month

IMHO its not a dovecot option

Thunderbird and roundcube can share same archive format