Still Warning Free, Emails and MetaWeblogIntegrated
Over the last week since I went warning free, my Community Server build has mostly been working well. The only problem that I've noticed is that emails stopped appearing whenever new comments were posted.
Things looked fine as far as I could tell, but something about going warning free and .net 2.0 native for the email objects were obviously doing weird. The strangest part is that emails were sending fine form my local build, just not on the live site - and it really looked like that the error was on the delivery end, not the sending (the error message was that GMail was reporting no such user for both my and my wife's email addresses.
A lot of playing around and I discovered that the problem wasn't the TO address, but the FROM. WebHost4Life's email server seems to require that the from address be valid too, and in my playing around I'd corrupted it - instead of sending from admin@crankygoblin.com, it was sending from adminemail@crankygoblin.com. Oops :) I fixed it, and emails are sending again.
On top of that, an update for the MetaWeblog API came out from Telligent, giving support finally for the newMediaObject call - which means clients like Live Writer can upload images on the fly as part of posting a new blog entry.
The release was built specifically to be deploy live to server without needing a rebuild, but since I run my own codebase I thought that tighter integration was better, and merged all the code for it inline into the existing source (in CommunityServerBlogs/Server/MetaWeblog.cs). I'd been working on my own version in this class anyway, but never got around to finishing it - so I threw my code away, pasted in theirs, and all was almost good. The config settings as it exists is a hack, so I integrated them from the web.config to the communityserver.config file, and extended the WeblogConfiguration class to be obtain the values for the settings strongtyped, instead of ConfigurationManager.AppSettings.
I also tidied up some of the code that Telligent provided - some of the code that dealt with file paths was looking for slashes and things, so I moved more of it to use Path.Combine() etc.
Oh, and I extended the 'blogFilesReadPath' and 'blogFilesStoragePath' settings to use subfolders within a blog. I don't like how by default it uploads new files to the root of the users blog, so now you specify the locations like this: '~/blogs/{0}/uploads' and it uses string.Format to create the valid path, instead of concatenating the user's blog folder on the end.
Note to self: when you add extra settings to the WeblogConfiguration object, your custom settings in the communityserver.config file will be ignored when it merges overridden settings from the database, unless you apply the ReadFromConfigurationFileOnlyAttribute to your new properties. Took me ages to debug why the values were always the defaults, even when I saw it read the overridden values from the config file :)
Oh, and as proof that it works, my last post included a picture that was uploaded using newMediaObject :)