1 USES
:= ldns libglog libidn2 opendkim openssl
3 CXXFLAGS
+= -IPEGTL
/include -Ijson
/include -Icppcodec
20 PROGRAMS
:= arcsign arcverify dns_tool smtp msg sasl snd socks5
22 arcsign_STEMS
:= arcsign \
23 message Domain IP IP4 IP6 Mailbox OpenARC OpenDKIM OpenDMARC Pill Reply osutil esc
25 arcverify_STEMS
:= arcverify \
26 message Domain IP IP4 IP6 Mailbox OpenARC OpenDKIM OpenDMARC Pill Reply osutil esc
28 DNS
:= DNS DNS-rrs DNS-fcrdns DNS-message
30 dns_tool_STEMS
:= dns_tool \
121 socks5_STEMS
:= socks5 \
158 default_init_allocator-test \
166 Base64-test_STEMS
:= Base64
167 CDB-test_STEMS
:= CDB osutil
169 DNS-test_STEMS
:= $(DNS
) DNS-ldns Domain IP IP4 IP6 POSIX Sock SockBuffer TLS-OpenSSL esc osutil
171 Domain-test_STEMS
:= $(DNS
) Domain IP IP4 IP6 POSIX Sock SockBuffer TLS-OpenSSL esc osutil
172 IP4-test_STEMS
:= $(DNS
) Domain IP IP4 IP6 POSIX Sock SockBuffer TLS-OpenSSL esc osutil
173 IP6-test_STEMS
:= $(DNS
) Domain IP IP4 IP6 POSIX Sock SockBuffer TLS-OpenSSL esc osutil
174 Magic-test_STEMS
:= Magic
175 Mailbox-test_STEMS
:= Mailbox Domain IP IP4 IP6 osutil
176 MessageStore-test_STEMS
:= $(DNS
) Domain IP IP4 IP6 MessageStore Pill POSIX Sock SockBuffer TLS-OpenSSL esc osutil
177 OpenDKIM-test_STEMS
:= OpenDKIM
178 POSIX-test_STEMS
:= POSIX
179 Pill-test_STEMS
:= Pill
180 Reply-test_STEMS
:= Reply osutil Domain IP IP4 IP6 Mailbox
181 SPF-test_STEMS
:= $(DNS
) Domain IP IP4 IP6 SPF POSIX Sock SockBuffer TLS-OpenSSL esc osutil
182 SRS-test_STEMS
:= SRS Domain Mailbox IP IP4 IP6
183 Send-test_STEMS
:= $(DNS
) Domain IP IP4 IP6 Mailbox OpenARC OpenDKIM OpenDMARC POSIX Pill SPF Send Sock SockBuffer TLS-OpenSSL esc message osutil
185 osutil-test_STEMS
:= osutil
186 message-test_STEMS
:= message Domain IP IP4 IP6 Mailbox OpenARC OpenDKIM OpenDMARC Pill Reply osutil esc
188 Session-test_STEMS
:= \
213 Sock-test_STEMS
:= Domain IP IP4 IP6 POSIX Sock SockBuffer TLS-OpenSSL esc osutil
214 SockBuffer-test_STEMS
:= Domain IP IP4 IP6 POSIX Sock SockBuffer TLS-OpenSSL esc osutil
215 TLS-OpenSSL-test_STEMS
:= Domain IP IP4 IP6 POSIX TLS-OpenSSL osutil
216 esc-test_STEMS
:= esc
222 bad_recipients_data.cdb \
229 all:: $(databases
) public_suffix_list.dat
233 export TEST_MAILDIR
=$(TMPDIR
)/Maildir
234 export MAILDIR
=$(TEST_MAILDIR
)
236 export ASAN_OPTIONS
=detect_leaks
=0
238 export GHSMTP_SERVER_ID
=digilicious.com
240 export LLVM_PROFILE_FILE
=smtp.profraw
246 # ragel -o smtp.cpp smtp.rl
251 rm -rf
$(TEST_MAILDIR
)/*
254 .
/cdb-gen
< $< | cdb
-c
$@
257 rm -f accept_domains.cdb
264 accept_domains.cdb
: accept_domains cdb-gen
265 allow.cdb
: allow cdb-gen
266 block.cdb
: block cdb-gen
267 ip-block.cdb
: ip-block cdb-gen
268 three-level-tlds.cdb
: three-level-tlds cdb-gen
273 public_suffix_list.dat
:
274 wget
--timestamping https
://publicsuffix.org
/list
/public_suffix_list.dat
278 # safty_flags := # nada
280 # visibility_flags := # nada
284 include MKUltra
/rules
286 regression
:: $(programs
) $(TEST_MAILDIR
)
287 @for f in testcase_dir
/* ; do \
288 echo
-n
test `basename $$f` ""; \
290 valgrind .
/smtp
< $$f > $$tmp_out; \
291 diff testout_dir
/`basename $$f` $$tmp_out && echo ...pass
; \
296 @for f in testcase_dir
/* ; do \
297 echo
-n
test `basename $$f` ""; \
299 .
/smtp
< $$f > $$tmp_out; \
300 diff testout_dir
/`basename $$f` $$tmp_out && echo ...pass
; \
301 if
[ -e smtp.profraw
] ; then mv smtp.profraw
/tmp
/smtp-profile
/`basename $$f`; fi
; \
306 @for f in testcase_dir
/* ; do \
307 echo
-n
test `basename $$f` ""; \
309 ncat localhost
225 < $$f > $$tmp_out; \
310 diff testout_dir
/`basename $$f` $$tmp_out && echo ...pass
; \
311 if
[ -e smtp.profraw
] ; then mv smtp.profraw
/tmp
/smtp-profile
/`basename $$f`; fi
; \
317 GHSMTP_CLIENT_ID
=digilicious.com .
/snd
--selftest
320 llvm-profdata merge
-sparse
/tmp
/smtp-profile
/* -o smtp.profdata
321 llvm-cov show .
/smtp
-instr-profile
=smtp.profdata
324 touch accept_domains bad_recipients bad_recipients_data bad_senders block ip-block temp_fail
325 sudo dnf
install boost-devel file-devel fmt-devel glog-devel ldns-devel libidn2-devel libopenarc-devel libopendkim-devel libopendmarc-devel libpsl-devel libspf2-devel tinycdb-devel libunistring-devel