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 at dovecot.org <mailto:dovecot at 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 xyz at example.com >>> <mailto:xyz at example.com>, this alias group has 3 actual users >>> a at example.com <mailto:a at example.com>, b at example.com >>> <mailto:b at example.com> and c at example.com <mailto:c at 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 xyz at example.com >> <mailto:xyz at example.com> into an actual mailbox and give >> a at example.com <mailto:a at example.com>, b at example.com >> <mailto:b at example.com> and c at example.com <mailto:c at 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 at 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 partage at domain.com > <mailto:partage at domain.com> user1 at domain.com > <mailto:user1 at domain.com> user2 at domain.com > <mailto:user2 at 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 at messagerie[10.10.10.19] /usr/local/scripts/mail # > > > > -- > Best Regards > Monis-------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20190310/b186b637/attachment.html>
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 at dovecot.org <mailto:dovecot at 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 xyz at example.com >>>> <mailto:xyz at example.com>, this alias group has 3 actual users >>>> a at example.com <mailto:a at example.com>, b at example.com >>>> <mailto:b at example.com> and c at example.com <mailto:c at 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 xyz at example.com >>> <mailto:xyz at example.com> into an actual mailbox and give >>> a at example.com <mailto:a at example.com>, b at example.com >>> <mailto:b at example.com> and c at example.com <mailto:c at 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 at 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 partage at domain.com >> <mailto:partage at domain.com> user1 at domain.com >> <mailto:user1 at domain.com> user2 at domain.com >> <mailto:user2 at 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 at messagerie[10.10.10.19] /usr/local/scripts/mail # >> >> >> >> -- >> Best Regards >> Monis-------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20190310/b6abef8c/attachment-0001.html>
@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" "xyz at example.com" { vacation :days 1 :addresses "xyz at example.com" :subject "Automated Response" :from "XYZ <xyz at example.com>" text: Dear Customer, Greetings, Kindly be ....etc., . ; } On Sun, Mar 10, 2019 at 1:55 PM Yassine Chaouche via dovecot < dovecot at 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 at 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 xyz at example.com, this alias group has 3 >> actual users a at example.com, b at example.com and c at 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 xyz at example.com into an actual mailbox and >> give a at example.com, b at example.com and c at 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 at 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 partage at domain.com user1 at domain.com user2 at 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 at messagerie[10.10.10.19] /usr/local/scripts/mail # >> >> > > -- > Best Regards > Monis > >-- Best Regards Monis -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20190310/300b07d7/attachment.html>