Commit 1ed7a713be9245843022bf19d48c10aa4cc72184
- Diff rendering mode:
- inline
- side by side
.gitignore
(1 / 0)
|   | |||
| 5 | 5 | /Setup.o | |
| 6 | 6 | /_darcs/* | |
| 7 | 7 | /dist | |
| 8 | /docs | ||
| 8 | 9 | /index.html | |
| 9 | 10 | /notfound.html | |
| 10 | 11 | /postmaster-*.tar.gz |
GNUmakefile
(15 / 108)
|   | |||
| 1 | # GNUmakefile -- build Postmaster | ||
| 1 | TOP=.. | ||
| 2 | include $(TOP)/mk/boilerplate.mk | ||
| 2 | 3 | ||
| 3 | ##### paths and programs | ||
| 4 | # --------------------------------------------------------------- | ||
| 4 | 5 | ||
| 5 | GHC := ghc | ||
| 6 | OBJDIR := .objs | ||
| 7 | HFLAGS := -threaded -O2 -funbox-strict-fields -Wall \ | ||
| 8 | -odir $(OBJDIR) -hidir $(OBJDIR) \ | ||
| 9 | -ihsdns -ignore-package hsdns \ | ||
| 10 | '-\#include <adns.h>' \ | ||
| 11 | '-\#include <errno.h>' \ | ||
| 12 | -ihsemail -ignore-package hsemail \ | ||
| 13 | -ihopenssl -ignore-package hopenssl \ | ||
| 14 | '-\#include <openssl/evp.h>' \ | ||
| 15 | -ihsyslog -ignore-package hsyslog \ | ||
| 6 | ALL_DIRS = \ | ||
| 7 | ADNS \ | ||
| 16 | 8 | ||
| 17 | DOCDIR := docs | ||
| 18 | HADDOCK := haddock | ||
| 19 | HSC2HS := hsc2hs | ||
| 20 | HDI_PATH := http://haskell.org/ghc/docs/latest/html/libraries | ||
| 21 | HDI_FILE := /usr/local/ghc-current/share/ghc-6.7/html/libraries | ||
| 22 | HDIFILES := \ | ||
| 23 | -i $(HDI_PATH)/base,$(HDI_FILE)/base/base.haddock \ | ||
| 24 | -i $(HDI_PATH)/network,$(HDI_FILE)/network/network.haddock \ | ||
| 25 | -i $(HDI_PATH)/mtl,$(HDI_FILE)/mtl/mtl.haddock \ | ||
| 26 | -i $(HDI_PATH)/unix,$(HDI_FILE)/unix/unix.haddock \ | ||
| 27 | -i $(HDI_PATH)/parsec,$(HDI_FILE)/parsec/parsec.haddock | ||
| 9 | PACKAGE := postmaster | ||
| 10 | RELEASEDAY := 0.1 | ||
| 11 | VERSION := $(RELEASEDAY) | ||
| 12 | PACKAGE_DEPS := base network | ||
| 28 | 13 | ||
| 29 | ##### build postmaster binary | ||
| 14 | SRC_HADDOCK_OPTS += -t "Postmaster ESMTP Server" | ||
| 30 | 15 | ||
| 31 | .PHONY: all | ||
| 16 | # --------------------------------------------------------------- | ||
| 32 | 17 | ||
| 33 | SRCS := Postmaster.hs \ | ||
| 34 | Postmaster/Base.hs \ | ||
| 35 | Postmaster/FSM.hs \ | ||
| 36 | Postmaster/FSM/Announce.hs \ | ||
| 37 | Postmaster/FSM/DNSResolver.hs \ | ||
| 38 | Postmaster/FSM/DataHandler.hs \ | ||
| 39 | Postmaster/FSM/EhloPeer.hs \ | ||
| 40 | Postmaster/FSM/EventHandler.hs \ | ||
| 41 | Postmaster/FSM/HeloName.hs \ | ||
| 42 | Postmaster/FSM/MailFrom.hs \ | ||
| 43 | Postmaster/FSM/MailID.hs \ | ||
| 44 | Postmaster/FSM/PeerAddr.hs \ | ||
| 45 | Postmaster/FSM/PeerHelo.hs \ | ||
| 46 | Postmaster/FSM/SessionState.hs \ | ||
| 47 | Postmaster/FSM/Spooler.hs \ | ||
| 48 | Postmaster/IO.hs \ | ||
| 49 | Postmaster/Main.hs \ | ||
| 50 | hsdns/ADNS.hs \ | ||
| 51 | hsdns/ADNS/Base.hs \ | ||
| 52 | hsdns/ADNS/Endian.hs \ | ||
| 53 | hsdns/ADNS/Resolver.hs \ | ||
| 54 | hsemail/Text/ParserCombinators/Parsec/Rfc2234.hs \ | ||
| 55 | hsemail/Text/ParserCombinators/Parsec/Rfc2821.hs \ | ||
| 56 | hopenssl/OpenSSL/Digest.hs \ | ||
| 57 | hsyslog/System/Posix/Syslog.hs | ||
| 18 | -include $(TOP)/mk/crypto.mk | ||
| 19 | include $(TOP)/mk/target.mk | ||
| 58 | 20 | ||
| 59 | all:: postmaster | ||
| 21 | haddock:: docs/tutorial.html | ||
| 60 | 22 | ||
| 61 | postmaster: $(SRCS) tutorial.lhs | ||
| 62 | @if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi | ||
| 63 | @rm -f $(OBJDIR)/Main.o $(OBJDIR)/Main.hi | ||
| 64 | $(GHC) --make $(HFLAGS) -o $@ tutorial.lhs -ladns -lcrypto | ||
| 65 | |||
| 66 | %.hs : %.hsc | ||
| 67 | $(HSC2HS) $< | ||
| 68 | |||
| 69 | ##### documentation | ||
| 70 | |||
| 71 | .PHONY: docs | ||
| 72 | |||
| 73 | docs:: $(DOCDIR)/tutorial.html | ||
| 74 | @rm -f $(DOCDIR)/index.html | ||
| 75 | @$(MAKE) $(DOCDIR)/index.html | ||
| 76 | |||
| 77 | $(DOCDIR)/index.html: $(SRCS) | ||
| 78 | @echo "Build documentation ..." | ||
| 79 | @if [ ! -d $(DOCDIR) ]; then mkdir $(DOCDIR); fi | ||
| 80 | @$(HADDOCK) $(HDIFILES) -s ../%F -t Postmaster -h \ | ||
| 81 | -o $(DOCDIR) $(SRCS) | ||
| 82 | |||
| 83 | $(DOCDIR)/tutorial.html: tutorial.lhs | ||
| 23 | docs/tutorial.html: tutorial.lhs | ||
| 84 | 24 | @lhs2html $< | |
| 85 | 25 | @mv tutorial.html $@ | |
| 86 | |||
| 87 | NOTES: .todo | ||
| 88 | @devtodo -T -f all --date-format '%Y-%m-%d' | ||
| 89 | @mv TODO $@ | ||
| 90 | |||
| 91 | ##### distribution | ||
| 92 | |||
| 93 | .PHONY: dist mkdist | ||
| 94 | |||
| 95 | dist: clean index.html $(DOCDIR)/index.html $(DOCDIR)/tutorial.html | ||
| 96 | |||
| 97 | mkdist: | ||
| 98 | @darcs dist --dist-name postmaster-`date --iso-8601` | ||
| 99 | |||
| 100 | index.html: README | ||
| 101 | @lhs2html $< | ||
| 102 | @sed -e 's%<p>\(.*Homepage\]</a></p>\)%<p class="title">\1%' <$<.html >$@ | ||
| 103 | @rm -f README.html | ||
| 104 | |||
| 105 | ##### administrative targets | ||
| 106 | |||
| 107 | .PHONY: clean distclean redate init-src | ||
| 108 | |||
| 109 | clean:: | ||
| 110 | @rm -rf $(OBJDIR) | ||
| 111 | @rm -f postmaster | ||
| 112 | |||
| 113 | distclean:: clean | ||
| 114 | @rm -rf $(DOCDIR) index.html | ||
| 115 | @rm -f postmaster-*.tar.gz | ||
| 116 | |||
| 117 | redate:: | ||
| 118 | redate README |
README
(3 / 5)
|   | |||
| 1 | 1 | Postmaster ESMTP Server | |
| 2 | 2 | ======================= | |
| 3 | 3 | ||
| 4 | :Latest Release: postmaster-2006-04-06.tar.gz_ | ||
| 4 | :Latest Release: postmaster-0.1.tar.gz_ | ||
| 5 | 5 | :Darcs: darcs_ get http://postmaster.cryp.to/ postmaster | |
| 6 | 6 | ||
| 7 | 7 | .. contents:: | |
| … | … | ||
| 51 | 51 | through a call-back function. Postmaster triggers an | |
| 52 | 52 | "event" every time a state change is required, and hopes | |
| 53 | 53 | that the call-back does whatever is necessary. Among the | |
| 54 | `known events`_, this one is popular:: | ||
| 54 | known events, this one is popular:: | ||
| 55 | 55 | ||
| 56 | 56 | AddRcptTo Mailbox | |
| 57 | 57 | ||
| … | … | ||
| 194 | 194 | ||
| 195 | 195 | .. _Sendmail: http://sendmail.org/ | |
| 196 | 196 | ||
| 197 | .. _postmaster-2006-04-06.tar.gz: http://postmaster.cryp.to/postmaster-2006-04-06.tar.gz | ||
| 198 | |||
| 199 | .. _known events: docs/Text.ParserCombinators.Parsec.Rfc2821.html#t%3AEvent | ||
| 197 | .. _postmaster-0.1.tar.gz: http://postmaster.cryp.to/postmaster-0.1.tar.gz | ||
| 200 | 198 | ||
| 201 | 199 | .. _GHC: http://haskell.org/ghc/ | |
| 202 | 200 |
prologue.txt
(7 / 0)
|   | |||
| 1 | Postmaster implements an ESMTP server. Given a configuration, it | ||
| 2 | starts up and listens for incoming SMTP connections, handles | ||
| 3 | them, and pipes the accepted e-mail messages into an arbitrary | ||
| 4 | local mailer of your choice. A good local mailer is Procmail. | ||
| 5 | Beyond that, you can configure and modify every little step of | ||
| 6 | the SMTP transaction. All the real work is done through call-back | ||
| 7 | functions. |

