Code Monkey home page Code Monkey logo

smtpd's Introduction

Smtpd is a Go package for handling the server side of the SMTP protocol.
It does not handle high level details like what addresses should be
accepted or what should happen with email once it has been fully received;
those decisions are instead delegated to whatever is driving smtpd.
Smtpd's purpose is simply to handle the grunt work of a reasonably
RFC compliant SMTP server, taking care of things like proper command
sequencing, TLS, and basic correctness of some things.

(The standard library net/smtp package handles only the client side
of SMTP; it makes no attempt to provide the facilities you'd need to
write a server.)

smtpd sort of comes with a 'sinkhole' SMTP server that simply takes in
email (perhaps) and doesn't do anything with it beyond perhaps writing
it to disk. This is obviously not suitable for production usage but
it does make a potentially useful sink for spammers (which is what the
author uses it for). This once was cmd/sinksmtp.go, but has become so
large and complicated that it has moved out to its own repository,
https://github.com/siebenmann/sinksmtp.

Because of its origin as the core engine of a sinkhole SMTP server,
smtpd is pretty casual about a lot of things in the SMTP protocol
and in what information it hands to higher layers; for example, it
basically ignores SMTP parameters on MAIL FROM and RCPT TO. It will
accept far longer command lines than are required by the RFC, it has
shorter timeouts than the RFC requires (although you can change that),
and it is somewhat slapdash in doing basic sanity checking on addresses
(the author declines to write an RFC 5321 address parser just to be
fully correct, and yes it's a pity that this part of net/mail is not
exported and no, we're not faking things up so we can use net/mail's
version). These are all defects but the odds of the author fixing them
are low because his sinkhole SMTP server doesn't currently need them.

(Pull requests are welcome.)

Smtpd supports PIPELINING by paying no attention to people who do it
anyways and supports STARTTLS if you provide a certificate and a key.
It advertises 8BITMIME and accepts the relevant MAIL FROM parameter;
regardless of what clients do, messages are received in all 8 bits.
It rejects VRFY and EXPN attempts. It supports AUTH if you configure
one or more authentication methods.

References:
	http://tools.ietf.org/html/rfc5321
	http://golang.org/pkg/net/smtp/

See also:
	https://github.com/flashmob/go-guerrilla

Go-Guerilla SMTPd requires a real database server and is less RFC
neurotic than smtpd (eg it assumes that clients always send commands in
the right order). It's also a monolithic program instead of a package
that you can reuse.

CREDITS

Chris Siebenmann https://github.com/siebenmann
started writing this.

Felix Lange https://github.com/fjl contributed SMTP AUTH support.

COPYRIGHT:
GPL v3 for now

smtpd's People

Contributors

fjl avatar siebenmann avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.