# SMTPD demo server ## Warning This is just a proof-of-concept SMTPD server showing the protocol and parsing mechanisms. Do *not* use it as such in production. ## License Copyright 2022 Frédéric G. MARAND Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ## Sample exchange: ### Client-side ``` nc -c localhost 25 220 FGM-GUI22 ESMTP gosmtpd HELO osinet 250-FGM-GUI22 250-PIPELINING 250-SIZE 10240000 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN MAIL FROM: 250 2.1.0 Ok RCPT TO: 250 2.1.0 Ok DATA 354 Go ahead FROM: Moi-même To: Et moi aussi Subject: le sujet header: value some more content . 250 2.0.0 Ok: queued quit 221 2.0.0 Bye ``` ### Server-side ``` go run ./cmd 2022/12/08 21:31:18 New connection from [::1]:61067 2022/12/08 21:31:29 [Info] envelope.go:21 Inbound email from fgm@osinet.fr for fgm@osinet.fr 2022/12/08 21:32:04 [Info] envelope.go:78 From: Moi-même (mfg@osinet.fr) 2022/12/08 21:32:04 [Info] envelope.go:79 To: Et moi aussi (mfg@osinet.fr) 2022/12/08 21:32:04 [Info] envelope.go:80 Subject: le sujet 2022/12/08 21:32:04 [Info] envelope.go:81 Message: some more content ```