邮件规则的实现

邮件规则,包含两部分内容:
1、黑白名单
2、转发规则
 
我们采用过的方式包括:
1、使用rule.dll,这是exchange 5.5 sdk带的(现在是2007年代),VC++写的。偶跟踪过几次,里面有严重的内存泄露(5分钟之内asp.net会崩溃),有指针release多次的问题。还为此提过一个CASE,被exchange engineer狂鄙视。
2、使用rule.dll,不过不在asp.net上面玩了,改成一个console的exe,然后在sql2005的sp中,xp_cmdshell来调用。自己测试,发现很快的产生20-30个左右的cmd实例,最后desktop heap用光,sqlserver服务器开始发疯……(之所以考虑到这种,是因为客户端调用时间短,有leak也不怕,反正结束后就还给OS了)
3、采用HTTP GET/POST来操作OWA。经过压力测试,这种方式对于OWA的负载太大,响应时间也不好。
4、采用exchange的TransportAgent来写。小胖作了一个服务,写了转发规则那部分,偶把黑白名单加入进去。这种方式下,理论上黑白名单定义的时候,只是一个db的操作。目前来看,方式4是可行的。
 
说句题外话,如果有同学想用HMC来玩exchange,最好放弃或者死掉这条心。偶们吃的亏太多了。。。如果用PowerShell,你会碰到第一次runspace建立的性能问题。如果你用pool,会碰到lock带来的瓶颈。这个问题,现在还没想到好办法。
posted @ 2008-04-29 16:40 鞠强 阅读(557) 评论(2) 编辑 收藏

 回复 引用 查看   
#1楼[楼主]2008-04-29 16:42 | 鞠强      
There's two problems here:

1. There's some sort of interop problem you're hitting where the .Net
wrapper code that it's generating isn't coming out right for some reason;
maybe the typelibrary info in rule.dll is broken, maybe it's just .net
being unhappy. There's no good way around this other than doing the
IDispatch calls by hand.

2. rule.dll wraps Extended MAPI, and Extended MAPI and .Net don't mix
nicely, so even if you did get it to work, you could hit threading
problems, general runtime pain, etc:

http://support.microsoft.com/kb/813349

Solution: don't use a .Net language, use classic Visual
Basic/C++/Delphi/whatever.

 回复 引用 查看   
#2楼2008-05-17 21:46 | lbq1221119      
个人感觉123都不是很好的解决方案..4不懂是那个代理是干嘛的..
exchange就读过存储和转发的原理..

hello

world