{"id":23983685,"url":"https://github.com/pro/exchange-catchall","last_synced_at":"2025-07-11T12:40:32.870Z","repository":{"id":12078990,"uuid":"14666499","full_name":"Pro/exchange-catchall","owner":"Pro","description":"Exchange CatchAll Agent","archived":false,"fork":false,"pushed_at":"2021-02-25T15:59:01.000Z","size":13046,"stargazers_count":21,"open_issues_count":9,"forks_count":15,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-14T07:11:45.424Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-24T18:24:00.000Z","updated_at":"2025-03-07T06:49:54.000Z","dependencies_parsed_at":"2022-09-10T06:02:39.325Z","dependency_job_id":null,"html_url":"https://github.com/Pro/exchange-catchall","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Pro/exchange-catchall","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pro%2Fexchange-catchall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pro%2Fexchange-catchall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pro%2Fexchange-catchall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pro%2Fexchange-catchall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pro","download_url":"https://codeload.github.com/Pro/exchange-catchall/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pro%2Fexchange-catchall/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264809890,"owners_count":23667370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-07T12:19:57.477Z","updated_at":"2025-07-11T12:40:32.817Z","avatar_url":"https://github.com/Pro.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Exchange CatchAll Agent [![Build Status](https://travis-ci.org/Pro/exchange-catchall.png?branch=master)](https://travis-ci.org/Pro/exchange-catchall)\r\n=============\r\n\r\nCatchAll Agent for Exchange Server.\r\n\r\nThis code is based on the work of http://catchallagent.codeplex.com/\r\n\r\nYou can define a domain or regex (regular expression) and redirect all E-Mails sent to this domain to forward them to another address.\r\nThis only works if the email is received from an external mail server. Internal mails currently can't be forwarded. See issue [#13](https://github.com/Pro/exchange-catchall/issues/13) for further info.\r\n\r\nUsing MySQL (not required for basic functionality) you get additional features:\r\n- you can block E-Mails sent to specific addresses of such a catchall domain.\r\n- the number of blocked hits will be logged\r\n- each forwarded E-Mail will be logged\r\n\r\n\r\n**Updating to Version \u003e=1.6.0:** Please read the following section before updating: [Updating to Version 1.6.0](#updating-to-version-160)!\r\n\r\n## Supported versions\r\n\r\nThe .dll is compiled for .NET 3.5 (Exchange 2007 and 2010) or .NET 4 (Exchange 2013 \u0026 2016)\r\n\r\n* Exchange 2007 SP3     (8.3.*)\r\n* Exchange 2010         (14.0.*)\r\n* Exchange 2010 SP1     (14.1.*)\r\n* Exchange 2010 SP2     (14.2.*)\r\n* Exchange 2010 SP3     (14.3.*)\r\n* Exchange 2013         (15.0.516.32)\r\n* Exchange 2013 CU1     (15.0.620.29)\r\n* Exchange 2013 CU2     (15.0.712.24)\r\n* Exchange 2013 CU3     (15.0.775.38)\r\n* Exchange 2013 SP1     (15.0.847.32)\r\n* Exchange 2013 CU5     (15.0.913.22)\r\n* Exchange 2013 CU6     (15.0.995.29)\r\n* Exchange 2013 CU7     (15.0.1044.25)\r\n* Exchange 2013 CU8     (15.0.1076.9)\r\n* Exchange 2013 CU9     (15.0.1104.5)\r\n* Exchange 2013 CU10    (15.0.1130.7)\r\n* Exchange 2013 CU11    (15.0.1156.6)\r\n* Exchange 2013 CU12    (15.0.1178.4)\r\n* Exchange 2013 CU13    (15.0.1210.3)\r\n* Exchange 2013 CU14    (15.0.1236.3)\r\n* Exchange 2013 CU15    (15.0.1263.5)\r\n* Exchange 2016 Preview (15.1.225.17)\r\n* Exchange 2016 RTM     (15.1.225.42)\r\n* Exchange 2016 CU1     (15.1.396.30)\r\n* Exchange 2016 CU2     (15.1.466.34)\r\n* Exchange 2016 CU3\t    (15.1.544.27)\r\n* Exchange 2016 CU4\t\t(15.1.669.32)\r\n\r\n## Installing the Receive Agent\r\n\r\n1. Download the .zip and extract it e.g. on the Desktop: [Exchange CatchAll Master.zip](https://github.com/Pro/exchange-catchall/archive/master.zip)\r\n2. If you want to use MySQL, then install MySQL Server and execute the commands from `database.sql` to create the corresponding tables (modify the commands if needed). Don't forget to grant permissions to the user.\r\n3. Open \"Exchange Management Shell\" from the Startmenu\r\n4. Execute the following command to allow execution of local scripts (will be reset at last step): `Set-ExecutionPolicy Unrestricted`\r\n5. Cd into the folder where the zip has been extracted.\r\n6. Execute the install script `.\\install.ps1`\r\n7. Follow the instructions. For the configuration see next section.\r\n8. Reset the execution policy: `Set-ExecutionPolicy Restricted`\r\n9. Check EventLog for errors or warnings.\r\n Hint: you can create a user defined view in EventLog and then select \"Per Source\" and as the value \"Exchange CatchAll\"\r\n\r\nMake sure that the priority of the CatchAll Agent is quite high (best is to set it directly after any Antivirus system).\r\nTo get a list of all the Export Agents use the Command `Get-TransportAgent`\r\n\r\nTo change the priority use `Set-TransportAgent -Identity \"Exchange CatchAll\" -Priority 3`\r\n\r\nIf you have any problems installing, please check out the [troubleshooting guideline](https://github.com/Pro/exchange-catchall/blob/master/TROUBLESHOOT.md)\r\n \r\n### Configuring the agent\r\nEdit the .config file to fit your needs.\r\n\r\nThe `domainSection` defines the CatchAll domains.\r\nThe destination address must be handled by the local exchange server and cannot be an external E-Mail address. Don't forget to add the cathch all domain to Exchange.\r\nThe Agent first checks if the recipient address is assigned to an existing user. If not, it checks if the address should be rewritten by the agent to a catchall address.\r\n\r\nThe `customSection` defines different application settings:\r\n\r\n* `database`: the settings for MySQL logging and blocked check. If you don't need it, set `enabled` to false. Currently only `mysql` is supported but feel free to create a pull request for other databases.\r\n* `general`: Set LogLevel (See Logging section below). Enable/Disable 'X-OrigTo' header by setting `AddOrigToHeader` accordingly. `RejectIfBlocked` defines, if a blocked E-Mail address in MySQL causes a '550 5.1.1 Recipient rejected' response.\r\n\r\n```xml\r\n    \u003cdomainSection\u003e\r\n      \u003c!-- Domain name comparison and the regex are case insensitive! --\u003e\r\n      \u003cDomains\u003e\r\n         \u003c!-- Redirect all E-Mail sent to an address with domain example.com to you@example.org --\u003e\r\n        \u003cDomain name=\"example.com\" regex=\"false\" address=\"you@example.org\"/\u003e\r\n        \u003c!-- Use a regex to redirect. Redirects all mails to *@*.cathcall.com to *@example.org \r\n        E.g. addr@bar.catchall.com -\u003e bar@example.org\r\n        or xxx@sub.catchall.com -\u003e sub@example.org        \r\n        --\u003e\r\n        \u003cDomain name=\"^.*@(.*)\\.catchall.com$\" regex=\"true\" address=\"$1@example.org\"/\u003e\r\n      \u003c/Domains\u003e\r\n    \u003c/domainSection\u003e\r\n    \u003ccustomSection\u003e\r\n      \u003c!-- LogLevel: 0 = off, 1 = error, 2 = error+warn, 3 = all\r\n          AddOrigToHeader: Enable/Disable 'X-OrigTo' header\r\n          RejectIfBlocked: If recipient blocked in database, directly send error to sender. Otherwise the address will be handled by Exchange which then decides the action.\r\n      --\u003e\r\n      \u003cgeneral LogLevel=\"3\" AddOrigToHeader=\"true\" RejectIfBlocked=\"false\"/\u003e\r\n      \u003c!-- Database settings.\r\n      enabled: enable/disable database logging/block checking\r\n      type: mysql, mssql\r\n\t  connectionstrings: Use this page for additional information: https://www.connectionstrings.com\r\n      --\u003e\r\n      \u003cdatabase enabled=\"true\" type=\"mysql\" connectionstrings=\"SERVER=localhost;PORT=3306;UID=catchall;PWD=catchall;DATABASE=catchall;\"/\u003e\r\n    \u003c/customSection\u003e\r\n```\r\n\r\n\r\n#### Logging\r\nThe CatchAll agent logs by default all errors and warnings into EventLog.\r\nYou can set the LogLevel in the .config file:\r\n\r\nPossible values:\r\n* 0 = no logging\r\n* 1 = Error only\r\n* 2 = Warn+Error\r\n* 3 = Info+Warn+Error\r\n\r\n\r\n## Updating the Transport Agent\r\n\r\nIf you want to update the Exchange CatchAll Transport Agent simply re-download the .zip file and follow the steps in the installation section.\r\n\r\n### Updating to Version 1.6.0\r\n\r\nIf you have a version prior to 1.6.0 installed and are updating the CatchAll Agent please change the following line in you config file:\r\n\r\n```\r\n\u003cdatabase enabled=\"true\" type=\"mysql\" host=\"localhost\" port=\"3306\" database=\"catchall\" user=\"catchall\" password=\"catchall\"/\u003e\r\n```\r\nto\r\n```\r\n\u003cdatabase enabled=\"true\" type=\"mysql\" connectionstrings=\"SERVER=localhost;PORT=3306;UID=catchall;PWD=catchall;DATABASE=catchall;\"/\u003e\r\n```\r\n\r\nAdditional Information on Connection Strings for MySQL can be found here: https://www.connectionstrings.com/mysql/\r\n\r\nYou also need to rename the Database Table `cought` into `caught` and the column `idCought` to `idCaught`:\r\n\r\n```\r\nRENAME TABLE cought TO caught;\r\nALTER TABLE caught CHANGE idCought idCaught int(11) NOT NULL AUTO_INCREMENT;\r\n```\r\n\r\n## Uninstalling the Transport Agent\r\n\r\nFollow the install instructions but execute `.\\uninstall.ps1` instead.\r\n\r\n## Notes for developers\r\n\r\n### Required DLLs for developing\r\n\r\nIt isn't allowed to distribute the .dll required for development of this transport agent.\r\nhttp://blogs.msdn.com/b/webdav_101/archive/2009/04/02/don-t-redistribute-product-dlls-unless-you-know-its-safe-and-legal-to-do-so.aspx\r\n\r\nTherefore you have to copy all files from \r\n\u003cpre\u003e\r\nC:\\Program Files\\Microsoft\\Exchange Server\\V14\\Public\r\nMicrosoft.Exchange.Data.Common.dll\r\nMicrosoft.Exchange.Data.Common.xml\r\nMicrosoft.Exchange.Data.Transport.dll\r\nMicrosoft.Exchange.Data.Transport.xml\r\n\u003c/pre\u003e\r\ninto the corresponding subdirectory from the Lib directory of this project.\r\n\r\n#### Debugging\r\nIf you want to debug the .dll on your Exchange Server, you need to install [Visual Studio Remote Debugging](http://msdn.microsoft.com/en-us/library/vstudio/bt727f1t.aspx) on the Server.\r\n\r\n1. After the Remote Debugging Tools are installed on the Server, open Visual Studio\r\n2. Compile the .dll with Debug information\r\n3. Copy the recompiled .dll to the server\r\n4. In Visual Studio select Debug-\u003eAttach to Process\r\n5. Under 'Qualifier' input the server IP or Host Name\r\n6. Select \"Show processes from all users\"\r\n7. Select the process `EdgeTransport.exe` and then press 'Attach'\r\n8. When reached, the process should stop at the breakpoint\r\n\r\n## Changelog\r\n\r\n* 22.12.2016 [1.6.9]:  \r\n    - New: Support for Exchange 2013 CU14, CU15 and 2016 CU4\r\n\r\n* 25.09.2016 [1.6.8]:  \r\n    - New: Support for Exchange 2016 CU3\r\n\r\n* 01.08.2016 [1.6.7]:  \r\n    - New: Support for Exchange 2013 SP1 CU13 \u0026 Exchange 2016 CU2\r\n\t\r\n* 24.04.2016 [1.6.6]:  \r\n    - Fix: Use MySQL charset for better unicode support: utf8mb4  \r\n\r\n* 29.03.2016 [1.6.5]:  \r\n    - New: Support for Exchange 2013 SP1 CU11, CU12 \u0026 Exchange 2016 CU1  \r\n\t\r\n* 01.11.2015 [1.6.4]:  \r\n    - New: Support for Exchange 2013 SP1 CU10 \u0026 Exchange 2016 RTM  \r\n\t\r\n* 09.09.2015 [1.6.3]: \r\n\t- New: Support for all current Exchange Versions \r\n    - Fix: Install script now unlocking files (#8)  \t\r\n\t\r\n* 11.03.2014 [1.6.2]:  \r\n    - Fixed Issue #7 (Exchange 2013 Null Pointer if database disabled)\r\n\r\n* 10.03.2014 [1.6.0]:  \r\n\t- Added MSSQL database support (Thanks to @AlexLaroche)\r\n\t- Fixed Issue #3 (Same message ID's in Dictionary for Orig-To Header)\r\n\r\n* 24.01.2014 [1.5.2]:  \r\n\t- Fixed database disable config (not correctly evaluated)\r\n\t- Added additional supported Exchange versions (2007, 2010, 2013)\r\n\r\n* 27.11.2013 [1.5.1]:  \r\n\t- Support for regex domains\r\n\r\n* 25.11.2013 [1.5.0.0]:  \r\n\t- Added custom X-OrigTo header.\r\n\t- Added install and uninstall script.\r\n\t- Added build for all Exchange 2010 Versions with different SPs.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpro%2Fexchange-catchall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpro%2Fexchange-catchall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpro%2Fexchange-catchall/lists"}