Matt, thanks for the thanks! I really like hMailServer, and am pleased to contribute! I am also pleased that there be folks here to read my rants and keep me going.
Now, I'd rather not have to map the server (and unmap it) for every email, and would rather use a different user account. Problem is that hMailServer needs to run as a service when noone is logged on.
I used IIS SMTP to receive the mails for sharepoint
I don't understand that - SMTP is just for sending mail, no? I do understand that I need the iis6 "virtual server" in order for sharepoint to send mail using hMailserver SMTP (at least, that's how I've gotten it to work).
However, that SMTP drop folder (in inetpug/mail) is exactly where my script is dumping the Sharepoint mail.
I set a route in hMailserver to point to the IP address of that other server.
Matt, could you explain that a little for me?
By the way, to be truly complete, here is my function for sifting for sharepoint-mail.
If I make all the sharepoint-destined mail to be prepended with "portal_" then I have a way to send ONLY sharepoint-destined mail to the dropfolder for transfer.
In this example, I copy the messages to a folder outside hMailserver's data folder, and then transfer it to the other server using the function I showed in the previous post.
'x-sender and x-receiver are necessary for sharepoint
'see also http://weblogs.asp.net/wesleybakker/archive/2010/08/09/configure-hmailserver-for-sharepoint.aspx
SPdropfolder = "c:\hMailServer\sharepointDropFolder\"
SPprefix = "portal_"
dim SPprefixLen, toaddress
toaddress = oMessage.To
if left(toaddress, SPprefixLen) = SPprefix Then
write_log (" Copying mail to Sharepoint Drop Folder")
Dim path, mailfilename, fso, original, mailfile
path = Split(oMessage.Filename, "\", -1, 1)
mailfilename = SPdropfolder & path(UBound(path))
Set fso = CreateObject("Scripting.FileSystemObject")
Set mailfile = fso.CreateTextFile(mailfilename, True)
mailfile.WriteLine("x-sender: " & oMessage.FromAddress)
mailfile.WriteLine("x-receiver: " & oMessage.To)
Set original = fso.OpenTextFile(oMessage.Filename, 1)
SPcopyMessage = CopyFileToRemoteMachine("SERVER", "domain\hMailServer", "password", mailfilename, "\\SERVER\portalmail\drop")
write_log(" Sharepoint Drop Message Status: " & SPcopyMessage)