Re: sieve vacation to an alias group

2019-03-10 Thread Yassine Chaouche via dovecot

On 3/9/19 12:41 PM, Monis Monther via dovecot wrote:


Hi,

We have an alias group named x...@example.com , 
this alias group has 3 actual users a...@example.com 
, b...@example.com  and 
c...@example.com 


We set vacation rule on the generic sieve rule, the problem is that 3 
responses are sent to the original sender. (obviously because the rule 
is being executed with each user in the alias group)


Is it possible to set auto response only once, we tried the ( :days 1) 
option but still all 3 respond back.


How can such a setup be achieved. (Single auto response to an alias group)

CentOS 7.5
dovecot-pigeonhole-2.3.4.1-1.x86_64
dovecot-2.3.4.1-1.x86_64
postfix 2.10-1


--
Best Regards
Monis


Hello Monis,

As a workaround, you can turn x...@example.com into an actual mailbox and 
give a...@example.com, b...@example.com and c...@example.com read-only shared 
folder access.


Yassine.



Re: sieve vacation to an alias group

2019-03-10 Thread Yassine Chaouche via dovecot


On 3/10/19 9:07 AM, Yassine Chaouche via dovecot wrote:


On 3/9/19 12:41 PM, Monis Monther via dovecot wrote:


Hi,

We have an alias group named x...@example.com 
, this alias group has 3 actual users 
a...@example.com , b...@example.com 
 and c...@example.com 


We set vacation rule on the generic sieve rule, the problem is that 3 
responses are sent to the original sender. (obviously because the 
rule is being executed with each user in the alias group)


Is it possible to set auto response only once, we tried the ( :days 
1) option but still all 3 respond back.


How can such a setup be achieved. (Single auto response to an alias 
group)


CentOS 7.5
dovecot-pigeonhole-2.3.4.1-1.x86_64
dovecot-2.3.4.1-1.x86_64
postfix 2.10-1


--
Best Regards
Monis


Hello Monis,

As a workaround, you can turn x...@example.com into an actual mailbox 
and give a...@example.com, b...@example.com and c...@example.com read-only 
shared folder access.


Yassine.



As a request for comments and improvements, here's a my script to share 
folders via acl files and symlinks (dovecot must be configured 
accordingly) :


root@messagerie[10.10.10.19] /usr/local/scripts/mail # cat 
sharemailbox.single

#!/bin/bash

function create_link {
    l_src=$1
    l_dst=$2
    l_maildir=$3
    t_maildir=$(echo "$3" | tr . ․)
    t_dst="$l_dst"/.shared."$t_maildir"
    echo pointing "$t_dst" to "$l_src"
    echo ln -s "$l_src/" "$t_dst"
    ln -s "$l_src/" "$t_dst"

}


function verifier_email {
    l_email=$1
    if ! searchmailbox.strict.sql $l_email > /dev/null
    then
    echo "l'utilisateur $l_email n'a pas pu être trouvé dans la 
base de données." >&2

    return 1
    fi
    return 0
}

function set_acl {
    l_maildir=$1
    l_email=$2
    echo "giving $l_email access to $l_maildir"
    if [ ! -d $l_maildir ]
    then
    #.Sent isn't there yet.
    return
    fi
    acl_file="$l_maildir/dovecot-acl"
    echo "echo user=$l_email lr >> $acl_file"
    echo user="$l_email" lr >> "$acl_file"
    chown vmail:vmail "$acl_file"
}


if [ "$#" -lt 2 ]
then
    echo "usage : $0 part...@domain.com us...@domain.com 
us...@domain.com ... "

    exit 1
fi

email="$1"
inbox="${email%@*}"
domain="${email#*@}"
src="/var/vmail/$domain/$inbox"
if ! verifier_email "$email"
then
    echo "exit at 1"
    exit 1
fi


shift
for share_email in $@
do
    if ! verifier_email $share_email
    then
    continue
    fi
    share_inbox="${share_email%@*}"
    share_domain="${share_email#*@}"
    share_maildir=/var/vmail/"$share_domain"/"$share_inbox"
    #echo grep "$share_email" "$src"/dovecot-acl
    if grep "$share_email" "$src"/dovecot-acl > /dev/null 2>&1
    then
    # then is executed when exit status is 0
    # exist status is 0 when there is a match
    echo "$share_email" has already access to "$email"
    else
    set_acl $src $share_email
    create_link $src $share_maildir $inbox
    fi
done
root@messagerie[10.10.10.19] /usr/local/scripts/mail #



Delayed flags changes over IDLE

2019-03-10 Thread Kostya Vasilyev via dovecot
Hello,

I'm experiencing slow flags changes over IMAP IDLE:

- If I start an IDLE session / command
- Change the flags of some messages via another email app
- Dovecot can take a minute or more to notify the IDLE connection about flags 
changes

If I use another email app to add or remove a message, Dovecot sends that 
(EXISTS / EXPUNGE) instantly and also flushes the (so far delayed) flags 
changes. So it does "know" already.

The system is Debian Testing, 64 bit, file system is ext4.

Dovecot is 2.3.4.1 (f79e8e7e4) - I believe from Debian repos (I had Dovecot's 
own repo added at some point, disabled now).

My mail is stored under ~/mail/.imap (not sure what this format is called), I 
mean not "single file mbox".

I have not changed any IDLE related config settings:

doveconf  | grep -i idle
default_idle_kill = 1 mins
director_ping_idle_timeout = 30 secs
imap_idle_notify_interval = 2 mins
imapc_max_idle_time = 29 mins
mailbox_idle_check_interval = 30 secs

What can I do to make Dovecot notify IDLE clients about flags changes - more 
quickly? Preferably near-instant?

-- 
Kostya Vasilyev
k...@fastmail.com


Re: Assistance with doveadm backup...

2019-03-10 Thread SH Development via dovecot
V 2.0.9

Jeff

> On Mar 10, 2019, at 12:07 AM, Aki Tuomi via dovecot  > wrote:
> 
> What version are you using?
> 
> Aki
>> On 10 March 2019 00:40 SH Development via dovecot < dovecot@dovecot.org 
>> > wrote:
>> 
>> 
>> Okay, apparently I’m just a complete idiot. Why doesn’t this work?
>> 
>> doveadm -Dv backup -u user Maildir:/mnt/maelstrombackups/vmailbackup
>> 
>> With user being the actual user name.
>> 
>> No backup is created, it just shows me the usage text.
>> 
>> Jeff
>> 
>>> On Feb 20, 2019, at 10:11 PM, SH Development < listacco...@starionline.com 
>>> > wrote:
>>> 
>>> I am having trouble locating examples of how to use doveadm backup. All the 
>>> examples I see are for sync. I simply want to create a backup to a network 
>>> volume of the email server's vmail folders. The goal here is to have a 
>>> reasonably current backup should the main drive on the email server go 
>>> south.
>>> 
>>> We currently authenticate our users from a mysql database. User’s mailboxes 
>>> are stored as domainname/username/Maildir
>>> 
>>> I assume what I will wind up on the network volume is a duplicate directory 
>>> structure as the vmail folder on the email server?
>>> 
>>> Can someone help get me started here?
>>> 
>>> Jeff
> 
> ---
> Aki Tuomi



Re: Assistance with doveadm backup...

2019-03-10 Thread Aki Tuomi via dovecot


 
 
  
   You should upgrade 2.2 first.
  
  
   
  
  
   Aki
  
  
   
On 10 March 2019 10:45 SH Development via dovecot  wrote:
   
   

   
   

   V 2.0.9
   

   
   
Jeff


 
 
  
   On Mar 10, 2019, at 12:07 AM, Aki Tuomi via dovecot <
   dovecot@dovecot.org> wrote:
  
  
   

 What version are you using?


 


 Aki


 
  On 10 March 2019 00:40 SH Development via dovecot < 
  dovecot@dovecot.org> wrote:
 
 
  
 
 
  
 
 
  Okay, apparently I’m just a complete idiot. Why doesn’t this work?
 
 
  
 
 
  doveadm -Dv backup -u user Maildir:/mnt/maelstrombackups/vmailbackup
 
 
  
 
 
  With user being the actual user name.
 
 
  
 
 
  No backup is created, it just shows me the usage text.
 
 
  
 
 
  Jeff
 
 
  
 
 
  
   On Feb 20, 2019, at 10:11 PM, SH Development < 
   listacco...@starionline.com> wrote:
  
  
   
  
  
   I am having trouble locating examples of how to use doveadm backup. All the examples I see are for sync. I simply want to create a backup to a network volume of the email server's vmail folders. The goal here is to have a reasonably current backup should the main drive on the email server go south.
  
  
   
  
  
   We currently authenticate our users from a mysql database. User’s mailboxes are stored as domainname/username/Maildir
  
  
   
  
  
   I assume what I will wind up on the network volume is a duplicate directory structure as the vmail folder on the email server?
  
  
   
  
  
   Can someone help get me started here?
  
  
   
  
  
   Jeff
  
 


 


 ---
Aki Tuomi

   
  
 


   
  
  
   
  
  
   ---
Aki Tuomi
   
 



Re: sieve vacation to an alias group

2019-03-10 Thread Monis Monther via dovecot
Hi Yassine,

Thanks for the effort, unfortunately, we cannot turn it into an actual
mailbox, this is a long story that I don't want to include here. but it
would not be a valid option in our environment. Any other ideas

Is it possible to do it with vacation? Is there another auto responder or
plugin that can achieve this? How do ticketing systems handle this?

Thanks
Monis

On Sun, Mar 10, 2019 at 11:13 AM Yassine Chaouche via dovecot <
dovecot@dovecot.org> wrote:

>
> On 3/10/19 9:07 AM, Yassine Chaouche via dovecot wrote:
>
> On 3/9/19 12:41 PM, Monis Monther via dovecot wrote:
>
> Hi,
>
> We have an alias group named x...@example.com, this alias group has 3
> actual users a...@example.com, b...@example.com and c...@example.com
>
> We set vacation rule on the generic sieve rule, the problem is that 3
> responses are sent to the original sender. (obviously because the rule is
> being executed with each user in the alias group)
>
> Is it possible to set auto response only once, we tried the ( :days 1)
> option but still all 3 respond back.
>
> How can such a setup be achieved. (Single auto response to an alias group)
>
> CentOS 7.5
> dovecot-pigeonhole-2.3.4.1-1.x86_64
> dovecot-2.3.4.1-1.x86_64
> postfix 2.10-1
>
>
> --
> Best Regards
> Monis
>
> Hello Monis,
>
> As a workaround, you can turn x...@example.com into an actual mailbox and
> give a...@example.com, b...@example.com and c...@example.com read-only shared
> folder access.
>
> Yassine.
>
>
> As a request for comments and improvements, here's a my script to share
> folders via acl files and symlinks (dovecot must be configured accordingly)
> :
>
> root@messagerie[10.10.10.19] /usr/local/scripts/mail # cat
> sharemailbox.single
> #!/bin/bash
>
> function create_link {
> l_src=$1
> l_dst=$2
> l_maildir=$3
> t_maildir=$(echo "$3" | tr . ․)
> t_dst="$l_dst"/.shared."$t_maildir"
> echo pointing "$t_dst" to "$l_src"
> echo ln -s "$l_src/" "$t_dst"
> ln -s "$l_src/" "$t_dst"
>
> }
>
>
> function verifier_email {
> l_email=$1
> if ! searchmailbox.strict.sql $l_email > /dev/null
> then
> echo "l'utilisateur $l_email n'a pas pu être trouvé dans la base
> de données." >&2
> return 1
> fi
> return 0
> }
>
> function set_acl {
> l_maildir=$1
> l_email=$2
> echo "giving $l_email access to $l_maildir"
> if [ ! -d $l_maildir ]
> then
> #.Sent isn't there yet.
> return
> fi
> acl_file="$l_maildir/dovecot-acl"
> echo "echo user=$l_email lr >> $acl_file"
> echo user="$l_email" lr >> "$acl_file"
> chown vmail:vmail "$acl_file"
> }
>
>
> if [ "$#" -lt 2 ]
> then
> echo "usage : $0 part...@domain.com us...@domain.com us...@domain.com
> ... "
> exit 1
> fi
>
> email="$1"
> inbox="${email%@*}"
> domain="${email#*@}"
> src="/var/vmail/$domain/$inbox"
> if ! verifier_email "$email"
> then
> echo "exit at 1"
> exit 1
> fi
>
>
> shift
> for share_email in $@
> do
> if ! verifier_email $share_email
> then
> continue
> fi
> share_inbox="${share_email%@*}"
> share_domain="${share_email#*@}"
> share_maildir=/var/vmail/"$share_domain"/"$share_inbox"
> #echo grep "$share_email" "$src"/dovecot-acl
> if grep "$share_email" "$src"/dovecot-acl > /dev/null 2>&1
> then
> # then is executed when exit status is 0
> # exist status is 0 when there is a match
> echo "$share_email" has already access to "$email"
> else
> set_acl $src $share_email
> create_link $src $share_maildir $inbox
> fi
> done
> root@messagerie[10.10.10.19] /usr/local/scripts/mail #
>
>

-- 
Best Regards
Monis


Re: sieve vacation to an alias group

2019-03-10 Thread Odhiambo Washington via dovecot
I think you should run a true ticketing system like RT (
https://bestpractical.com/request-tracker)

On Sun, Mar 10, 2019, 13:40 Monis Monther via dovecot 
wrote:

> Hi Yassine,
>
> Thanks for the effort, unfortunately, we cannot turn it into an actual
> mailbox, this is a long story that I don't want to include here. but it
> would not be a valid option in our environment. Any other ideas
>
> Is it possible to do it with vacation? Is there another auto responder or
> plugin that can achieve this? How do ticketing systems handle this?
>
> Thanks
> Monis
>
> On Sun, Mar 10, 2019 at 11:13 AM Yassine Chaouche via dovecot <
> dovecot@dovecot.org> wrote:
>
>>
>> On 3/10/19 9:07 AM, Yassine Chaouche via dovecot wrote:
>>
>> On 3/9/19 12:41 PM, Monis Monther via dovecot wrote:
>>
>> Hi,
>>
>> We have an alias group named x...@example.com, this alias group has 3
>> actual users a...@example.com, b...@example.com and c...@example.com
>>
>> We set vacation rule on the generic sieve rule, the problem is that 3
>> responses are sent to the original sender. (obviously because the rule is
>> being executed with each user in the alias group)
>>
>> Is it possible to set auto response only once, we tried the ( :days 1)
>> option but still all 3 respond back.
>>
>> How can such a setup be achieved. (Single auto response to an alias group)
>>
>> CentOS 7.5
>> dovecot-pigeonhole-2.3.4.1-1.x86_64
>> dovecot-2.3.4.1-1.x86_64
>> postfix 2.10-1
>>
>>
>> --
>> Best Regards
>> Monis
>>
>> Hello Monis,
>>
>> As a workaround, you can turn x...@example.com into an actual mailbox and
>> give a...@example.com, b...@example.com and c...@example.com read-only shared
>> folder access.
>>
>> Yassine.
>>
>>
>> As a request for comments and improvements, here's a my script to share
>> folders via acl files and symlinks (dovecot must be configured accordingly)
>> :
>>
>> root@messagerie[10.10.10.19] /usr/local/scripts/mail # cat
>> sharemailbox.single
>> #!/bin/bash
>>
>> function create_link {
>> l_src=$1
>> l_dst=$2
>> l_maildir=$3
>> t_maildir=$(echo "$3" | tr . ․)
>> t_dst="$l_dst"/.shared."$t_maildir"
>> echo pointing "$t_dst" to "$l_src"
>> echo ln -s "$l_src/" "$t_dst"
>> ln -s "$l_src/" "$t_dst"
>>
>> }
>>
>>
>> function verifier_email {
>> l_email=$1
>> if ! searchmailbox.strict.sql $l_email > /dev/null
>> then
>> echo "l'utilisateur $l_email n'a pas pu être trouvé dans la base
>> de données." >&2
>> return 1
>> fi
>> return 0
>> }
>>
>> function set_acl {
>> l_maildir=$1
>> l_email=$2
>> echo "giving $l_email access to $l_maildir"
>> if [ ! -d $l_maildir ]
>> then
>> #.Sent isn't there yet.
>> return
>> fi
>> acl_file="$l_maildir/dovecot-acl"
>> echo "echo user=$l_email lr >> $acl_file"
>> echo user="$l_email" lr >> "$acl_file"
>> chown vmail:vmail "$acl_file"
>> }
>>
>>
>> if [ "$#" -lt 2 ]
>> then
>> echo "usage : $0 part...@domain.com us...@domain.com us...@domain.com
>> ... "
>> exit 1
>> fi
>>
>> email="$1"
>> inbox="${email%@*}"
>> domain="${email#*@}"
>> src="/var/vmail/$domain/$inbox"
>> if ! verifier_email "$email"
>> then
>> echo "exit at 1"
>> exit 1
>> fi
>>
>>
>> shift
>> for share_email in $@
>> do
>> if ! verifier_email $share_email
>> then
>> continue
>> fi
>> share_inbox="${share_email%@*}"
>> share_domain="${share_email#*@}"
>> share_maildir=/var/vmail/"$share_domain"/"$share_inbox"
>> #echo grep "$share_email" "$src"/dovecot-acl
>> if grep "$share_email" "$src"/dovecot-acl > /dev/null 2>&1
>> then
>> # then is executed when exit status is 0
>> # exist status is 0 when there is a match
>> echo "$share_email" has already access to "$email"
>> else
>> set_acl $src $share_email
>> create_link $src $share_maildir $inbox
>> fi
>> done
>> root@messagerie[10.10.10.19] /usr/local/scripts/mail #
>>
>>
>
> --
> Best Regards
> Monis
>


Re: sieve vacation to an alias group

2019-03-10 Thread Yassine Chaouche via dovecot
I am curious to know how did you define the filter on an alias in the 
first place ? is it a filter defined globaly in dovecot ? I don't see 
how it can be defined in any individual mailbox. Can you show the 
dovecot/sieve configuration to achieve this ?


Yassine.

On 3/10/19 11:40 AM, Monis Monther via dovecot wrote:

Hi Yassine,

Thanks for the effort, unfortunately, we cannot turn it into an actual 
mailbox, this is a long story that I don't want to include here. but 
it would not be a valid option in our environment. Any other ideas


Is it possible to do it with vacation? Is there another auto responder 
or plugin that can achieve this? How do ticketing systems handle this?


Thanks
Monis

On Sun, Mar 10, 2019 at 11:13 AM Yassine Chaouche via dovecot 
mailto:dovecot@dovecot.org>> wrote:



On 3/10/19 9:07 AM, Yassine Chaouche via dovecot wrote:


On 3/9/19 12:41 PM, Monis Monther via dovecot wrote:


Hi,

We have an alias group named x...@example.com
, this alias group has 3 actual users
a...@example.com , b...@example.com
 and c...@example.com 

We set vacation rule on the generic sieve rule, the problem is
that 3 responses are sent to the original sender. (obviously
because the rule is being executed with each user in the alias
group)

Is it possible to set auto response only once, we tried the (
:days 1) option but still all 3 respond back.

How can such a setup be achieved. (Single auto response to an
alias group)

CentOS 7.5
dovecot-pigeonhole-2.3.4.1-1.x86_64
dovecot-2.3.4.1-1.x86_64
postfix 2.10-1


-- 
Best Regards

Monis


Hello Monis,

As a workaround, you can turn x...@example.com
 into an actual mailbox and give
a...@example.com , b...@example.com
 and c...@example.com 
read-only shared folder access.

Yassine.



As a request for comments and improvements, here's a my script to
share folders via acl files and symlinks (dovecot must be
configured accordingly) :

root@messagerie[10.10.10.19] /usr/local/scripts/mail # cat
sharemailbox.single
#!/bin/bash

function create_link {
    l_src=$1
    l_dst=$2
    l_maildir=$3
    t_maildir=$(echo "$3" | tr . ․)
    t_dst="$l_dst"/.shared."$t_maildir"
    echo pointing "$t_dst" to "$l_src"
    echo ln -s "$l_src/" "$t_dst"
    ln -s "$l_src/" "$t_dst"

}


function verifier_email {
    l_email=$1
    if ! searchmailbox.strict.sql $l_email > /dev/null
    then
    echo "l'utilisateur $l_email n'a pas pu être trouvé dans
la base de données." >&2
    return 1
    fi
    return 0
}

function set_acl {
    l_maildir=$1
    l_email=$2
    echo "giving $l_email access to $l_maildir"
    if [ ! -d $l_maildir ]
    then
    #.Sent isn't there yet.
    return
    fi
    acl_file="$l_maildir/dovecot-acl"
    echo "echo user=$l_email lr >> $acl_file"
    echo user="$l_email" lr >> "$acl_file"
    chown vmail:vmail "$acl_file"
}


if [ "$#" -lt 2 ]
then
    echo "usage : $0 part...@domain.com
 us...@domain.com
 us...@domain.com
 ... "
    exit 1
fi

email="$1"
inbox="${email%@*}"
domain="${email#*@}"
src="/var/vmail/$domain/$inbox"
if ! verifier_email "$email"
then
    echo "exit at 1"
    exit 1
fi


shift
for share_email in $@
do
    if ! verifier_email $share_email
    then
    continue
    fi
    share_inbox="${share_email%@*}"
    share_domain="${share_email#*@}"
share_maildir=/var/vmail/"$share_domain"/"$share_inbox"
    #echo grep "$share_email" "$src"/dovecot-acl
    if grep "$share_email" "$src"/dovecot-acl > /dev/null 2>&1
    then
    # then is executed when exit status is 0
    # exist status is 0 when there is a match
    echo "$share_email" has already access to "$email"
    else
    set_acl $src $share_email
    create_link $src $share_maildir $inbox
    fi
done
root@messagerie[10.10.10.19] /usr/local/scripts/mail #



--
Best Regards
Monis


Re: Auto MX Email Client configuration, the right way?

2019-03-10 Thread Davide Marchi via dovecot

Now I've seen the new RFC 6186 specification
(https://tools.ietf.org/html/rfc6186) that describe a "DNS way" to
achieve the same goal.

[..]
again:
[..]
When a user identifier is required, MUAs MUST first
use the full email address provided by the user, and if that 
results

in an authentication failure, SHOULD fall back to using the "local-
part" extracted from the email address.  This is in line with the
guidance outlined in Section 5.  If both these user identifiers
result in authentication failure, the MUA SHOULD prompt the user 
for

a valid identifier.
[..]

here I have the biggest doubt, in fact Thunderbird often uses only the
username and not the whole email address, both for incoming and 
outgoing

server...
Is any of you using this second way? And possibly, do you kniw if it
works with different clients (desktop and mobile)?


I've made some tests and this solution seems very serviceable, for the 
only exception for the user name on Thunderbird.
Unlike what is stated in this RFC, Thunderbird "takes" only the name and 
not the entire email address as the username.

Anyone knows if is it possible to communicate the username type via RFC?

Many thanks again!


Davide


Re: sieve vacation to an alias group

2019-03-10 Thread Yassine Chaouche via dovecot
Since sending to the alias will send to a, b and c, just define the 
filter on one mailbox only instead of making it global I guess.


Yassine.

On 3/10/19 11:51 AM, Yassine Chaouche via dovecot wrote:


I am curious to know how did you define the filter on an alias in the 
first place ? is it a filter defined globaly in dovecot ? I don't see 
how it can be defined in any individual mailbox. Can you show the 
dovecot/sieve configuration to achieve this ?


Yassine.

On 3/10/19 11:40 AM, Monis Monther via dovecot wrote:

Hi Yassine,

Thanks for the effort, unfortunately, we cannot turn it into an 
actual mailbox, this is a long story that I don't want to include 
here. but it would not be a valid option in our environment. Any 
other ideas


Is it possible to do it with vacation? Is there another auto 
responder or plugin that can achieve this? How do ticketing systems 
handle this?


Thanks
Monis

On Sun, Mar 10, 2019 at 11:13 AM Yassine Chaouche via dovecot 
mailto:dovecot@dovecot.org>> wrote:



On 3/10/19 9:07 AM, Yassine Chaouche via dovecot wrote:


On 3/9/19 12:41 PM, Monis Monther via dovecot wrote:


Hi,

We have an alias group named x...@example.com
, this alias group has 3 actual users
a...@example.com , b...@example.com
 and c...@example.com 

We set vacation rule on the generic sieve rule, the problem is
that 3 responses are sent to the original sender. (obviously
because the rule is being executed with each user in the alias
group)

Is it possible to set auto response only once, we tried the (
:days 1) option but still all 3 respond back.

How can such a setup be achieved. (Single auto response to an
alias group)

CentOS 7.5
dovecot-pigeonhole-2.3.4.1-1.x86_64
dovecot-2.3.4.1-1.x86_64
postfix 2.10-1


-- 
Best Regards

Monis


Hello Monis,

As a workaround, you can turn x...@example.com
 into an actual mailbox and give
a...@example.com , b...@example.com
 and c...@example.com 
read-only shared folder access.

Yassine.



As a request for comments and improvements, here's a my script to
share folders via acl files and symlinks (dovecot must be
configured accordingly) :

root@messagerie[10.10.10.19] /usr/local/scripts/mail # cat
sharemailbox.single
#!/bin/bash

function create_link {
    l_src=$1
    l_dst=$2
    l_maildir=$3
    t_maildir=$(echo "$3" | tr . ․)
    t_dst="$l_dst"/.shared."$t_maildir"
    echo pointing "$t_dst" to "$l_src"
    echo ln -s "$l_src/" "$t_dst"
    ln -s "$l_src/" "$t_dst"

}


function verifier_email {
    l_email=$1
    if ! searchmailbox.strict.sql $l_email > /dev/null
    then
    echo "l'utilisateur $l_email n'a pas pu être trouvé dans
la base de données." >&2
    return 1
    fi
    return 0
}

function set_acl {
    l_maildir=$1
    l_email=$2
    echo "giving $l_email access to $l_maildir"
    if [ ! -d $l_maildir ]
    then
    #.Sent isn't there yet.
    return
    fi
    acl_file="$l_maildir/dovecot-acl"
    echo "echo user=$l_email lr >> $acl_file"
    echo user="$l_email" lr >> "$acl_file"
    chown vmail:vmail "$acl_file"
}


if [ "$#" -lt 2 ]
then
    echo "usage : $0 part...@domain.com
 us...@domain.com
 us...@domain.com
 ... "
    exit 1
fi

email="$1"
inbox="${email%@*}"
domain="${email#*@}"
src="/var/vmail/$domain/$inbox"
if ! verifier_email "$email"
then
    echo "exit at 1"
    exit 1
fi


shift
for share_email in $@
do
    if ! verifier_email $share_email
    then
    continue
    fi
    share_inbox="${share_email%@*}"
    share_domain="${share_email#*@}"
share_maildir=/var/vmail/"$share_domain"/"$share_inbox"
    #echo grep "$share_email" "$src"/dovecot-acl
    if grep "$share_email" "$src"/dovecot-acl > /dev/null 2>&1
    then
    # then is executed when exit status is 0
    # exist status is 0 when there is a match
    echo "$share_email" has already access to "$email"
    else
    set_acl $src $share_email
    create_link $src $share_maildir $inbox
    fi
done
root@messagerie[10.10.10.19] /usr/local/scripts/mail #



--
Best Regards
Monis


Re: Auto MX Email Client configuration, the right way?

2019-03-10 Thread Eduardo M KALINOWSKI via dovecot
On 10/03/2019 07:52, Davide Marchi via dovecot wrote:
> I've made some tests and this solution seems very serviceable, for the
> only exception for the user name on Thunderbird.
> Unlike what is stated in this RFC, Thunderbird "takes" only the name
> and not the entire email address as the username.
> Anyone knows if is it possible to communicate the username type via RFC? 

It's certainly possible to specify that the full email is the username,
that's what I do in my server. In both  and
 include this line:

%EMAILADDRESS%


-- 
Eduardo M KALINOWSKI
edua...@kalinowski.com.br



Re: sieve vacation to an alias group

2019-03-10 Thread Monis Monther via dovecot
@odhiambo : we may later, but currently we are dependent on this email

Hi Yassine,

This is actually what I have done now, but I want it to be more robust, if
this user quits, then I must have someone else in the group with the rule.

I have moved the rule from global sieve script to one of group members in
his local sieve script, the syntax is the same

As for the rule itself

if header :contains "to" "x...@example.com"
{
vacation :days 1 :addresses "x...@example.com" :subject "Automated
Response" :from "XYZ " text:
Dear Customer,
Greetings,
Kindly be etc.,
.
;
}

On Sun, Mar 10, 2019 at 1:55 PM Yassine Chaouche via dovecot <
dovecot@dovecot.org> wrote:

> Since sending to the alias will send to a, b and c, just define the filter
> on one mailbox only instead of making it global I guess.
>
> Yassine.
> On 3/10/19 11:51 AM, Yassine Chaouche via dovecot wrote:
>
> I am curious to know how did you define the filter on an alias in the
> first place ? is it a filter defined globaly in dovecot ? I don't see how
> it can be defined in any individual mailbox. Can you show the dovecot/sieve
> configuration to achieve this ?
>
> Yassine.
> On 3/10/19 11:40 AM, Monis Monther via dovecot wrote:
>
> Hi Yassine,
>
> Thanks for the effort, unfortunately, we cannot turn it into an actual
> mailbox, this is a long story that I don't want to include here. but it
> would not be a valid option in our environment. Any other ideas
>
> Is it possible to do it with vacation? Is there another auto responder or
> plugin that can achieve this? How do ticketing systems handle this?
>
> Thanks
> Monis
>
> On Sun, Mar 10, 2019 at 11:13 AM Yassine Chaouche via dovecot <
> dovecot@dovecot.org> wrote:
>
>>
>> On 3/10/19 9:07 AM, Yassine Chaouche via dovecot wrote:
>>
>> On 3/9/19 12:41 PM, Monis Monther via dovecot wrote:
>>
>> Hi,
>>
>> We have an alias group named x...@example.com, this alias group has 3
>> actual users a...@example.com, b...@example.com and c...@example.com
>>
>> We set vacation rule on the generic sieve rule, the problem is that 3
>> responses are sent to the original sender. (obviously because the rule is
>> being executed with each user in the alias group)
>>
>> Is it possible to set auto response only once, we tried the ( :days 1)
>> option but still all 3 respond back.
>>
>> How can such a setup be achieved. (Single auto response to an alias group)
>>
>> CentOS 7.5
>> dovecot-pigeonhole-2.3.4.1-1.x86_64
>> dovecot-2.3.4.1-1.x86_64
>> postfix 2.10-1
>>
>>
>> --
>> Best Regards
>> Monis
>>
>> Hello Monis,
>>
>> As a workaround, you can turn x...@example.com into an actual mailbox and
>> give a...@example.com, b...@example.com and c...@example.com read-only shared
>> folder access.
>>
>> Yassine.
>>
>>
>> As a request for comments and improvements, here's a my script to share
>> folders via acl files and symlinks (dovecot must be configured accordingly)
>> :
>>
>> root@messagerie[10.10.10.19] /usr/local/scripts/mail # cat
>> sharemailbox.single
>> #!/bin/bash
>>
>> function create_link {
>> l_src=$1
>> l_dst=$2
>> l_maildir=$3
>> t_maildir=$(echo "$3" | tr . ․)
>> t_dst="$l_dst"/.shared."$t_maildir"
>> echo pointing "$t_dst" to "$l_src"
>> echo ln -s "$l_src/" "$t_dst"
>> ln -s "$l_src/" "$t_dst"
>>
>> }
>>
>>
>> function verifier_email {
>> l_email=$1
>> if ! searchmailbox.strict.sql $l_email > /dev/null
>> then
>> echo "l'utilisateur $l_email n'a pas pu être trouvé dans la base
>> de données." >&2
>> return 1
>> fi
>> return 0
>> }
>>
>> function set_acl {
>> l_maildir=$1
>> l_email=$2
>> echo "giving $l_email access to $l_maildir"
>> if [ ! -d $l_maildir ]
>> then
>> #.Sent isn't there yet.
>> return
>> fi
>> acl_file="$l_maildir/dovecot-acl"
>> echo "echo user=$l_email lr >> $acl_file"
>> echo user="$l_email" lr >> "$acl_file"
>> chown vmail:vmail "$acl_file"
>> }
>>
>>
>> if [ "$#" -lt 2 ]
>> then
>> echo "usage : $0 part...@domain.com us...@domain.com us...@domain.com
>> ... "
>> exit 1
>> fi
>>
>> email="$1"
>> inbox="${email%@*}"
>> domain="${email#*@}"
>> src="/var/vmail/$domain/$inbox"
>> if ! verifier_email "$email"
>> then
>> echo "exit at 1"
>> exit 1
>> fi
>>
>>
>> shift
>> for share_email in $@
>> do
>> if ! verifier_email $share_email
>> then
>> continue
>> fi
>> share_inbox="${share_email%@*}"
>> share_domain="${share_email#*@}"
>> share_maildir=/var/vmail/"$share_domain"/"$share_inbox"
>> #echo grep "$share_email" "$src"/dovecot-acl
>> if grep "$share_email" "$src"/dovecot-acl > /dev/null 2>&1
>> then
>> # then is executed when exit status is 0
>> # exist status is 0 when there is a match
>> echo "$share_email" has already access to "$email"
>> else
>> set_acl $src $share_email
>> create_link $src $share_maildir $inbox
>> fi
>> done
>> root@messagerie[10.10.

Re: sieve vacation to an alias group

2019-03-10 Thread Yassine Chaouche via dovecot



On 3/10/19 12:35 PM, Monis Monther via dovecot wrote:

[...]

This is actually what I have done now, but I want it to be more 
robust, if this user quits, then I must have someone else in the group 
with the rule.

[...]


Yeah, a multipurpose, reusable notificati...@domain.tld fake / bot email 
account :)


Yassine.



Re: Assistance with doveadm backup...

2019-03-10 Thread SH Development via dovecot
Okay then.  Is there a document on how to do that in place?  That was one of 
the reasons I was trying to do a backup first.

Jeff


> On Mar 10, 2019, at 4:12 AM, Aki Tuomi via dovecot  > wrote:
> 
> You should upgrade 2.2 first.
> 
> Aki
>> On 10 March 2019 10:45 SH Development via dovecot > > wrote:
>> 
>> 
>> V 2.0.9
>> 
>> Jeff 
>> 
>>> On Mar 10, 2019, at 12:07 AM, Aki Tuomi via dovecot < dovecot@dovecot.org 
>>> > wrote:
>>> What version are you using?
>>> 
>>> Aki
 On 10 March 2019 00:40 SH Development via dovecot < dovecot@dovecot.org 
 > wrote:
 
 
 Okay, apparently I’m just a complete idiot. Why doesn’t this work?
 
 doveadm -Dv backup -u user Maildir:/mnt/maelstrombackups/vmailbackup
 
 With user being the actual user name.
 
 No backup is created, it just shows me the usage text.
 
 Jeff
 
> On Feb 20, 2019, at 10:11 PM, SH Development < 
> listacco...@starionline.com > wrote:
> 
> I am having trouble locating examples of how to use doveadm backup. All 
> the examples I see are for sync. I simply want to create a backup to a 
> network volume of the email server's vmail folders. The goal here is to 
> have a reasonably current backup should the main drive on the email 
> server go south.
> 
> We currently authenticate our users from a mysql database. User’s 
> mailboxes are stored as domainname/username/Maildir
> 
> I assume what I will wind up on the network volume is a duplicate 
> directory structure as the vmail folder on the email server?
> 
> Can someone help get me started here?
> 
> Jeff
>>> 
>>> ---
>>> Aki Tuomi
>> 
> 
> ---
> Aki Tuomi



Re: Delayed flags changes over IDLE

2019-03-10 Thread Kostya Vasilyev via dovecot
Just tried running with mail_debug=yes and unfortunately can't see anything 
useful.

It seems that flags changes (when set from clients) are not logged.

Any way to debug this?

Maybe it's intended behavior (to buffer up flags changes until later time, 
unless flushed with adding / removing messages)?

If it is working as intended, is there a setting to tune down the delay?

-- 
Kostya Vasilyev
k...@fastmail.com

On Sun, Mar 10, 2019, at 11:15 AM, Kostya Vasilyev via dovecot wrote:
> Hello,
> 
> I'm experiencing slow flags changes over IMAP IDLE:
> 
> - If I start an IDLE session / command
> - Change the flags of some messages via another email app
> - Dovecot can take a minute or more to notify the IDLE connection about 
> flags changes
> 
> If I use another email app to add or remove a message, Dovecot sends 
> that (EXISTS / EXPUNGE) instantly and also flushes the (so far delayed) 
> flags changes. So it does "know" already.
> 
> The system is Debian Testing, 64 bit, file system is ext4.
> 
> Dovecot is 2.3.4.1 (f79e8e7e4) - I believe from Debian repos (I had 
> Dovecot's own repo added at some point, disabled now).
> 
> My mail is stored under ~/mail/.imap (not sure what this format is 
> called), I mean not "single file mbox".
> 
> I have not changed any IDLE related config settings:
> 
> doveconf  | grep -i idle
> default_idle_kill = 1 mins
> director_ping_idle_timeout = 30 secs
> imap_idle_notify_interval = 2 mins
> imapc_max_idle_time = 29 mins
> mailbox_idle_check_interval = 30 secs
> 
> What can I do to make Dovecot notify IDLE clients about flags changes - 
> more quickly? Preferably near-instant?
> 
> -- 
> Kostya Vasilyev
> k...@fastmail.com
>


Re: Assistance with doveadm backup...

2019-03-10 Thread SH Development via dovecot
Ok, so for lack of any other information, am I to conclude that the doveadm 
backup command is broken in 2.0.9?  I have been through the wiki for it back 
and forth and cannot make it work.

Yes, I need to upgrade, there is no question, but I won’t do that without a 
maildir backup.  I would prefer to use the built-in dovecot mechanisms for that 
than something else.

Jeff

> On Mar 10, 2019, at 12:09 PM, SH Development via dovecot  > wrote:
> 
> Okay then.  Is there a document on how to do that in place?  That was one of 
> the reasons I was trying to do a backup first.
> 
> Jeff
> 
> 
>> On Mar 10, 2019, at 4:12 AM, Aki Tuomi via dovecot > > wrote:
>> 
>> You should upgrade 2.2 first.
>> 
>> Aki
>>> On 10 March 2019 10:45 SH Development via dovecot >> > wrote:
>>> 
>>> 
>>> V 2.0.9
>>> 
>>> Jeff 
>>> 
 On Mar 10, 2019, at 12:07 AM, Aki Tuomi via dovecot < dovecot@dovecot.org 
 > wrote:
 What version are you using?
 
 Aki
> On 10 March 2019 00:40 SH Development via dovecot < dovecot@dovecot.org 
> > wrote:
> 
> 
> Okay, apparently I’m just a complete idiot. Why doesn’t this work?
> 
> doveadm -Dv backup -u user Maildir:/mnt/maelstrombackups/vmailbackup
> 
> With user being the actual user name.
> 
> No backup is created, it just shows me the usage text.
> 
> Jeff
> 
>> On Feb 20, 2019, at 10:11 PM, SH Development < 
>> listacco...@starionline.com > wrote:
>> 
>> I am having trouble locating examples of how to use doveadm backup. All 
>> the examples I see are for sync. I simply want to create a backup to a 
>> network volume of the email server's vmail folders. The goal here is to 
>> have a reasonably current backup should the main drive on the email 
>> server go south.
>> 
>> We currently authenticate our users from a mysql database. User’s 
>> mailboxes are stored as domainname/username/Maildir
>> 
>> I assume what I will wind up on the network volume is a duplicate 
>> directory structure as the vmail folder on the email server?
>> 
>> Can someone help get me started here?
>> 
>> Jeff
 
 ---
 Aki Tuomi
>>> 
>> 
>> ---
>> Aki Tuomi
> 



Re: Assistance with doveadm backup...

2019-03-10 Thread Aki Tuomi via dovecot


 
 
  
   I'd say the correct term is not broken but missing. backup was implemented in later version. 
  
  
   
  
  
   With maildir keeping a copy of the content is sufficient backup. 
  
  
   
  
  
   Aki
  
  
   
On 11 March 2019 03:39 SH Development via dovecot  wrote:
   
   

   
   

   Ok, so for lack of any other information, am I to conclude that the doveadm backup command is broken in 2.0.9?  I have been through the wiki for it back and forth and cannot make it work.
   

   
   
Yes, I need to upgrade, there is no question, but I won’t do that without a maildir backup.  I would prefer to use the built-in dovecot mechanisms for that than something else.
   
   

   
   
Jeff


 
 
  
   On Mar 10, 2019, at 12:09 PM, SH Development via dovecot <
   dovecot@dovecot.org> wrote:
  
  
   
Okay then.  Is there a document on how to do that in place?  That was one of the reasons I was trying to do a backup first.

 


 Jeff


 
 
  
  
   
On Mar 10, 2019, at 4:12 AM, Aki Tuomi via dovecot <
dovecot@dovecot.org> wrote:
   
   

 
  You should upgrade 2.2 first.
 
 
  
 
 
  Aki
 
 
  
   On 10 March 2019 10:45 SH Development via dovecot <
   dovecot@dovecot.org> wrote:
  
  
   
  
  
   
  V 2.0.9
  
   
  
  
   Jeff 
   
   


 
  On Mar 10, 2019, at 12:07 AM, Aki Tuomi via dovecot < 
  dovecot@dovecot.org> wrote:
 
 
  
   
What version are you using?
   
   

   
   
Aki
   
   

 On 10 March 2019 00:40 SH Development via dovecot < 
 dovecot@dovecot.org> wrote:


 


 


 Okay, apparently I’m just a complete idiot. Why doesn’t this work?


 


 doveadm -Dv backup -u user Maildir:/mnt/maelstrombackups/vmailbackup


 


 With user being the actual user name.


 


 No backup is created, it just shows me the usage text.


 


 Jeff


 


 
  On Feb 20, 2019, at 10:11 PM, SH Development < 
  listacco...@starionline.com> wrote:
 
 
  
 
 
  I am having trouble locating examples of how to use doveadm backup. All the examples I see are for sync. I simply want to create a backup to a network volume of the email server's vmail folders. The goal here is to have a reasonably current backup should the main drive on the email server go south.
 
 
  
 
 
  We currently authenticate our users from a mysql database. User’s mailboxes are stored as domainname/username/Maildir
 
 
  
 
 
  I assume what I will wind up on the network volume is a duplicate directory structure as the vmail folder on the email server?
 
 
  
 
 
  Can someone help get me started here?
 
 
  
 
 
  Jeff