On 25.12.2007 23:36, Christian Flothmann wrote:> Hello everybody, > > i am filtering e-mails using the cmusieve-plugin. A global script filters > all mails tagged by SpamAssasin and moves them into the folder Spam: > > if header :is "X-Spam-Flag" "YES" { > fileinto "Spam"; > } > > My problem is that users who did not had a folder Spam until the first > time of filtering a spam mail are not automatically subscribed to this new > created folder. They have to do this step manually in their mail client. > > Is it possible to automate this script and subscribe the account to this > folder when it is created by the sieve script? > > Regards, > Christian > >You probably can write you own shell script to add folder name in subscription file, because its stored as text.
Hello everybody, i am filtering e-mails using the cmusieve-plugin. A global script filters all mails tagged by SpamAssasin and moves them into the folder Spam: if header :is "X-Spam-Flag" "YES" { fileinto "Spam"; } My problem is that users who did not had a folder Spam until the first time of filtering a spam mail are not automatically subscribed to this new created folder. They have to do this step manually in their mail client. Is it possible to automate this script and subscribe the account to this folder when it is created by the sieve script? Regards, Christian
This is entirely client independent. Some clients would see this automatically while others such as outlook will not. As far as I am aware there is no way to push this from server side. Mark. On 25 Dec 2007, at 20:36, "Christian Flothmann" <christian.flothmann at xabbuh.de > wrote:> Hello everybody, > > i am filtering e-mails using the cmusieve-plugin. A global script > filters > all mails tagged by SpamAssasin and moves them into the folder Spam: > > if header :is "X-Spam-Flag" "YES" { > fileinto "Spam"; > } > > My problem is that users who did not had a folder Spam until the first > time of filtering a spam mail are not automatically subscribed to > this new > created folder. They have to do this step manually in their mail > client. > > Is it possible to automate this script and subscribe the account to > this > folder when it is created by the sieve script? > > Regards, > Christian >
> You probably can write you own shell script to add folder name in > subscription file, because its stored as text.Thanks, I think I will write a shell script which runs periodically and add the folder name to the subscription file.
Here is my litte script: #!/bin/bash # find all domains for domain in /var/mail/*; do if [ -d $domain ]; then # find all accounts for each domain for user in $domain/*; do if [ -d $user ]; then subscriptionfile=$user/mail/subscriptions # create subscription file if it does not exist if [ ! -f $subscriptionfile ]; then touch $subscriptionfile fi grep Spam $user/mail/subscriptions &> /dev/null # subscribe to folder if user has not been subscribed yet if [ $? -eq 1 ]; then echo "Spam" >> $subscriptionfile fi; fi done fi done Maybe this could help someone having the same problem.