{"id":1947,"date":"2009-06-20T09:51:01","date_gmt":"2009-06-20T07:51:01","guid":{"rendered":"http:\/\/www.corelan.be:8800\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/"},"modified":"2009-06-20T09:51:01","modified_gmt":"2009-06-20T07:51:01","slug":"exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent","status":"publish","type":"post","link":"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/","title":{"rendered":"Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent"},"content":{"rendered":"<p>It may sound a bit extraordinary, but I needed to have the ability to change attachment filenames while they were being processed by the transport service on Exchange. I can\u2019t really tell you why I needed this functionality, but I guess there could be many reasons to do so. (e.g. zip files should be renamed to .zip.renamed\u00a0 so they need to be saved to disk first, renamed and then opened, and so on).\u00a0 Anyways, I could not find a way to do this with the Exchange built-in features, so I had to write my own custom transport agent to do this.<\/p>\n<p>The agent is written in C#, uses .Net Framework 3.5, uses the native MS Exchange API\u2019s and works fine with Exchange 2007 (I\u2019ve only tested SP1) and 2010 (beta 1). The dll has been compiled for x64 (64bit) systems only.<\/p>\n<h3>Putting the files in place<\/h3>\n<p>You can download the dll file from the link below. (As usual, you need to be logged in to download the file)<\/p>\n<p>[download id=\"19\"]19[\/download]<\/p>\n<p>This transport agent needs to be installed on all HUB transport servers in the organization, so the following procedure needs to be executed on all HUB transport servers :<\/p>\n<h4>1. Create folder structure<\/h4>\n<p>Create a folder called \u201cpveattachrename\u201d on drive C: (yes, it needs to be drive C:, and yes the folder needs to have this name)<\/p>\n<p>In this '\u201dpveattachrename\u201d folder, create the following subfolders :<\/p>\n<ul>\n<li>bin<\/li>\n<li>config<\/li>\n<li>rules<\/li>\n<li>log<\/li>\n<li>temp<\/li>\n<\/ul>\n<p><a href=\"\/wp-content\/uploads\/2009\/06\/image.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/06\/image_thumb.png\" border=\"0\" alt=\"image\" width=\"370\" height=\"156\" \/><\/a><\/p>\n<p>(The 2 last folders : \u2018log\u2019 and \u2018temp\u2019 are the only folders that could grow in size (well, in fact, the log folder could grow, the temp folder is used to temporarily save attachments, but all temp files should get cleaned after processing an email). You will be able to move these 2 folders to another location. I\u2019ll explain you how to do this later on).<\/p>\n<p>Extract the downloaded dll file in the bin folder.<\/p>\n<h4>2. Set security on folder structure<\/h4>\n<p>The Exchange transport agent will run with \u201cNetwork Service\u201d permissions and needs to be able to read from the bin\/config\/rules folders, and write into the pveattachrename, the log and the temp folders. The easiest way to set the permissions is by allowing Network Service to read and write in the entire \u201cpveattachrename\u201d folder (and subfolders of course)<\/p>\n<p><a href=\"\/wp-content\/uploads\/2009\/06\/image1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/06\/image_thumb1.png\" border=\"0\" alt=\"image\" width=\"242\" height=\"279\" \/><\/a><\/p>\n<h3>Transport agent configuration<\/h3>\n<h4>1. Set application configuration parameters<\/h4>\n<p>In the config folder, create a file called config.cfg<\/p>\n<p>This file can contain 3 configuration entries :<\/p>\n<ul>\n<li>verbose=true\u00a0 ( or\u00a0 verbose=false)<\/li>\n<li>workingfolder= &lt;path to the temp folder&gt;<\/li>\n<li>logfolder=&lt;path to the log folder&gt;<\/li>\n<\/ul>\n<p>The \u201cworkingfolder\u201d and \u201clogfolder\u201d entries are optional. If you don\u2019t specifiy anything, the logfiles will be written to c:\\pveattachrename\\log and the temp folder will be c:\\pveattachrename\\temp.\u00a0 If you decide to move the log and\/or temp folders, make sure to grant the \u201cNetwork Service\u201d account read\/write permissions to these folders. If you do specify a workingfolder or logfolder entry, don\u2019t set a slash at the end of the path.<\/p>\n<p>If you set verbose to true, you will be able to see - in detail - what happens when the transport agent functions are called.\u00a0 This is a good way to troubleshoot issues, but the logfiles can grow quite large.\u00a0 The log files will rotate every week, and log files older than 6 months should get removed automatically.\u00a0 If you set verbose to false, only application errors will be written into the log files.<\/p>\n<p><em>(Note : keep everything in lowercase, and don\u2019t use spaces before and after the = symbol)<\/em><\/p>\n<p>Example :<\/p>\n<div>\n<pre style=\"font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;\">verbose=<span style=\"color: #0000ff;\">true<\/span>\nworkingfolder=e:\\pverenametemp\nlogfolder=d:\\pverenamelog<\/pre>\n<\/div>\n<h4>2. Create rules<\/h4>\n<p>In the rules folder, you can create as many rule files as you want.\u00a0 A rule file is a file that has extension .rule, and contains the following entries :<\/p>\n<ul>\n<li>extension=<\/li>\n<li>renameaction=<\/li>\n<li>from=<\/li>\n<\/ul>\n<p>(The \u2018from\u2019 parameter is optional. If you don\u2019t want to use it, just leave it out of the file)<\/p>\n<p><span style=\"text-decoration: underline;\">Extension <\/span>: here you can specify the attachment extension you want to apply the rename action to. You can only specify one attachment filename extension.\u00a0 I recommend to include the . (dot) in the extension. So suppose you want to rename zip files, you need to specify<\/p>\n<p>extension=.zip<\/p>\n<p><span style=\"text-decoration: underline;\">Renameaction :<\/span> With this parameter, you can specify how the renamed attachment should look like. There are a couple of variable that can be used :<\/p>\n<p>%filename% : will be replaced the original filename, without extension<\/p>\n<p>%random% : will be replaced by a 8 character random string<\/p>\n<p>%timestamp% : will be replaced by a date- &amp; timestring that looks like this :\u00a0\u00a0 YYYYMMDD_HHMMSS<\/p>\n<p>%date% : will be replaced by a datestring that looks like this : YYYYMMDD<\/p>\n<p>%time% : will be replaced by a timestring that looks like this : HHMMSS<\/p>\n<p>So suppose you want to rename zip files to .zip.save.me.first, rename the filename and add some random characters to the filename, you need to set the renameaction parameter to :<\/p>\n<p>renameaction=%filename%_renamed_%random%.zip.save.me.first<\/p>\n<p><em>Note : If the new filename becomes longer than 150 characters, only the first 140 characters will be used, and a new random string will be added (to make it unique again). So if you really want to have the original filename at the beginning of the filename, make sure to put %filename% at the beginning of the renameaction<\/em><\/p>\n<p><span style=\"text-decoration: underline;\">From : <\/span>You can specify one keyword (a domain name or email address). Only emails originating from this domain name or email address will be processed by the rule. If you have multiple email addresses or domain names, you\u2019ll have to create multiple rule files.\u00a0 (I may change this in the future, but this is how it works today). If you don\u2019t want to filter on \u201cFrom\u201d email address\/domain name, then don\u2019t set the \u201cfrom\u201d keyword.<\/p>\n<p>Save the file. I usually give the .rule file a filename that reflects the attachment extension inside the .rule file, but if you want to name them 01.rule, 02.rule, or something else\u2026. feel free.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2009\/06\/image2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/06\/image_thumb2.png\" border=\"0\" alt=\"image\" width=\"398\" height=\"132\" \/><\/a><\/p>\n<p>(By the way, make sure to verify that the .rule file is not saved as .rule.txt (and \u2018hide extension for known filetypes\u2019 is turned on). Everything may look ok, but the rules would not be used if they don\u2019t have the .rule extension.<\/p>\n<p>Every time an email is processed by the agent, a new Header is stamped onto the message. This will ensure that an email that is sent across multiple Transport servers will not get processed twice.\u00a0 This header is called X-PVEAttachRename and contains a GUID-alike string.\u00a0 If you have verbose logging enabled, you can use this GUID string to look up what happened to the email in the log file by searching for this string.<\/p>\n<h3>Installing &amp; enabling the agent<\/h3>\n<p>Open MS Exchange Management Shell (Powershell) and run the following cmdlet : (pay attention, case sensitive !)<\/p>\n<div>\n<pre style=\"font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;\">Install-TransportAgent\n   -name <span style=\"color: #006080;\">\"PVE Attachment Rename\"<\/span>\n   -TransportAgentFactory <span style=\"color: #006080;\">\"pveAttachRenameTptAgent.PVEAttachRenameTptAgentFactory\"<\/span>\n   -AssemblyPath C:\\pveattachrename\\bin\\pveAttachRenameTptAgent.dll<\/pre>\n<\/div>\n<p>(put everything on one line !)<\/p>\n<p>The output should look like this :<\/p>\n<p><a href=\"\/wp-content\/uploads\/2009\/06\/image3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/06\/image_thumb3.png\" border=\"0\" alt=\"image\" width=\"528\" height=\"98\" \/><\/a><\/p>\n<p>Close Powershell (This is required to make the agent work). Open Powershell again and restart the Transport service :<\/p>\n<div>\n<pre style=\"font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;\">Restart-Service MSExchangeTransport<\/pre>\n<\/div>\n<p>When the service has restarted, enable the Transport Agent, and restart the MS Exchange Transport Service again :<\/p>\n<div>\n<pre style=\"font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;\">Enable-TransportAgent -id <span style=\"color: #006080;\">\"PVE Attachment Rename\"<\/span>\nRestart-Service MSExchangeTransport<\/pre>\n<\/div>\n<p><a href=\"\/wp-content\/uploads\/2009\/06\/image4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/06\/image_thumb4.png\" border=\"0\" alt=\"image\" width=\"385\" height=\"120\" \/><\/a><\/p>\n<p>The agent is now active.<\/p>\n<h3>Support\/Bugs\/Feedback<\/h3>\n<p>Please use the forum at http:\/\/www.corelan.be:8800\/index.php\/forum\/pve-exchange-attachment-rename-tpt-agent\/ to post your support questions, file bugs or just provide some feedback about the agent.<\/p>\n<p>Thanks for dropping by (again).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It may sound a bit extraordinary, but I needed to have the ability to change attachment filenames while they were being processed by the transport service on Exchange. I can\u2019t really tell you why I needed this functionality, but I guess there could be many reasons to do so. (e.g. zip files should be renamed &hellip; <a href=\"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> \"Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent\"<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[488,349],"tags":[509,484],"class_list":["post-1947","post","type-post","status-publish","format-standard","hentry","category-corelan-free-tools","category-exchange","tag-exchange","tag-free-tool"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent - Corelan | Exploit Development &amp; Vulnerability Research<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent - Corelan | Exploit Development &amp; Vulnerability Research\" \/>\n<meta property=\"og:description\" content=\"It may sound a bit extraordinary, but I needed to have the ability to change attachment filenames while they were being processed by the transport service on Exchange. I can\u2019t really tell you why I needed this functionality, but I guess there could be many reasons to do so. (e.g. zip files should be renamed &hellip; Continue reading &quot;Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/\" \/>\n<meta property=\"og:site_name\" content=\"Corelan | Exploit Development &amp; Vulnerability Research\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/corelanconsulting\" \/>\n<meta property=\"article:published_time\" content=\"2009-06-20T07:51:01+00:00\" \/>\n<meta name=\"author\" content=\"corelanc0d3r\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@corelanc0d3r\" \/>\n<meta name=\"twitter:site\" content=\"@corelanc0d3r\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/06\\\/20\\\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/06\\\/20\\\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\\\/\"},\"author\":{\"name\":\"corelanc0d3r\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/person\\\/3be5542b9b0a0787893db83a5ad68e8f\"},\"headline\":\"Exchange 2007\\\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent\",\"datePublished\":\"2009-06-20T07:51:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/06\\\/20\\\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\\\/\"},\"wordCount\":1216,\"publisher\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#organization\"},\"keywords\":[\"MS Exchange\",\"free tool\"],\"articleSection\":[\"Corelan Free Tools\",\"MS Exchange\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/06\\\/20\\\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\\\/\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/06\\\/20\\\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\\\/\",\"name\":\"Exchange 2007\\\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent - Corelan | Exploit Development &amp; Vulnerability Research\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#website\"},\"datePublished\":\"2009-06-20T07:51:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/06\\\/20\\\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/06\\\/20\\\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/06\\\/20\\\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.corelan.be\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Exchange 2007\\\/2010 : Renaming attachments &lsquo;on the fly&rsquo; &#8211; custom transport agent\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#website\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/\",\"name\":\"Corelan CyberSecurity Research\",\"description\":\"Corelan publishes in-depth tutorials on exploit development, Windows exploitation, vulnerability research, heap internals, reverse engineering and security tooling used by professionals worldwide.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.corelan.be\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#organization\",\"name\":\"Corelan CyberSecurity Research\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/corelanlogo2_small-20.png\",\"contentUrl\":\"https:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/corelanlogo2_small-20.png\",\"width\":200,\"height\":200,\"caption\":\"Corelan CyberSecurity Research\"},\"image\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/corelanconsulting\",\"https:\\\/\\\/x.com\\\/corelanc0d3r\",\"https:\\\/\\\/x.com\\\/corelanconsulting\",\"https:\\\/\\\/instagram.com\\\/corelanconsult\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/person\\\/3be5542b9b0a0787893db83a5ad68e8f\",\"name\":\"corelanc0d3r\",\"pronouns\":\"he\\\/him\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x\",\"caption\":\"corelanc0d3r\"},\"description\":\"Peter Van Eeckhoutte is the founder of Corelan and a globally recognized expert in exploit development and vulnerability research. With over two decades in IT security, he built Corelan into a respected platform for deep technical research, hands-on training, and knowledge sharing. Known for his influential exploit development tutorials, tools, and real-world training, Peter combines a strong research mindset with a passion for education\u2014helping security professionals understand not just how exploits work, but why.\",\"sameAs\":[\"https:\\\/\\\/www.corelan-training.com\",\"https:\\\/\\\/instagram.com\\\/corelanc0d3r\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/petervaneeckhoutte\\\/\",\"https:\\\/\\\/x.com\\\/corelanc0d3r\"],\"url\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/author\\\/admin0\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent - Corelan | Exploit Development &amp; Vulnerability Research","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/","og_locale":"en_US","og_type":"article","og_title":"Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent - Corelan | Exploit Development &amp; Vulnerability Research","og_description":"It may sound a bit extraordinary, but I needed to have the ability to change attachment filenames while they were being processed by the transport service on Exchange. I can\u2019t really tell you why I needed this functionality, but I guess there could be many reasons to do so. (e.g. zip files should be renamed &hellip; Continue reading \"Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent\"","og_url":"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/","og_site_name":"Corelan | Exploit Development &amp; Vulnerability Research","article_publisher":"https:\/\/www.facebook.com\/corelanconsulting","article_published_time":"2009-06-20T07:51:01+00:00","author":"corelanc0d3r","twitter_card":"summary_large_image","twitter_creator":"@corelanc0d3r","twitter_site":"@corelanc0d3r","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/#article","isPartOf":{"@id":"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/"},"author":{"name":"corelanc0d3r","@id":"https:\/\/www.corelan.be\/#\/schema\/person\/3be5542b9b0a0787893db83a5ad68e8f"},"headline":"Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent","datePublished":"2009-06-20T07:51:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/"},"wordCount":1216,"publisher":{"@id":"https:\/\/www.corelan.be\/#organization"},"keywords":["MS Exchange","free tool"],"articleSection":["Corelan Free Tools","MS Exchange"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/","url":"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/","name":"Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; - custom transport agent - Corelan | Exploit Development &amp; Vulnerability Research","isPartOf":{"@id":"https:\/\/www.corelan.be\/#website"},"datePublished":"2009-06-20T07:51:01+00:00","breadcrumb":{"@id":"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.corelan.be\/index.php\/2009\/06\/20\/exchange-20072010-renaming-attachments-on-the-fly-custom-transport-agent\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.corelan.be\/"},{"@type":"ListItem","position":2,"name":"Exchange 2007\/2010 : Renaming attachments &lsquo;on the fly&rsquo; &#8211; custom transport agent"}]},{"@type":"WebSite","@id":"https:\/\/www.corelan.be\/#website","url":"https:\/\/www.corelan.be\/","name":"Corelan CyberSecurity Research","description":"Corelan publishes in-depth tutorials on exploit development, Windows exploitation, vulnerability research, heap internals, reverse engineering and security tooling used by professionals worldwide.","publisher":{"@id":"https:\/\/www.corelan.be\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.corelan.be\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.corelan.be\/#organization","name":"Corelan CyberSecurity Research","url":"https:\/\/www.corelan.be\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.corelan.be\/#\/schema\/logo\/image\/","url":"https:\/\/www.corelan.be\/wp-content\/uploads\/2026\/03\/corelanlogo2_small-20.png","contentUrl":"https:\/\/www.corelan.be\/wp-content\/uploads\/2026\/03\/corelanlogo2_small-20.png","width":200,"height":200,"caption":"Corelan CyberSecurity Research"},"image":{"@id":"https:\/\/www.corelan.be\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/corelanconsulting","https:\/\/x.com\/corelanc0d3r","https:\/\/x.com\/corelanconsulting","https:\/\/instagram.com\/corelanconsult"]},{"@type":"Person","@id":"https:\/\/www.corelan.be\/#\/schema\/person\/3be5542b9b0a0787893db83a5ad68e8f","name":"corelanc0d3r","pronouns":"he\/him","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x","url":"https:\/\/secure.gravatar.com\/avatar\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x","caption":"corelanc0d3r"},"description":"Peter Van Eeckhoutte is the founder of Corelan and a globally recognized expert in exploit development and vulnerability research. With over two decades in IT security, he built Corelan into a respected platform for deep technical research, hands-on training, and knowledge sharing. Known for his influential exploit development tutorials, tools, and real-world training, Peter combines a strong research mindset with a passion for education\u2014helping security professionals understand not just how exploits work, but why.","sameAs":["https:\/\/www.corelan-training.com","https:\/\/instagram.com\/corelanc0d3r","https:\/\/www.linkedin.com\/in\/petervaneeckhoutte\/","https:\/\/x.com\/corelanc0d3r"],"url":"https:\/\/www.corelan.be\/index.php\/author\/admin0\/"}]}},"views":10183,"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts\/1947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/comments?post=1947"}],"version-history":[{"count":0,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts\/1947\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/media?parent=1947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/categories?post=1947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/tags?post=1947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}