文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Sort your mail with Sieve under Cyrus

Sort your mail with Sieve under Cyrus

时间:2006-04-13  来源:me09

Debian Administration

System Administration Tips and Resources

[ About | Archive | FAQ | Hall of Fame | Search | Tagged Articles |

Sort your mail with Sieve under Cyrus

Posted by leto on Thu 18 Aug 2005 at 13:32

Tags:

The principal advantage with an imapd server is that your mailbox is the same for all your mail clients. When you need to filter some emails this is usually a job for your mail client - and if it's not running, there's no filtering. Sieve allows you to filter mails in your Cyrus imap server even when you don't have a client open.

Configure Cyrus

Edit the file /etc/imad.conf and uncomment this line to activate the sieve admin :

sieve_admins: cyrus 

Then choose the directory of the sieve scripts :

sievedir: /var/spool/sieve 

It's time to active sieve daemon, uncomment :

sieve cmd="timsieved" listen="localhost:sieve" prefork=0 maxchild=100 

Once all that is done restart your cyrus daemon.

You can verify that the service is activated :

linux:/home/leto# cat /etc/services | grep sieve sieve 2000/tcp # Sieve mail filter daemon 
Create a sieve script

Here are some simple examples (location of the script doesn't matter) :

cat script.sieve # If subject contains [Linux] then put it on the "Linux" box. if header :contains "Subject" "[Linux]" { fileinto "Linux"; stop; } # If mail is from cube3 company put it on the "Cube3" box. if address :domain :is "From" "cube3.org" { fileinto "Cube3"; stop; } # If mail address is one of my friend bob put it on "Mybudbob" box. if address :is "From" ["[email protected]", "[email protected]"] \ { fileinto "MonpoteBob"; stop; } # Same thing but just for one address. if header :contains "From" "Cron Daemon" { fileinto "Reports"; stop; }
Install the script

If there's no shell use option : --user=*user*

sieveshell localhost >put script.sieve >activate script.sieve >quit 

Your script is ready :)

If It doesn't work

Verify your syslog, if you have the following error:

Fileinto: Invalid mailbox name 

Then you can fix this by replacing in your your script : target by INBOX.target or INBOX/target depending on your cyrus version.

Comment on this article

Print version

 

<<< Exporting MySQL and PostgreSQL Database Contents Question: Recommended IMAP server for Debian? >>>
<IFRAME name=google_ads_frame marginWidth=0 marginHeight=0 src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-1910202134166551&amp;dt=1144923716000&amp;lmt=1144923711&amp;format=728x90_as&amp;output=html&amp;channel=4454478967&amp;url=http%3A%2F%2Fwww.debian-administration.org%2Farticles%2F219&amp;ad_type=text_image&amp;ref=http%3A%2F%2Fwww.google.com%2Fsearch%3Fhl%3Dzh-CN%26newwindow%3D1%26q%3Ddebian%2Bimap%2Bsieve%26btnG%3D%25E6%2590%259C%25E7%25B4%25A2%26lr%3D&amp;cc=100&amp;u_h=768&amp;u_w=1024&amp;u_ah=738&amp;u_aw=1024&amp;u_cd=32&amp;u_tz=480&amp;u_his=1&amp;u_java=true&amp;u_nplug=7&amp;u_nmime=20" frameBorder=0 width=728 scrolling=no height=90 allowTransparency></IFRAME>

Why are these adverts here?

#1 Squirrelmail Plugin Posted by omerida (67.153.xx.xx) on Thu 18 Aug 2005 at 15:09 If you use Squirrelmail, there is at least one plugin for creating sieve scripts via a web interface.

http://www.squirrelmail.org/plugin_view.php?id=73

[ Parent | Reply to this comment ]

#2 Re: Squirrelmail Plugin Posted by leto (194.2.xx.xx) on Thu 18 Aug 2005 at 15:21 there's a package websieve - Web based Cyrus IMAP user admin client too.

[ Parent | Reply to this comment ]

#4 Re: Squirrelmail Plugin Posted by Anonymous (213.74.xx.xx) on Fri 19 Aug 2005 at 07:51 What should I do if I am using courier IMAP.

[ Parent | Reply to this comment ]

#3 Re: Sort your mail with Sieve under Cyrus Posted by Anonymous (69.214.xx.xx) on Fri 19 Aug 2005 at 06:10 If you use the Exim4 MTA, you can also use its .forward file -- see the official documentation for more on this.

[ Parent | Reply to this comment ]

#5 Re: Sort your mail with Sieve under Cyrus Posted by Anonymous (216.194.xx.xx) on Sun 21 Aug 2005 at 23:03

In the article this:

linux:/home/leto# cat /etc/services | grep sieve sieve 2000/tcp # Sieve mail filter daemon 

is used to "verify that the sieve service is running", which is not true. /etc/services is just a list of ports and the services that are normally attached to those ports. It is a text file that is not changed wether a daemon is running on the host or not.

Something like:

$ netstat -lt| grep sieve 

would tell the admin if the sieve daemon is running on the expected port or not.

[ Parent | Reply to this comment ]

#6 Re: Sort your mail with Sieve under Cyrus Posted by Anonymous (217.169.xx.xx) on Tue 27 Sep 2005 at 10:50 How to add Sieve to Debian?

[ Parent | Reply to this comment ]

#7 Re: Sort your mail with Sieve under Cyrus Posted by maddler (213.140.xx.xx) on Wed 12 Oct 2005 at 00:51 any answer?
I'd need that too...

[ Parent | Reply to this comment ]

#8 Re: Sort your mail with Sieve under Cyrus Posted by ivc (212.125.xx.xx) on Sun 23 Oct 2005 at 22:33 Sieve is included in the cyrus21-common package.
排行榜 更多 +
宝宝切水果安卓版

宝宝切水果安卓版

休闲益智 下载
儿童脑筋急转弯

儿童脑筋急转弯

休闲益智 下载
袭击现场2

袭击现场2

飞行射击 下载