My powers of persuasion must be awesome.
Daz! Come back!
June 23, 2009This is an open letter and public shout out to my mate Daz, aka The Dazzler, aka The D-Man, aka D-Dawg,* to return to his former blogging ways.
Daz, I know the lure of Twitter has been too much to turn down, what with it’s simple interface and enforced textual limit that seems so friendly in comparison to the behemoth of the blog… but you had so much good in you that was left unsaid. Sometimes good things need more than 140 chars.
So, come back, ye olde chappe, and speak henceforth those software development words of wisdom!
* Daz may, in fact, not actually be also known as these nicknames.
How to support wildcard email addresses in Exchange 2007
June 10, 2009If you need Exchange to accept wildcard email addresses, e.g.
fred*@domain.com
*fred*@domain.com
so that, for instance, mail sent to “hello_fred_how_are_you@domain.com” is routed to an appropriate mailbox (such as fred@domain.com), then you’ll need to write (as in program) your own Transport Agent.
1. Create your own SMTP receive agent. You’ll need Visual Studio 2005 or above and some programming ability.
2. Hook your agent up to the RcptCommandEventHandler and write the necessary code to examine the event’s RecipientAddress, and, if it meets your wildcard needs, replace the RecipientAddress with the destination mailbox.
E.g.
// If the recipient address contains “fred” then replace
// whatever it is with Fred’s real mailbox address.// Pseudocode:
if (event.RecipientAddress.LocalPart.ToLower().Contains(“fred”))
{
event.RecipientAddress = new RoutingAddress(“fred@domain.com”);
}
(Make sure you understand the implications for spam!)
3. Install your Transport Agent (a DLL) on the Exchange server using the Install-TransportAgent and Enable-TransportAgent cmdlets.
If you get any errors like:
Invalid agent configuration in file
when running the Transport Agent cmdlets, check the permissions on the agents.config file.
C:\Program Files\
Microsoft\Exchange Server\TransportRoles\Shared\agents.config
Temporarily give Full Control to the Everyone object on that file and see if that fixes the problem. If so, remove Everyone and find out who needs access to it!
4. Finally, and very importantly, make sure the priority of your new Transport Agent is lower than the Recipient Filter Agent.
Run the get-transportagent cmdlet to see all the agents and their priorities. Use the set-transportagent cmdlet to change your agent’s priority, and put it lower than the Recipient Filter Agent.
Otherwise the Recipient Filter Agent will execute before your new agent and it will reject the wildcard email addresses since they’re not valid. Your agent, if placed before the Recipient Filter, intercepts these invalid email addresses and changes them to the correct, valid addresses.
Classic programming question
June 8, 2009Hello All -
I need to do this: I need the exchange server to embed an image into each outbound email message, the image size is small (less than 50K).
I need to use a transport agent i have succesfully started up visual studio 2008 and copied the necessary dll files over, the refernces have also been loaded.
however at this point i think i would “Program” which i do not know how to do, is there a programmers manual that would explain in the necessary detail as to how to accomplish tihs?
Please advise…
(Emphasis mine; from here.)
Posted by neilhendo
Posted by neilhendo
Posted by neilhendo