mail-service
WCF service hosted in IIS that sends emails over SMTP on behalf of estate applications, with address rewriting/blocking policies for non-production and optional SQL logging of sent mail.
Health score
0 to 100 across seven weighted factors; nothing is hidden. Green is 75 and above, amber 50 to 74, red below 50. How scoring works.
Facts
| Languages | csharp |
| Frameworks | WCF, ASP.NET (Web.config/IIS host) |
| Runtimes | .NET Framework 4.7.2, .NET Standard 2.0, .NET Framework 4.6.2 |
| Tests / CI | good / CI in place |
| Last commit | 2026-06-23 |
| Owner | Owner unknown (mapping to be curated) |
| Domain | Customer communications (system generated; curate in repo-owners.json to override) |
| Product area | Shared platform |
| Hosted | On-prem Deployed to our own machines
|
| Releases | 2 release pipeline(s): \ops\mail\mail-service CI; \ops\mail\mail-service stealth |
| Integration | wcf, smtp |
| Source | Open in Azure DevOps |
Dependencies in context
Entanglement
kernel Bound into the core by 3 mechanism(s).
- Pinning dependency: mail-service
- Speaks WCF (host)
- Shares core database sqlserver:EventLog
Detaches when it is itself a binding point: unpinning it releases its consumers; and when its WCF surface gains a modern interface or its WCF calls move to one; and when the shared database group it belongs to gains an owned API or completes schema separation (sqlserver:EventLog).
This repo is itself a binding point: see what cutting it unlocks.
Capability duplication
Part of the Mail sending family (retire): Legacy WCF mail path; 21 dependents still route through it
Migration playbooks
Generated from this repo's assessment data: what is feasible, what blocks it, and the steps in order. Ratings: green means actionable now, amber means sequence other work first, red means blocked, grey means not applicable.
ZDD adoption
Not applicableNot a deployed service (libraries, database definitions, desktop apps) or a retirement candidate not worth the investment. Retirement or consolidation candidate; do not invest in ZDD adoption.
SQL Server exit
Retire insteadThis repo is a retirement or consolidation candidate. Do not invest in a database migration; execute the retirement and the SQL Server dependency disappears with it.
Containerisation
Retire insteadThis repo is a retirement or consolidation candidate; containerising it would be investment in something we intend to switch off.
Recommended actions
Retire mail-service
Legacy WCF mail path; 21 dependents still route through it. Part of the Mail sending consolidation: Complete the notifications migration so phenix-notifications-api delivers without the WCF pair, then retire mail-service and mailtemplate-service. This is one of the stage 2 binding-point cuts.
Impact: A migration never paid for, a pipeline decommissioned and an attack surface removed
proposedComplete the notifications migration and retire mail-service
21 dependents still send mail through this WCF service. phenix-notifications-api was built to replace it; finish that migration.
Impact: Highest leverage in the programme: releases consumers without touching them
proposedAssessment notes
mail-service
Purpose
Central mail-sending WCF service (IMailServiceContract.Send). Consumers install the TC.Mail.ServiceContract/TC.Mail.ServiceClient NuGet packages and call it via the connection broker. It converts messages, applies decorator policies (blocking or rewriting recipients outside production), sends via System.Net.Mail/SMTP, and optionally logs sends to SQL.
Tech stack
The host (TC.Mail.ServiceHost) and core service (TC.Mail.Service) are old-style .NET Framework 4.7.2 projects built with MSBuild/VS 17 and deployed to IIS. The contract and client are SDK-style projects multi-targeting net462 and netstandard2.0, published as NuGet packages. SMTP target comes from Web.config transforms (smtp.travelcounsellors.com in production, localhost:2500 in dev).
Deployment
Included with 2 releases: build pipeline mail-service plus release pipelines \ops\mail\mail-service CI and \ops\mail\mail-service stealth. YAML CI (build.yml) uses shared InternalOSS/azure-pipelines-templates, building the NuGet packages with .NET SDK 8.x and the IIS host with Visual Studio.
Dependencies
Internal: tc-connectionbroker (IWcfConnectionBroker for clients, ISqlConnectionBroker for the logger). No third-party SaaS dependencies; email egress is via the internal SMTP relay.
Data stores
SQL Server EventLog database, resolved through the connection broker, used by SqlMailLogger when a message has the LogEmail flag.
Integration points
Inbound WCF (SOAP) endpoint MailServiceHost.svc; outbound SMTP. Client package is consumed by many estate apps.
Code health
Good unit test suite (tests/UnitTests, ~10 test classes covering rewriting, blocking, conversion and address preservation) plus a manual test client tool. Active repo (last commit 2026-06-23) with modern YAML CI and a thorough README.
Modernisation risks
The service host is stuck on .NET Framework 4.7.2 because of WCF, and IIS hosting ties it to Windows infrastructure. As a hub service consumed across the estate, migrating it (e.g. to CoreWCF or a REST API) affects many callers, which is why it rates high priority despite healthy code quality.