A tiny SMTPD server demo
Find a file
2022-12-08 21:39:16 +01:00
.idea README, LICENSE 2022-12-08 21:39:16 +01:00
cmd Basic 2017 demo for Le Figaro, hardly updated. 2022-12-08 21:33:28 +01:00
fixtures Basic 2017 demo for Le Figaro, hardly updated. 2022-12-08 21:33:28 +01:00
envelope.go Basic 2017 demo for Le Figaro, hardly updated. 2022-12-08 21:33:28 +01:00
go.mod Basic 2017 demo for Le Figaro, hardly updated. 2022-12-08 21:33:28 +01:00
go.sum Basic 2017 demo for Le Figaro, hardly updated. 2022-12-08 21:33:28 +01:00
LICENSE.txt README, LICENSE 2022-12-08 21:39:16 +01:00
message.go Basic 2017 demo for Le Figaro, hardly updated. 2022-12-08 21:33:28 +01:00
README.md README, LICENSE 2022-12-08 21:39:16 +01:00

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 fgm@osinet.fr

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:<fgm@osinet.fr>
250 2.1.0 Ok
RCPT TO:<fgm@osinet.fr>
250 2.1.0 Ok
DATA
354 Go ahead
FROM: Moi-même <mfg@osinet.fr>
To: Et moi aussi <mfg@osinet.fr>
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