Windows 2003 發行時直接在系統中加上了 POP3 Service 的功能,讓許多人使用一台 Server 就可以架不同功能的伺服器,而且它也支援了多 Domain 的功能,讓你可以在一台郵件伺服器中支援多組 Domain,管理上也方便許多。但由於它是一個陽春版的服務程式,有許多功能都作不到,像是 Mail Server 中常用到的 Forward(自動轉寄),以及 Alias 等等的功能。這篇文章可以用來解決類似這樣的問題。

故事是這樣的,我有一些 Email 帳號已經使用了很久,常常會有 SPAM Mail 的問題,這個問題已經困擾了我很久,當初在 Linux 下是使用 Spamassassin 加上 Sophos 的 Anit-Virus 功能來進行信件的過濾。在將機器換到 Windows 2003 Server 之後,這些問題又回來了。每天有許多的病毒信件,再加上為數不少的 SPAM。我嘗試在 Outlook 中加上 SpamBays 的 Add-In… 一開始沒甚麼問題,但是當正常信件資料夾中的信件量越來越多,SpamBays 收信及自動過濾的速度變得非常的緩慢。

該是換個收信方法的時候了,我發現 SpyMac 上頭提供了 SPAM 及 Virus Mail 過濾的功能,打算將所有帳號的信先轉到 SpyMac 的服務上,過濾之後我再收下來。但是 SpyMac 並未提供主動自其它 POP Server 收信的功能,我必需在自己各個帳號設定 Forward 的功能轉到 SpyMac 的帳號上。

連線到 HiNET 的 WebMail 想要設定轉寄,發現 HiNET 已經不提供 MTA 的功能了,另外最多 SPAM 的帳號是自己管理的,放在 Windows 2003 的 POP3 Service 上頭,也不提供這個功能 (在 Unix Like 機器上其實只要一個簡單的 .forward 檔放在 home 目錄下)。網路上這個功能的討論文章很少,剛好找到這一篇:

How are you using the Windows 2003 POP3 Server?
http://blogs.msdn.com/dlemson/archive/2004/01/29/64835.aspx

在:
http://blogs.msdn.com/dlemson/archive/2004/01/29/64835.aspx#186236

由 Starseed 發表的文章中提供了一個使用外部工具程式的方法,經過測試可以在 Windows 2003 下使用,也順便把 HiNET 帳號不提供 MTA 功能的問題給解了,日後只要在一個帳號上收信就可以了。至於 SpyMac 的信件過濾效果如何,先觀察幾天後我再另外寫一篇報告上來吧!!

— 補充 —

TEST Day 1:
所有病毒信皆被 SpyMac 的過濾機制濾掉了,160 封信件中再無病毒信。雖廣告信仍會收到,但大多被 SpyMac 的過濾機制加上了 Detection 的提示語。日後可以再找方法自動刪除已包含提示語的信件,最少收信數量已少了三分之一。

[轉貼] 以下為 Starseed 發表的全文:

Forwarding and Aliasing…

A funky but functional way to configure forwarding and aliasing for Windows Server 2003’s POP3 Service.

I’m running with AD, so I have not tested this on a stand-alone server. This method is only recommended for home users or very small businesses without a permanent email infrastructure. To manage something like this in large domain environment would be nearly impossible. But for a few home users it works as well. I’m assuming a relatively experienced users is performing this task.

Open ADUC and create an OU to host your alias users.
You will need to create a child OU for each user and a user object for each alias.
Create a child OU beneath your aliases OU for this username
Add a user object for each alias and set the username to be the alias for that account.

For example, if your user account was juser but you wanted an alias called “John.User” you would set the user name properties to “John.User”. For advanced users, that is the sAMAccountName and userPrincipleName properties.

I find it useful to set the “Full Name” box to the alias name so that it can be easily identified in ADUC. It’s easiest to set the passwords the same for all of the aliases for one particular user.

Now, for the actual work. Configure a folder on your server and lock it down for the SYSTEM account and a service account with elevated priveleges of your choosing. For example C:\Windows\PullMail with Administrator = Full Control

You’ll need to make sure this folder is secured because it will contain passwords.

Go to this site (http://www.swsoft.co.uk/index.asp?page=freesoftware) and download a well-known command line utility called pullmail. If this link is dead, search “pullmail” on google.

Save pullmail to C:\Windows\PullMail.
Read the readme.txt file for complete pullmail syntax
Now create a batch file for each user.
In the batch file, create a line for each alias assigned to a user.
The syntax would look something like this….

C:\utilities\pullmail myserver.mydomain.net [email protected] myPassWord /s:mydomain.net /to:[email protected]
C:\utilities\pullmail myserver.mydomain.net [email protected] myPassWord /s:mydomain.net /to:[email protected]
C:\utilities\pullmail myserver.mydomain.net [email protected] myPassWord /s:mydomain.net /to:[email protected]

So we save this file as :\Windows\PullMail\username.bat

Now create a scheduled task for each username and execute the batch file for their username every few minutes or so.

Make sure to run your tasks as your service account.
This successfully gathers all the email from each alias user and dumps it to one mailbox.
You could do the same thing with forwarding using pullmail.

最後修改日期: 2004-07-24