惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
Malwarebytes
Malwarebytes
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
F
Future of Privacy Forum
C
Cisco Blogs
T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
S
Securelist
K
Kaspersky official blog
S
Schneier on Security
T
ThreatConnect
T
Tenable Blog
Spread Privacy
Spread Privacy
T
True Tiger Recordings
AWS News Blog
AWS News Blog
F
Fox-IT International blog
量子位
T
Threatpost
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
Cisco Talos Blog
Cisco Talos Blog
GbyAI
GbyAI
宝玉的分享
宝玉的分享
腾讯CDC
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
Cyberwarzone
Cyberwarzone
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
U
Unit 42
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
The Register - Security
The Register - Security
MyScale Blog
MyScale Blog
小众软件
小众软件
A
About on SuperTechFans
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
美团技术团队
Google Online Security Blog
Google Online Security Blog
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog

DEV Community

Everbench: A document management system with Local Intelligence The Hidden Features of Claude How I Built an AI News Brief with Next.js, Supabase, Vercel, and GPT-4o-mini How We Built a Multi-Agent AI Documentation System (And What We Learned) I got tired of writing post-mortems — so I built RCAi for SREs MIA: A Futuristic AI Desktop Assistant Built with Voice, Gestures, and Controlled Chaos Best Programming Language for Backend Web Development: PHP vs Python PayPal Alternatives for Indian Businesses: Best Payment Gateways for International Card Payments (2026) Gemma 4 Made Me Rethink Local AI: Not Just Text, But Images Too Clean Architecture in .NET Explained (The Dependency Rule) I Compiled Rust to WebAssembly and Made My JavaScript 6 Faster Conditional Statements and Control Flow in Python Insults & Cutlasses, Local LLM Sword Fighting on Melee Island Production Lab: ECS Fargate + Prometheus + Grafana + Loki + Alloy + Node Exporter How 12 AI agent frameworks handle human approval (most badly) The Four-Index Reality: Why AI Search Isn't One Thing I Scanned 1 Million AI Services. Here's What Worries Me More Than the Vulnerabilities Managing multiple docker hub accounts using docker-use System Design Interview: Decentralized Web Crawler Metric Cardinality: High or Low? 4 Steps to Making the Right Choice 로컬 LLM 셋업 가이드 (v23) GEO vs SEO in 2026 — What Google's May Guidance Changed Cursor Review 2026 — Honest 'Not For Me' Take From a VSCode User Hello from rikuq — a practitioner blog for solo AI SaaS founders Why DevOps Engineers Need Practical Tutorials, Not Just Theory AI Agents in CI/CD: Give Them Context, Not Production Authority Now I See Why Translators Are Panicking Over AI—Should Coders Panic Too? Why I Track HRV Every Morning (And How It Actually Changes My Day) Diffusion Language Models: How NVIDIA's Nemotron-Labs DLM Is Killing Token-by-Token Generation Chatbots GPT pour le support client : ce que les équipes françaises ont réellement besoin de savoir I Hit the 1,232-Byte Wall So You Don't Have To Google Just Rebuilt the Search Box (Again) — But This Time It's Different Aether: A local Android assistant built with Gemma 4 BoxAgnts Introduction (1) — Out of the Box mkdev: trusted HTTPS for localhost, mapped by name Just one question, one answer. Why Java Still Rules the Programming World in 2026 Four Architectures for Letting Claude Edit Elementor (and Why We Shipped Clone-and-Mutate) yard-yaml 0.1.1: safer UTF-8 handling for YAML documentation I Built a Mac App That Keeps Your Clipboard in Sync Across All Your Android Devices Stop Using UUIDs: Why B2B SaaS Needs ULIDs in Laravel 🐘 I'm a non-technical founder who built a Slack approval tool. Here's what actually broke first. Open-Sourcing Our Game AI Stack — SDKs, Templates, and CLI Tools for NPC Dialogue I Built an AI System That Makes 1,000 Decisions a Day. Here's Where I Drew the Line. Lets Encrypt DNS Challenge with Traefik and AWS Route 53 Building an agent-ready website: how to make your site readable for ChatGPT, Perplexity and autonomous agents A productivity tool with GitHub as your cloud database How We Built Dynamic NPC Dialogue with LLMs — Lessons from Early Access cmux: The Native macOS Terminal Built for Running AI Coding Agents in Parallel Deep Atlantic Storage: Rewriting in Rust How I Built a Bulk Image Optimizer with $0 Server Costs Using Vanilla JS and Canvas API Humans and Machines read differently, I think I have a fix? Claude Code Deleted 92 Images Without Asking. This Happens More Than You Think. Method Calling Stack in Java I Built Schedule Sensei & Pushed It to GitHub – Here's What's Inside (And I Need Your Help 👀) OIC: From a Working Toast Watcher to a General "Watch It for Me" Agent Memory is two-thirds of what an AI chip costs to build The XState persistence problem is five years old. Here is what we built to finally solve it. i added MCP support to my SaaS in an afternoon. here's the whole thing. Framework: Link Building ☁️ Importing existing S3 buckets into Terraform state made easy with terraform import existing s3 bucket I Built a Token System on Solana (Without Any Backend Code) 터미널 AI 에이전트 구축 (v21) I Built an AI 3D Model Generator — Here's How I Handle Meshes in the Browser 🛡️ PromptGuard: I Built a Local AI Privacy Firewall That Sanitizes Your Prompts Before They Leave Your Machine PostgreSQL WAL Bloat: Why Automatic Management Is Often Insufficient? Seven PRs Before Lunch: Parallel Claude Code Tabs Plus Audit-Before-Bump Deployment using all three Kubernetes probes Qwen 3.6 Has Four Tiers. Here's How to Route Without Burning Cash. RAG 시스템 실전 구축 (v21) How I handle my errors in PHP The Blind Spot in Treasure Hunt Engine Configuration: Long-Term Server Health Run NVIDIA NIM on Your Own GPU — Same API, Different Endpoint Webflow SEO Implementation 로컬 LLM 셋업 가이드 (v21) How Logs Travel From Your EKS Pod to Datadog 𝗦𝘁𝗼𝗽 𝗖𝗿𝗮𝗺𝗺𝗶𝗻𝗴 𝗙𝗼𝗿 𝗘𝘅𝗮𝗺𝘀, 𝗦𝘁𝗮𝗿𝘁 𝗕𝘂𝗶𝗹𝗱𝗶𝗻𝗴 𝗥𝗲𝗮𝗹 𝗦𝗸𝗶𝗹𝗹𝘀 How to Use EXPLAIN ANALYZE in PostgreSQL: A Visual Guide gRPC Performance: tonic (Rust) vs grpc-go Benchmarked at Scale Hack The Box (HTB): Cap Machine (Full Walkthrough) Visual Search Optimization studygemma: AI study buddy for CS students Architectural Tradeoffs in Webhook Idempotency and SaaS API Versioning One Open Source Project a Day (No. 75): Understand Anything - The AI Engine That Turns Any Codebase Into an Explorable Knowledge Graph From mock-only-works to real-world-works: 48 hours of reCAPTCHA debugging I built a free music tool AI Talking Avatar Pipelines Broke Our Ad CTR by 3.7% 800G to 400G Breakout: How to Scale 400G Networks with 800G Ports 터미널 AI 에이전트 구축 (v20) Topical Authority Architecture Inside Hermes Agent's Session Memory: What X-Hermes-Session-Id Actually Does How Logs Travel From Your EKS Pod to Datadog The Hidden Journey Inside / Kubernetes Is it safe to connect my bank account to AI? No Room — The World of Aying (8/12) Fossils — The World of Aying (10/12) Familiar Stranger — The World of Aying (9/12) Being Seen — The World of Aying (7/12) [I Ran an AI Agent for 30 Days Straight — Here's the Boring Engineering That Made It Work] Gemma 4: The 128K Multimodal Powerhouse in Your Terminal How to Consolidate Your QA Toolstack: A Practical Buyer's Guide
Outlook.com Is the Final Boss of 'Just Send an Email'
Sagan Market · 2026-05-25 · via DEV Community

Every email project starts with a lie:

"I'll just test it with SMTP real quick."

That was my plan while working on EpicMail.

I wanted a boring, repeatable provider smoke test:

  1. Pick a mailbox provider.
  2. Add host, port, username, and password.
  3. Send one message.
  4. Move on with my life.

Instead, I got a tour of how consumer email providers have slowly turned "send an email" into an authentication archaeology dig.

The three providers I tested were:

  • Gmail
  • iCloud Mail
  • Outlook.com

The surprise was not that OAuth is complicated. Everyone knows OAuth is complicated.

The surprise was how much easier the entire C# provider-testing loop became once I stopped trying to solve OAuth on day one and used app passwords for developer-owned test accounts.

This is not an argument that app passwords are better than OAuth.

It is an argument that they are a fantastic debugging ladder.

But maybe shipping the ladder as the building is not the answer also.

First C# lesson: do not start with System.Net.Mail.SmtpClient

If you are building this in .NET, the first trap is that the built-in class name looks exactly like what you want:

using System.Net.Mail;

var client = new SmtpClient("smtp.example.com");

Enter fullscreen mode Exit fullscreen mode

But Microsoft's own docs say System.Net.Mail.SmtpClient is not recommended for new development because it does not support many modern protocols, and they point developers toward MailKit or other libraries instead.

So for EpicMail-style testing, I reached for MailKit:

dotnet add package MailKit

Enter fullscreen mode Exit fullscreen mode

The boring version of the test looks like this:

using MailKit.Net.Smtp;
using MailKit.Security;
using MimeKit;

public sealed record SmtpSmokeTestOptions(
    string Provider,
    string Host,
    int Port,
    string Username,
    string Secret);

public static async Task SendSmokeTestAsync(
    SmtpSmokeTestOptions options,
    string recipient,
    CancellationToken cancellationToken = default)
{
    var message = new MimeMessage();
    message.From.Add(MailboxAddress.Parse(options.Username));
    message.To.Add(MailboxAddress.Parse(recipient));
    message.Subject = $"EpicMail smoke test: {options.Provider}";
    message.Body = new TextPart("plain")
    {
        Text = "If this arrived, SMTP is alive."
    };

    using var client = new SmtpClient
    {
        Timeout = 15_000
    };

    await client.ConnectAsync(
        options.Host,
        options.Port,
        SecureSocketOptions.StartTls,
        cancellationToken);

    await client.AuthenticateAsync(
        options.Username,
        options.Secret,
        cancellationToken);

    await client.SendAsync(message, cancellationToken);

    await client.DisconnectAsync(quit: true, cancellationToken);
}

Enter fullscreen mode Exit fullscreen mode

That is the code I wanted the entire project to feel like.

A tiny abstraction.

A tiny config object.

A tiny smoke test.

And then reality showed up.

The provider matrix I wanted

For a developer-owned test account, the provider table feels like it should be this simple:

Provider SMTP host Port Credential path for smoke testing
Gmail smtp.gmail.com 587 Google app password
iCloud Mail smtp.mail.me.com 587 Apple app-specific password
Outlook.com smtp-mail.outlook.com 587 Microsoft app password for the controlled test path; OAuth2/Modern Auth for the product path

As configuration, that becomes extremely boring:

{
  "SmtpSmokeTests": [
    {
      "Provider": "Gmail",
      "Host": "smtp.gmail.com",
      "Port": 587,
      "Username": "you@gmail.com",
      "Secret": "<gmail app password>"
    },
    {
      "Provider": "iCloud",
      "Host": "smtp.mail.me.com",
      "Port": 587,
      "Username": "you@icloud.com",
      "Secret": "<apple app-specific password>"
    },
    {
      "Provider": "Outlook.com",
      "Host": "smtp-mail.outlook.com",
      "Port": 587,
      "Username": "you@outlook.com",
      "Secret": "<microsoft app password or oauth token path>"
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

The protocol part is not the hard part.

The hard part is proving to three giant identity systems that your tiny test harness is not suspicious.

Gmail: the trick is not your normal password

Gmail's SMTP settings are conventional enough: smtp.gmail.com, port 587, STARTTLS, authentication required.

The trick is that the useful test credential is not your normal Google password.

It is a generated app password.

That turns this kind of failure:

535-5.7.8 Username and Password not accepted

Enter fullscreen mode Exit fullscreen mode

into this kind of progress:

250 2.1.5 OK

Enter fullscreen mode Exit fullscreen mode

For a smoke test, that is a massive difference.

No consent screen.

No redirect URI.

No token refresh.

No "is my OAuth app still in testing mode?" rabbit hole.

Just a dev mailbox and a generated credential.

Google's own Gmail client setup docs list smtp.gmail.com, STARTTLS on port 587, and suggest trying an app password when 2-Step Verification is enabled and a mail client cannot sign in.

iCloud Mail: refreshingly literal

iCloud Mail was the provider that felt closest to the old-school SMTP mental model.

Apple's settings are direct:

SMTP server: smtp.mail.me.com
Port: 587
Authentication: required
Username: full iCloud email address
Password: app-specific password

Enter fullscreen mode Exit fullscreen mode

The important detail is the username.

For SMTP, Apple says to use the full iCloud Mail email address, not just the local part.

So this is good:

you@icloud.com

Enter fullscreen mode Exit fullscreen mode

This is the kind of tiny detail that costs 30 minutes when your test harness only says:

Authentication failed.

Enter fullscreen mode Exit fullscreen mode

And it is exactly why provider diagnostics matter.

A good product should say:

iCloud rejected SMTP authentication.

Check:
- Are you using smtp.mail.me.com on port 587?
- Are you using STARTTLS?
- Is the username your full iCloud Mail address?
- Is the password an Apple app-specific password rather than your Apple Account password?

Enter fullscreen mode Exit fullscreen mode

That is not just error handling.

That is product UX.

Outlook.com: where SMTP becomes an identity-platform problem

Outlook.com is where the simple smoke test started to feel like a boss fight.

The rough shape still looks familiar:

SMTP server: smtp-mail.outlook.com
Port: 587
Encryption: STARTTLS

Enter fullscreen mode Exit fullscreen mode

But then the auth story gets more interesting. With a new Outlook.com test account, I was not able to turn on SMTP... it looked like turned it on, but when I refreshed the page, it showed that it was still off. When I tried to investigate deeper, I noticed that the "Inspect/Developer Tools" Network tab showed an error in the response:

POST https://outlook.live.com/owa/0/service.svc?action=SetConsumerMailbox&app=Mail&n=36
412 (Precondition Failed)
Uncaught (in promise) Error: SetConsumerMailbox failed:
Microsoft.Exchange.Clients.Owa2.Server.Core.OwaInvalidServiceRequestException

Furthermore, Microsoft's Outlook.com SMTP settings list OAuth2 / Modern Auth as the authentication method. The same support surface also documents app passwords for Outlook.com accounts using two-factor authentication when a password is not accepted by another program.

That is where the provider test stops being a socket problem and becomes an account-state problem.

When Outlook.com rejects you, the question is not just:

Did my C# code authenticate correctly?

The question becomes:

Which authentication universe is this account currently living in?

For a developer-owned EpicMail smoke test, an app password was the shortest path to answering the narrow question I cared about first:

Can this adapter send one message through Outlook.com SMTP?

But I would not treat that as the long-term product answer.

For real user onboarding, Outlook.com is clearly pointing the ecosystem toward Modern Auth / OAuth2.

That is the central distinction:

Dev-owned smoke test:
  App password is great.

User-owned production account:
  OAuth2 / provider API is the responsible path.

Enter fullscreen mode Exit fullscreen mode

The problem is that both of those workflows might touch the same SMTP host and port.

So your code has to know which game it is playing.

App passwords are not "better OAuth"

This is the key lesson.

App passwords are not a better security model than OAuth.

They are a faster way to answer a narrower engineering question:

Can this provider send mail from this controlled test account using SMTP?

For EpicMail, that was exactly the question I needed answered first.

The app-password credential shape is tiny:

public sealed record AppPasswordCredential(
    string Username,
    string AppPassword);

Enter fullscreen mode Exit fullscreen mode

The send path is tiny:

await client.AuthenticateAsync(
    credential.Username,
    credential.AppPassword,
    cancellationToken);

Enter fullscreen mode Exit fullscreen mode

OAuth is a different animal:

public sealed record OAuthSmtpCredential(
    string Username,
    string AccessToken,
    string? RefreshToken,
    DateTimeOffset ExpiresAt,
    string[] Scopes,
    string ProviderClientId);

Enter fullscreen mode Exit fullscreen mode

And yes, MailKit can authenticate with an OAuth2 access token:

using MailKit.Security;

var oauth2 = new SaslMechanismOAuth2(
    credential.Username,
    credential.AccessToken);

await client.AuthenticateAsync(oauth2, cancellationToken);

Enter fullscreen mode Exit fullscreen mode

But that line is not the hard part.

The hard part is everything required to make that line safe and repeatable:

  • provider app registration
  • redirect URIs
  • local development callback URLs
  • consent screen configuration
  • scopes
  • token exchange
  • refresh token storage
  • encryption at rest
  • token refresh
  • revoked consent
  • expired refresh tokens
  • tenant or account policy
  • provider-specific support docs
  • user-facing recovery flows

For a real multi-user product, that work is justified.

For a smoke test, it can be a trap.

The abstraction changed once I separated the two paths

The useful design move was to stop pretending that "SMTP auth" is one thing.

It is not.

At minimum, EpicMail needs to model two credential modes:

public abstract record ProviderCredential(string Username);

public sealed record AppPasswordCredential(
    string Username,
    string AppPassword) : ProviderCredential(Username);

public sealed record OAuthCredential(
    string Username,
    string AccessToken,
    string? RefreshToken,
    DateTimeOffset ExpiresAt) : ProviderCredential(Username);

Enter fullscreen mode Exit fullscreen mode

Then the adapter can be honest:

public interface IEmailProviderAdapter
{
    string ProviderName { get; }

    Task SendSmokeTestAsync(
        ProviderCredential credential,
        string recipient,
        CancellationToken cancellationToken = default);

    ProviderDiagnostic Diagnose(Exception exception);
}

Enter fullscreen mode Exit fullscreen mode

And the Outlook.com adapter can say something useful instead of pretending all failures are equal:

if (ProviderName == "Outlook.com" && credential is AppPasswordCredential)
{
    diagnostic.Warnings.Add(
        "App passwords are useful for controlled Outlook.com smoke tests, " +
        "but OAuth2 / Modern Auth is the better user-facing path.");
}

Enter fullscreen mode Exit fullscreen mode

That warning is not bureaucracy.

It is future you leaving a note for support-ticket you.

The error taxonomy became the real feature

The most useful part of this work was not the successful send.

It was cataloging failures.

The first version of an email integration usually thinks it needs this:

public bool Sent { get; init; }

Enter fullscreen mode Exit fullscreen mode

What it actually needs is closer to this:

public enum ProviderDiagnosticCode
{
    Success,
    TcpConnectionFailed,
    StartTlsFailed,
    AuthenticationRejected,
    SenderRejected,
    RecipientRejected,
    ProviderPolicyRejected,
    RateLimited,
    MessageRejected,
    Unknown
}

Enter fullscreen mode Exit fullscreen mode

Because users do not need to know that SmtpCommandException happened.

They need to know what to do next.

A raw error says:

MailKit.Security.AuthenticationException: Authentication failed.

Enter fullscreen mode Exit fullscreen mode

A useful EpicMail-style diagnostic says:

Outlook.com rejected SMTP authentication.

Check:
- Are you using smtp-mail.outlook.com on port 587?
- Are you using STARTTLS?
- Is this account expecting OAuth2 / Modern Auth?
- If this is a dev-owned smoke test, is the Microsoft app password valid?
- Did Microsoft flag the sign-in in Recent Activity?

Enter fullscreen mode Exit fullscreen mode

That is the difference between supporting SMTP and understanding email providers.

The C# testing loop I wish I had started with

Instead of starting with "send an email," I wish I had started with a checklist:

var checks = new[]
{
    "Can resolve SMTP host",
    "Can open TCP connection",
    "Can upgrade with STARTTLS",
    "Can authenticate",
    "Can send MAIL FROM",
    "Can send RCPT TO",
    "Can send DATA",
    "Can receive final provider response",
    "Can map provider error to setup advice"
};

Enter fullscreen mode Exit fullscreen mode

The happy path is one row in that table.

The product is the rest of the table.

For each provider, I now want cases like:

✅ valid app password
❌ normal account password
❌ revoked app password
❌ wrong SMTP host
❌ wrong port
❌ STARTTLS disabled
❌ username missing full iCloud address
❌ Outlook.com account expects OAuth2 / Modern Auth
❌ provider flags suspicious login
❌ provider accepts login but rejects sender
❌ provider rate-limits or policy-blocks the message

Enter fullscreen mode Exit fullscreen mode

That is where the value is.

A generic SMTP client can throw raw provider errors.

A product should translate them.

The practical rule I ended up with

My current rule for EpicMail is:

For developer-owned smoke tests:
  Use app passwords when the provider supports them.

For user-owned accounts:
  Use OAuth2 / provider-approved auth flows.

For serious production sending:
  Consider transactional email providers instead of consumer inboxes.

Enter fullscreen mode Exit fullscreen mode

App passwords made Gmail, iCloud Mail, and Outlook.com easier to compare because they reduced the test surface area.

That mattered.

It let me test the boring-but-critical pieces first:

  • SMTP host and port
  • STARTTLS behavior
  • message construction
  • sender validation
  • recipient validation
  • provider-specific rejection messages
  • useful diagnostics

Then OAuth can come later as a product-grade authentication layer instead of blocking the first transport-layer proof.

OAuth is the production path.

App passwords are the debugging ladder.

Do not ship the ladder as the building... or if you do then version 1.1 should be adding OATH to Outlook, Gmail, iCloud... probably in that order too.

References