2007年10月22日星期一

procmail使用

procmail不区分大小写,它使用Unix最常用的模式匹配方式进行匹配特定的邮件。因此使用这些匹配模式和procmail规则,可以定义一个更复杂的.procmailrc:

  
PATH=$HOME/bin: /usr/bin: /usr/ucb: /bin: /usr/local/bin:.
SHELL=/bin/sh
MAILDIR=$HOME/mail
DEFAULT=$MAILDIR/mailbox
LOGFILE=/dev/null
SENDMAIL=/usr/lib/sendmail
:0:
* ^From.*badguy     
/dev/null/
:0c:
* ^(From|Cc|To).*freebsd.org
| gzip >> freebsdmail.gz
:0:
* ^From.*@hotmail.com
* ^Subject:.*(joke|funny)
{
  :0 c
  ! friend1@hotmail.com friend2@usa.net
  :0
  joke
}
:0
* ^Subject:.*order
* !^FROM_DAEMON
* !^X-Loop: marketing@company.com
{
  :0 h c
  | (formail -r -A"X-Loop: marketing@company.com " ; \
  cat /market/acknowlegement.txt ) | $SENDMAIL -t
  :0 c
  ! market2@company.com
  :0
  market
}

  这个配置文件的第一部分中设置了几个环境变量,用于设置procmail的运行环境,其中将 MAILDIR设置为~/mail,与pine使用的目录相同,因此这将使pine能直接读取procmail处理过的邮件。

  第二部分中为邮件定义了三个不同的过滤规则及相应的处理操作,第一个规则将来自badguy 的邮件滤掉(输出到/dev/null);第二个规则将与freebsd.org的通信使用gzip保存到freebsdmail.gz 中,用于保存相应maillist的邮件;第三个规则将某个使用hotmail帐号的朋友,并使用joke或funny标题给自己发送笑话的邮件同时转给其他几个朋友,并同时保存在joke文件夹中;最后一个规则是设置了一个自动回复邮件系统,对于使用order做标题,并且没有FROM_DAEMON行(自动邮件回复程序使用FROM_DAEMON 作标记,通常不需要回复这些的邮件,否则会造成回复循环),并且没有包括X-Loop行的邮件进行处理:

  首先将X-Loop行添加到邮件中(使用formail将它们添加到mail的信封上),以免造成对同一个邮件的循环处理,然后将文件/market/acknowlegement.txt发回给发送者;并以及转发邮件,在market中保存邮件。

  根据这些规则,使用Procmail就能完整的处理各种邮件,减轻电子邮件不断增多而造成的困扰。

46 条评论:

zhuyuan Xiang 说...

thanks!

匿名 说...

Hello, yeah this paragraph is genuinely good and I have learned lot of
things from it concerning blogging. thanks.

Take a look at my blog post :: cheats

匿名 说...

If some one wants to be updated with latest technologies then he must be visit this website and be up to date all
the time.

my web page; cottoncandy.com

匿名 说...

I every time emailed this blog post page to all my
contacts, for the reason that if like to read it next my contacts will too.


Take a look at my website; pies

匿名 说...

Useful information. Fortunate me I found your web site by chance, and I am surprised why this coincidence did not took place in advance!

I bookmarked it.

Also visit my site: christmas gift

匿名 说...

I have been browsing online more than 3 hours today, yet I by no means discovered any interesting article like yours.

It is lovely value enough for me. In my opinion, if all webmasters and bloggers made
excellent content material as you probably did, the net might be a lot more useful than ever
before.

Look into my website - password hacking

匿名 说...

Hmm it appears like your website ate my first comment (it was super long) so I guess I'll just sum it up what I wrote and say, I'm
thoroughly enjoying your blog. I as well am an aspiring blog
writer but I'm still new to everything. Do you have any points for inexperienced blog writers? I'd definitely appreciate it.


Visit my web blog ... password cracker

匿名 说...

Hi colleagues, its great paragraph on the topic of teachingand fully explained, keep it up
all the time.

Take a look at my web blog; free software download full version

匿名 说...

Somebody essentially assist to make severely posts
I would state. That is the very first time I frequented your website
page and up to now? I amazed with the research
you made to create this actual post amazing. Magnificent task!


my homepage :: dragonvale game on the computer

匿名 说...

Ahaa, its nice dialogue regarding this paragraph here at this web site,
I have read all that, so now me also commenting at this place.



Here is my weblog ... medal of Honor games for ps3

匿名 说...

Pretty nice post. I simply stumbled upon your weblog and wished to mention that I've truly enjoyed browsing your blog posts. After all I'll be subscribing to your feed and I hope you write
again very soon!

Also visit my web-site :: crack passwords

匿名 说...

Hi there colleagues, its wonderful paragraph about teachingand fully explained, keep it up all the time.


Here is my page ... reset password

匿名 说...

Hello there! This post could not be written any better!
Looking at this article reminds me of my previous roommate!

He always kept preaching about this. I am going to send this post to him.
Pretty sure he's going to have a great read. Thank you for sharing!

Feel free to surf to my webpage ... sonic funny videos

匿名 说...

If you want a Premium Minecraft Account check out
this generator. With it you can generate a unique Minecraft Premium Account which
no one else has! You can Download the Free Premium Minecraft Account Generator http:
//www.get-minecraft-free.tk

That is very fascinating, You are an overly professional blogger.
I've joined your feed and sit up for in quest of extra of your wonderful post. Additionally, I've shared your site in my social networks

匿名 说...

I was able to find good information from your blog posts.

my web blog - minecraft download

匿名 说...

Having read this I thought it was really enlightening.
I appreciate you finding the time and effort to put this article together.

I once again find myself spending a lot of time both reading and leaving comments.
But so what, it was still worthwhile!

Here is my homepage :: rar password cracker

匿名 说...

There is certainly a lot to find out about this topic.
I like all the points you have made.

Here is my webpage ... Minecraft Hacks

匿名 说...

Excellent, what a website it is! This blog gives valuable information to us, keep it up.


Look at my web page: get money fast

匿名 说...

I just couldn't go away your site before suggesting that I really loved the standard info an individual supply for your visitors? Is gonna be again often in order to inspect new posts

My web site ... Funny Video

匿名 说...

Simply desire to say your article is as amazing.
The clearness in your post is simply nice and i can assume you are an expert on this subject.
Fine with your permission let me to grab your feed to keep updated with forthcoming post.
Thanks a million and please continue the enjoyable work.


My web-site LOL videos

匿名 说...

I have learn some good stuff here. Certainly value bookmarking
for revisiting. I wonder how much effort you place
to make this sort of great informative site.



my website :: how to get money Free

匿名 说...

Awesome website you have here but I was wondering if you knew of any forums that cover the same topics discussed here?
I'd really like to be a part of community where I can get feed-back from other experienced people that share the same interest. If you have any suggestions, please let me know. Many thanks!

my site ... play and get Minecraft for free

匿名 说...

I pay a quick visit day-to-day some web pages and blogs to read
articles or reviews, except this blog gives feature based content.


my web site :: MineCraft Premium Generator

匿名 说...

Informative article, exactly what I needed.


My site; Get Twitter User Data Back

匿名 说...

of course like your web-site but you have to
test the spelling on several of your posts.
Several of them are rife with spelling problems and I to find it very bothersome to inform the reality nevertheless I will
surely come back again.

Also visit my blog post :: get dragonvale

匿名 说...

If you are going for finest contents like I do, only pay a quick visit this site
daily as it gives quality contents, thanks

Review my web-site; to make money on the internet

匿名 说...

This is very interesting, You're a very skilled blogger. I have joined your rss feed and look forward to seeking more of your excellent post. Also, I've shared your
web site in my social networks!

Look at my site: get Twitter user Data Back

匿名 说...

Hey there! I know this is kind of off topic but I was
wondering which blog platform are you using for this site?
I'm getting sick and tired of Wordpress because I've had problems with
hackers and I'm looking at options for another platform. I would be awesome if you could point me in the direction of a good platform.

My weblog: Reset Password

匿名 说...

I am really loving the theme/design of your website.
Do you ever run into any internet browser compatibility
issues? A number of my blog visitors have complained about my site not
working correctly in Explorer but looks great in Opera.
Do you have any advice to help fix this issue?

Also visit my blog post ... Batman Games Online

匿名 说...

Spot on with this write-up, I honestly feel this amazing site needs much more attention.

I'll probably be returning to see more, thanks for the advice!

my weblog: Online Batman Games

匿名 说...

You ought to take paгt in a contеst
fοr one of the higheѕt qualitу sites οnline.
I most certainly will highly recommend this blog!


Fеel free tо visit my blog make money online

匿名 说...

It's really a nice and useful piece of information. I am glad that you simply shared this helpful info with us. Please stay us informed like this. Thanks for sharing.

Look into my site :: make money online fast and free

匿名 说...

Great delivery. Outstanding arguments. Keep up the good spirit.


Also visit my site ... sharecash surveys

匿名 说...

I'm gone to inform my little brother, that he should also visit this blog on regular basis to take updated from most up-to-date news.

Review my page - How to get free Minecraft

匿名 说...

We're a group of volunteers and opening a new scheme in our community. Your website offered us with valuable information to work on. You have done a formidable job and our whole community will be grateful to you.

Look into my web site; LOL videos

匿名 说...

Everything is very open with a precise clarification of the issues.
It was really informative. Your website is very useful.

Thanks for sharing!

Here is my page: minecraft download

匿名 说...

Now I am going away to do my breakfast, after having my breakfast coming yet again to
read other news.

Feel free to visit my blog post: sharecash surveys

匿名 说...

Hi my friend! I wish to say that this article
is amazing, great written and come with almost all vital infos.
I would like to look extra posts like this .

Feel free to visit my weblog - free minecraft accounts

匿名 说...

What a data of un-ambiguity and preserveness of valuable familiarity about unpredicted emotions.


my web blog: sharecash

匿名 说...

Asking questions are actually nice thing if you are not understanding something entirely, but this article offers nice
understanding yet.

Also visit my web blog - playstation cash generator

匿名 说...

Hello everyone, it's my first pay a visit at this web page, and article is actually fruitful designed for me, keep up posting these content.

Also visit my web site - free windows password reset

匿名 说...

This is a really good tip particularly to those
new to the blogosphere. Simple but very accurate
info… Thank you for sharing this one. A must read article!


Here is my web site :: Minecraft for free

匿名 说...

Neat blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple tweeks would really make my blog stand out.
Please let me know where you got your design. Thank you

My web blog - Free Minecraft

匿名 说...

I was curious if you ever thought of changing the structure of your site?

Its very well written; I love what youve got to say.
But maybe you could a little more in the way of content
so people could connect with it better. Youve got an awful lot of text for
only having one or two images. Maybe you could space it out better?


Feel free to visit my website :: Hack Twitter Accounts Free Tool

匿名 说...

Everything is very open with a really clear clarification of the challenges.

It was really informative. Your site is useful.
Thank you for sharing!

my web blog: minecraft 1.0

匿名 说...

Right here is the right website for everyone who really wants to understand this topic.

You realize a whole lot its almost hard to argue with you (not that I
personally would want to…HaHa). You definitely put a new spin on a topic which has been written about
for a long time. Excellent stuff, just wonderful!

Check out my blog post: eve online isk