frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

SMTP server from scratch in Go – FSM, raw TCP, and buffer-oriented I/O

3•Jyotishmoy•1h ago
I’ve been using AWS SES for a while and realized I treated SMTP as a black box. To understand the protocol better, I built an MTA (Mail Transfer Agent) from scratch in Go. It handles the full SMTP lifecycle (RFC 5321) using raw TCP sockets instead of high-level frameworks.

The Engineering Challenges:

Finite State Machine (FSM): SMTP is strictly stateful. I implemented an FSM to enforce command sequencing (e.g., preventing DATA before MAIL FROM). It ensures that protocol violations are caught at the socket level with proper 503 Bad Sequence codes.

Buffer-Oriented Processing: Used bufio.Scanner to handle the byte stream. The biggest hurdle was the DATA phase logic—properly detecting the \r\n.\r\n sequence while managing memory efficiently using strings.Builder.

Concurrency: Leveraged Go's Accept() loop to spawn independent goroutines for each session, ensuring that the relay latency to Gmail (via STARTTLS) doesn't block the listener.

ISP Workarounds: Configured to run on port 2525 by default to bypass the common ISP block on port 25.

Status Codes Implemented: I implemented a subset of RFC 5321 codes, including 220 (Service Ready), 354 (Start Input), and error handling for 501 (Syntax) and 451 (Local Error).

Why I built this: Most modern tutorials stop at "How to send an email with a library." I wanted to see how the "dot-stuffing" mechanism worked and how a server actually negotiates a multi-step handshake over a raw connection.

I’d love to hear about edge cases I might have missed—specifically around handling malformed headers or managing long-lived TCP connections under load.

Source Code: https://github.com/Jyotishmoy12/SMTP_Server

The risk of higher US inflation in 2026

https://www.piie.com/blogs/realtime-economics/2026/risk-higher-us-inflation-2026
1•littlexsparkee•25s ago•0 comments

Show HN: Deadcode Removal Layer for My Compiler in Less Than 140 LOC

https://github.com/ronfriedhaber/autark/blob/main/crates/mpera/src/optimizer/deadcode.rs
1•ronfriedhaber•38s ago•0 comments

AI Outlook with JetBrains

https://www.metaculus.com/tournament/jetbrains/
1•kqr•53s ago•0 comments

Building an Embedding API with Rust, Arm, and EmbeddingGemma on AWS Lambda

https://sobolev.substack.com/p/embeddinggemma-inference-on-aws-lambda
1•alexsobolev•1m ago•0 comments

Appropedia, the Sustainability Wiki

https://www.appropedia.org/Welcome_to_Appropedia
1•themaxdavitt•2m ago•0 comments

LibreOffice 26.2

https://www.libreoffice.org
1•pretext•2m ago•0 comments

You are no longer the smartest type of thing on Earth

https://www.noahpinion.blog/p/you-are-no-longer-the-smartest-type
1•sien•3m ago•0 comments

Ios26.3 fixed first actively exploited zero-day in 2026

https://securityaffairs.com/187890/security/apple-fixed-first-actively-exploited-zero-day-in-2026...
1•janandonly•5m ago•0 comments

Retrospective: Developing open source for 5 months full time

https://old.reddit.com/r/kde/comments/1r2p3u9/retrospective_developing_open_source_for_5_months/
1•mmarian•6m ago•0 comments

Show HN: AI SEO on Autopilot

https://kelo.lovable.app/
1•Creator-io•6m ago•0 comments

Microsoft confirms plan to ditch OpenAI

https://www.windowscentral.com/artificial-intelligence/microsoft-confirms-plan-to-ditch-openai-as...
3•achow•10m ago•0 comments

The LLM Context Tax: Best Tips for Tax Avoidance

https://www.nicolasbustamante.com/p/the-llm-context-tax-best-tips-for
1•kiyanwang•10m ago•0 comments

OpenAI sidesteps Nvidia with unusually fast coding model on plate-sized chips

https://arstechnica.com/ai/2026/02/openai-sidesteps-nvidia-with-unusually-fast-coding-model-on-pl...
1•montypod•11m ago•0 comments

Spotify says its best developers haven't written a line of code since December

https://techcrunch.com/2026/02/12/spotify-says-its-best-developers-havent-written-a-line-of-code-...
1•01-_-•11m ago•0 comments

The programming language after Kotlin – with the creator of Kotlin

https://newsletter.pragmaticengineer.com/p/the-programming-language-after-kotlin
1•janandonly•12m ago•0 comments

SeaweedFS: A simple and highly scalable distributed file system

https://github.com/seaweedfs/seaweedfs
1•saikatsg•13m ago•0 comments

The Power of 'No' in Internet Standards

https://www.mnot.net/blog/2026/02/13/no
1•robin_reala•13m ago•0 comments

Sarvam Studio

https://www.sarvam.ai/blogs/sarvam-studio/
1•saikatsg•15m ago•0 comments

What makes a strong testing, QA portfolio in 2026?

1•Divyakurian•16m ago•0 comments

Show HN: Kurpod – an encrypted OSS "container file" you can name vacation.jpg

https://github.com/srv1n/kurpod
1•Tsarp•20m ago•0 comments

More macOS 26.3 Finder column view silliness

https://lapcatsoftware.com/articles/2026/2/4.html
2•tambourine_man•22m ago•0 comments

Show HN: Put your practical experience into Skill in-one-go: MemOS Skill

https://twitter.com/MemOS_dev/status/2018344169023123854
1•MemTensor•22m ago•0 comments

OpenEnv in Practice: Evaluating Tool-Using Agents in Real-World Environments

https://huggingface.co/blog/openenv-turing
1•ibobev•23m ago•0 comments

Expressing a prime as the sum of two squares

https://www.johndcook.com/blog/2026/02/12/pythagorean-primes/
1•ibobev•23m ago•0 comments

Show HN: A simple button to vent and talk with someone

https://rifugioanonimo.lovable.app/
1•SimpleSpace_•25m ago•0 comments

Show HN: Solitaires.gg – Free ad-free solitaire in the browser

https://www.solitaires.gg
1•cisco-co•32m ago•0 comments

AI Agent Seemingly Tries to Shame Open Source Developer

https://www.theregister.com/2026/02/12/ai_bot_developer_rejected_pull_request/
3•jruohonen•33m ago•0 comments

AI coding platform's flaws allow BBC reporter to be hacked

https://www.bbc.com/news/articles/cy4wnw04e8wo
1•cmsefton•34m ago•0 comments

Show HN: Decoder – Static call graph analysis for Python

https://github.com/maryamtb/decoder
1•maryamtb•38m ago•1 comments

Gut feeling might be more valuable than habits, plans, or conscious decisions

https://www.ssp.sh/brain/gut-feeling/
2•articsputnik•41m ago•0 comments