diff -c netqmail-1.04/FILES ../netqmail-1.04-auth-spf/netqmail-1.04/FILES
*** netqmail-1.04/FILES	Tue Nov 18 20:58:40 2003
--- ../netqmail-1.04-auth-spf/netqmail-1.04/FILES	Tue Feb  3 15:07:25 2004
***************
*** 136,141 ****
--- 136,143 ----
  dnsip.c
  dnsmxip.c
  dnsptr.c
+ dnstxt.c
+ spfquery.c
  hostname.c
  ipmeprint.c
  tcp-env.c
***************
*** 336,348 ****
--- 338,353 ----
  byte.h
  byte_chr.c
  byte_copy.c
+ byte_cspn.c
  byte_cr.c
  byte_diff.c
  byte_rchr.c
+ byte_rcspn.c
  byte_zero.c
  str.h
  str_chr.c
  str_cpy.c
+ str_cpyb.c
  str_diff.c
  str_diffn.c
  str_len.c
***************
*** 402,407 ****
--- 407,414 ----
  date822fmt.c
  dns.h
  dns.c
+ spf.h
+ spf.c
  trylsock.c
  tryrsolv.c
  ip.h
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: FILES~
diff -c netqmail-1.04/Makefile ../netqmail-1.04-auth-spf/netqmail-1.04/Makefile
*** netqmail-1.04/Makefile	Mon Nov 24 17:16:59 2003
--- ../netqmail-1.04-auth-spf/netqmail-1.04/Makefile	Tue Feb  3 15:58:45 2004
***************
*** 207,212 ****
--- 207,216 ----
  compile byte_cr.c byte.h
  	./compile byte_cr.c
  
+ byte_cspn.o: \
+ compile byte_cspn.c byte.h
+ 	./compile byte_cspn.c
+ 
  byte_diff.o: \
  compile byte_diff.c byte.h
  	./compile byte_diff.c
***************
*** 215,220 ****
--- 219,228 ----
  compile byte_rchr.c byte.h
  	./compile byte_rchr.c
  
+ byte_rcspn.o: \
+ compile byte_rcspn.c byte.h
+ 	./compile byte_rcspn.c
+ 
  byte_zero.o: \
  compile byte_zero.c byte.h
  	./compile byte_zero.c
***************
*** 397,419 ****
  	rm -f trydrent.o
  
  dns.lib: \
! tryrsolv.c compile load socket.lib dns.o ipalloc.o ip.o stralloc.a \
! alloc.a error.a fs.a str.a
  	( ( ./compile tryrsolv.c && ./load tryrsolv dns.o \
! 	ipalloc.o ip.o stralloc.a alloc.a error.a fs.a str.a \
  	-lresolv `cat socket.lib` ) >/dev/null 2>&1 \
  	&& echo -lresolv || exit 0 ) > dns.lib
  	rm -f tryrsolv.o tryrsolv
  
  dns.o: \
! compile dns.c ip.h ipalloc.h ip.h gen_alloc.h fmt.h alloc.h str.h \
! stralloc.h gen_alloc.h dns.h case.h
  	./compile dns.c
  
  dnscname: \
! load dnscname.o dns.o dnsdoe.o ip.o ipalloc.o stralloc.a alloc.a \
  substdio.a error.a str.a fs.a dns.lib socket.lib
! 	./load dnscname dns.o dnsdoe.o ip.o ipalloc.o stralloc.a \
  	alloc.a substdio.a error.a str.a fs.a  `cat dns.lib` `cat \
  	socket.lib`
  
--- 405,427 ----
  	rm -f trydrent.o
  
  dns.lib: \
! tryrsolv.c compile load socket.lib dns.o ipalloc.o strsalloc.o ip.o \
! stralloc.a alloc.a error.a fs.a str.a
  	( ( ./compile tryrsolv.c && ./load tryrsolv dns.o \
! 	ipalloc.o strsalloc.o ip.o stralloc.a alloc.a error.a fs.a str.a \
  	-lresolv `cat socket.lib` ) >/dev/null 2>&1 \
  	&& echo -lresolv || exit 0 ) > dns.lib
  	rm -f tryrsolv.o tryrsolv
  
  dns.o: \
! compile dns.c ip.h ipalloc.h strsalloc.h ip.h gen_alloc.h fmt.h alloc.h \
! str.h stralloc.h gen_alloc.h dns.h case.h
  	./compile dns.c
  
  dnscname: \
! load dnscname.o dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o stralloc.a alloc.a \
  substdio.a error.a str.a fs.a dns.lib socket.lib
! 	./load dnscname dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o stralloc.a \
  	alloc.a substdio.a error.a str.a fs.a  `cat dns.lib` `cat \
  	socket.lib`
  
***************
*** 427,472 ****
  	./compile dnsdoe.c
  
  dnsfq: \
! load dnsfq.o dns.o dnsdoe.o ip.o ipalloc.o stralloc.a alloc.a \
  substdio.a error.a str.a fs.a dns.lib socket.lib
! 	./load dnsfq dns.o dnsdoe.o ip.o ipalloc.o stralloc.a \
  	alloc.a substdio.a error.a str.a fs.a  `cat dns.lib` `cat \
  	socket.lib`
  
  dnsfq.o: \
  compile dnsfq.c substdio.h subfd.h substdio.h stralloc.h gen_alloc.h \
! dns.h dnsdoe.h ip.h ipalloc.h ip.h gen_alloc.h exit.h
  	./compile dnsfq.c
  
  dnsip: \
! load dnsip.o dns.o dnsdoe.o ip.o ipalloc.o stralloc.a alloc.a \
  substdio.a error.a str.a fs.a dns.lib socket.lib
! 	./load dnsip dns.o dnsdoe.o ip.o ipalloc.o stralloc.a \
  	alloc.a substdio.a error.a str.a fs.a  `cat dns.lib` `cat \
  	socket.lib`
  
  dnsip.o: \
  compile dnsip.c substdio.h subfd.h substdio.h stralloc.h gen_alloc.h \
! dns.h dnsdoe.h ip.h ipalloc.h ip.h gen_alloc.h exit.h
  	./compile dnsip.c
  
  dnsmxip: \
! load dnsmxip.o dns.o dnsdoe.o ip.o ipalloc.o now.o stralloc.a alloc.a \
! substdio.a error.a str.a fs.a dns.lib socket.lib
! 	./load dnsmxip dns.o dnsdoe.o ip.o ipalloc.o now.o \
  	stralloc.a alloc.a substdio.a error.a str.a fs.a  `cat \
  	dns.lib` `cat socket.lib`
  
  dnsmxip.o: \
  compile dnsmxip.c substdio.h subfd.h substdio.h stralloc.h \
! gen_alloc.h fmt.h dns.h dnsdoe.h ip.h ipalloc.h ip.h gen_alloc.h \
  now.h datetime.h exit.h
  	./compile dnsmxip.c
  
  dnsptr: \
! load dnsptr.o dns.o dnsdoe.o ip.o ipalloc.o stralloc.a alloc.a \
  substdio.a error.a str.a fs.a dns.lib socket.lib
! 	./load dnsptr dns.o dnsdoe.o ip.o ipalloc.o stralloc.a \
  	alloc.a substdio.a error.a str.a fs.a  `cat dns.lib` `cat \
  	socket.lib`
  
--- 435,480 ----
  	./compile dnsdoe.c
  
  dnsfq: \
! load dnsfq.o dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o stralloc.a alloc.a \
  substdio.a error.a str.a fs.a dns.lib socket.lib
! 	./load dnsfq dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o stralloc.a \
  	alloc.a substdio.a error.a str.a fs.a  `cat dns.lib` `cat \
  	socket.lib`
  
  dnsfq.o: \
  compile dnsfq.c substdio.h subfd.h substdio.h stralloc.h gen_alloc.h \
! dns.h dnsdoe.h ip.h ipalloc.h strsalloc.h ip.h gen_alloc.h exit.h
  	./compile dnsfq.c
  
  dnsip: \
! load dnsip.o dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o stralloc.a alloc.a \
  substdio.a error.a str.a fs.a dns.lib socket.lib
! 	./load dnsip dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o stralloc.a \
  	alloc.a substdio.a error.a str.a fs.a  `cat dns.lib` `cat \
  	socket.lib`
  
  dnsip.o: \
  compile dnsip.c substdio.h subfd.h substdio.h stralloc.h gen_alloc.h \
! dns.h dnsdoe.h ip.h ipalloc.h strsalloc.h ip.h gen_alloc.h exit.h
  	./compile dnsip.c
  
  dnsmxip: \
! load dnsmxip.o dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o now.o stralloc.a \
! alloc.a substdio.a error.a str.a fs.a dns.lib socket.lib
! 	./load dnsmxip dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o now.o \
  	stralloc.a alloc.a substdio.a error.a str.a fs.a  `cat \
  	dns.lib` `cat socket.lib`
  
  dnsmxip.o: \
  compile dnsmxip.c substdio.h subfd.h substdio.h stralloc.h \
! gen_alloc.h fmt.h dns.h dnsdoe.h ip.h ipalloc.h strsalloc.h ip.h gen_alloc.h \
  now.h datetime.h exit.h
  	./compile dnsmxip.c
  
  dnsptr: \
! load dnsptr.o dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o stralloc.a alloc.a \
  substdio.a error.a str.a fs.a dns.lib socket.lib
! 	./load dnsptr dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o stralloc.a \
  	alloc.a substdio.a error.a str.a fs.a  `cat dns.lib` `cat \
  	socket.lib`
  
***************
*** 475,480 ****
--- 483,500 ----
  str.h scan.h dns.h dnsdoe.h ip.h exit.h
  	./compile dnsptr.c
  
+ dnstxt: \
+ load dnstxt.o dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o stralloc.a alloc.a \
+ substdio.a error.a str.a fs.a dns.lib socket.lib
+ 	./load dnstxt dns.o dnsdoe.o ip.o ipalloc.o strsalloc.o stralloc.a \
+ 	alloc.a substdio.a error.a str.a fs.a  `cat dns.lib` `cat \
+ 	socket.lib`
+ 
+ dnstxt.o: \
+ compile dnstxt.c substdio.h subfd.h substdio.h stralloc.h gen_alloc.h \
+ str.h scan.h dns.h dnsdoe.h ip.h exit.h
+ 	./compile dnstxt.c
+ 
  dot-qmail.0: \
  dot-qmail.5
  	nroff -man dot-qmail.5 > dot-qmail.0
***************
*** 781,804 ****
  	./compile ip.c
  
  ipalloc.o: \
! compile ipalloc.c alloc.h gen_allocdefs.h ip.h ipalloc.h ip.h \
! gen_alloc.h
  	./compile ipalloc.c
  
  ipme.o: \
! compile ipme.c hassalen.h byte.h ip.h ipalloc.h ip.h gen_alloc.h \
! stralloc.h gen_alloc.h ipme.h ip.h ipalloc.h
  	./compile ipme.c
  
  ipmeprint: \
! load ipmeprint.o ipme.o ip.o ipalloc.o stralloc.a alloc.a substdio.a \
! error.a str.a fs.a socket.lib
! 	./load ipmeprint ipme.o ip.o ipalloc.o stralloc.a alloc.a \
! 	substdio.a error.a str.a fs.a  `cat socket.lib`
  
  ipmeprint.o: \
  compile ipmeprint.c subfd.h substdio.h substdio.h ip.h ipme.h ip.h \
! ipalloc.h ip.h gen_alloc.h exit.h
  	./compile ipmeprint.c
  
  it: \
--- 801,827 ----
  	./compile ip.c
  
  ipalloc.o: \
! compile ipalloc.c alloc.h gen_allocdefs.h ip.h ipalloc.h gen_alloc.h
  	./compile ipalloc.c
  
+ strsalloc.o: \
+ compile ipalloc.c alloc.h gen_allocdefs.h strsalloc.h gen_alloc.h
+ 	./compile strsalloc.c
+ 
  ipme.o: \
! compile ipme.c hassalen.h byte.h ip.h ipalloc.h strsalloc.h ip.h gen_alloc.h \
! stralloc.h gen_alloc.h ipme.h ip.h ipalloc.h strsalloc.h
  	./compile ipme.c
  
  ipmeprint: \
! load ipmeprint.o ipme.o ip.o ipalloc.o strsalloc.o stralloc.a alloc.a \
! substdio.a error.a str.a fs.a socket.lib
! 	./load ipmeprint ipme.o ip.o ipalloc.o strsalloc.o stralloc.a \
! 	alloc.a substdio.a error.a str.a fs.a `cat socket.lib`
  
  ipmeprint.o: \
  compile ipmeprint.c subfd.h substdio.h substdio.h ip.h ipme.h ip.h \
! ipalloc.h strsalloc.h ip.h gen_alloc.h exit.h
  	./compile ipmeprint.c
  
  it: \
***************
*** 808,818 ****
  qmail-pw2u qmail-qread qmail-qstat qmail-tcpto qmail-tcpok \
  qmail-pop3d qmail-popup qmail-qmqpc qmail-qmqpd qmail-qmtpd \
  qmail-smtpd sendmail tcp-env qmail-newmrh config config-fast dnscname \
! dnsptr dnsip dnsmxip dnsfq hostname ipmeprint qreceipt qsmhook qbiff \
  forward preline condredirect bouncesaying except maildirmake \
  maildir2mbox maildirwatch qail elq pinq idedit install-big install \
  instcheck home home+df proc proc+df binm1 binm1+df binm2 binm2+df \
! binm3 binm3+df
  
  load: \
  make-load warn-auto.sh systype
--- 831,841 ----
  qmail-pw2u qmail-qread qmail-qstat qmail-tcpto qmail-tcpok \
  qmail-pop3d qmail-popup qmail-qmqpc qmail-qmqpd qmail-qmtpd \
  qmail-smtpd sendmail tcp-env qmail-newmrh config config-fast dnscname \
! dnsptr dnsip dnsmxip dnsfq dnstxt hostname ipmeprint qreceipt qsmhook qbiff \
  forward preline condredirect bouncesaying except maildirmake \
  maildir2mbox maildirwatch qail elq pinq idedit install-big install \
  instcheck home home+df proc proc+df binm1 binm1+df binm2 binm2+df \
! binm3 binm3+df spfquery
  
  load: \
  make-load warn-auto.sh systype
***************
*** 1443,1454 ****
  
  qmail-remote: \
  load qmail-remote.o control.o constmap.o timeoutread.o timeoutwrite.o \
! timeoutconn.o tcpto.o now.o dns.o ip.o ipalloc.o ipme.o quote.o \
  ndelay.a case.a sig.a open.a lock.a seek.a getln.a stralloc.a alloc.a \
  substdio.a error.a str.a fs.a auto_qmail.o dns.lib socket.lib
  	./load qmail-remote control.o constmap.o timeoutread.o \
  	timeoutwrite.o timeoutconn.o tcpto.o now.o dns.o ip.o \
! 	ipalloc.o ipme.o quote.o ndelay.a case.a sig.a open.a \
  	lock.a seek.a getln.a stralloc.a alloc.a substdio.a error.a \
  	str.a fs.a auto_qmail.o  `cat dns.lib` `cat socket.lib`
  
--- 1466,1477 ----
  
  qmail-remote: \
  load qmail-remote.o control.o constmap.o timeoutread.o timeoutwrite.o \
! timeoutconn.o tcpto.o now.o dns.o ip.o ipalloc.o strsalloc.o ipme.o quote.o \
  ndelay.a case.a sig.a open.a lock.a seek.a getln.a stralloc.a alloc.a \
  substdio.a error.a str.a fs.a auto_qmail.o dns.lib socket.lib
  	./load qmail-remote control.o constmap.o timeoutread.o \
  	timeoutwrite.o timeoutconn.o tcpto.o now.o dns.o ip.o \
! 	ipalloc.o strsalloc.o ipme.o quote.o ndelay.a case.a sig.a open.a \
  	lock.a seek.a getln.a stralloc.a alloc.a substdio.a error.a \
  	str.a fs.a auto_qmail.o  `cat dns.lib` `cat socket.lib`
  
***************
*** 1459,1465 ****
  qmail-remote.o: \
  compile qmail-remote.c sig.h stralloc.h gen_alloc.h substdio.h \
  subfd.h substdio.h scan.h case.h error.h auto_qmail.h control.h dns.h \
! alloc.h quote.h ip.h ipalloc.h ip.h gen_alloc.h ipme.h ip.h ipalloc.h \
  gen_alloc.h gen_allocdefs.h str.h now.h datetime.h exit.h constmap.h \
  tcpto.h readwrite.h timeoutconn.h timeoutread.h timeoutwrite.h
  	./compile qmail-remote.c
--- 1482,1488 ----
  qmail-remote.o: \
  compile qmail-remote.c sig.h stralloc.h gen_alloc.h substdio.h \
  subfd.h substdio.h scan.h case.h error.h auto_qmail.h control.h dns.h \
! alloc.h quote.h ip.h ipalloc.h strsalloc.h ip.h gen_alloc.h ipme.h ip.h ipalloc.h strsalloc.h \
  gen_alloc.h gen_allocdefs.h str.h now.h datetime.h exit.h constmap.h \
  tcpto.h readwrite.h timeoutconn.h timeoutread.h timeoutwrite.h
  	./compile qmail-remote.c
***************
*** 1532,1552 ****
  compile qmail-showctl.c substdio.h subfd.h substdio.h exit.h fmt.h \
  str.h control.h constmap.h stralloc.h gen_alloc.h direntry.h \
  auto_uids.h auto_qmail.h auto_break.h auto_patrn.h auto_spawn.h \
! auto_split.h
  	./compile qmail-showctl.c
  
  qmail-smtpd: \
  load qmail-smtpd.o rcpthosts.o commands.o timeoutread.o \
! timeoutwrite.o ip.o ipme.o ipalloc.o control.o constmap.o received.o \
! date822fmt.o now.o qmail.o cdb.a fd.a wait.a datetime.a getln.a \
! open.a sig.a case.a env.a stralloc.a alloc.a substdio.a error.a str.a \
! fs.a auto_qmail.o base64.o socket.lib
  	./load qmail-smtpd rcpthosts.o commands.o timeoutread.o \
! 	timeoutwrite.o ip.o ipme.o ipalloc.o control.o constmap.o \
! 	received.o date822fmt.o now.o qmail.o cdb.a fd.a wait.a \
! 	datetime.a getln.a open.a sig.a case.a env.a stralloc.a \
! 	alloc.a substdio.a error.a str.a fs.a auto_qmail.o base64.o  `cat \
! 	socket.lib`
  
  qmail-smtpd.0: \
  qmail-smtpd.8
--- 1555,1582 ----
  compile qmail-showctl.c substdio.h subfd.h substdio.h exit.h fmt.h \
  str.h control.h constmap.h stralloc.h gen_alloc.h direntry.h \
  auto_uids.h auto_qmail.h auto_break.h auto_patrn.h auto_spawn.h \
! auto_split.h spf.h
  	./compile qmail-showctl.c
  
  qmail-smtpd: \
  load qmail-smtpd.o rcpthosts.o commands.o timeoutread.o \
! timeoutwrite.o ip.o ipme.o ipalloc.o strsalloc.o control.o constmap.o \
! received.o date822fmt.o now.o qmail.o spf.o dns.o cdb.a fd.a wait.a \
! datetime.a getln.a open.a sig.a case.a env.a stralloc.a alloc.a substdio.a \
! error.a str.a fs.a auto_qmail.o base64.o socket.lib dns.lib
  	./load qmail-smtpd rcpthosts.o commands.o timeoutread.o \
! 	timeoutwrite.o ip.o ipme.o ipalloc.o strsalloc.o control.o \
! 	constmap.o received.o date822fmt.o now.o qmail.o spf.o dns.o cdb.a \
! 	fd.a wait.a datetime.a getln.a open.a sig.a case.a env.a stralloc.a \
! 	alloc.a substdio.a error.a fs.a auto_qmail.o base64.o \
! 	str.a `cat socket.lib` `cat dns.lib`
! 
! spfquery: \
! load spfquery.o spf.o ip.o ipme.o ipalloc.o strsalloc.o now.o dns.o \
! datetime.a stralloc.a alloc.a str.a substdio.a error.a fs.a case.a dns.lib
! 	./load spfquery spf.o ip.o ipme.o ipalloc.o strsalloc.o \
! 	now.o dns.o datetime.a stralloc.a alloc.a str.a substdio.a \
! 	case.a error.a fs.a `cat dns.lib`
  
  qmail-smtpd.0: \
  qmail-smtpd.8
***************
*** 1555,1566 ****
  qmail-smtpd.o: \
  compile qmail-smtpd.c sig.h readwrite.h stralloc.h gen_alloc.h \
  substdio.h alloc.h auto_qmail.h control.h received.h constmap.h \
! error.h ipme.h ip.h ipalloc.h ip.h gen_alloc.h ip.h qmail.h \
  substdio.h str.h fmt.h scan.h byte.h case.h env.h now.h datetime.h \
! exit.h rcpthosts.h timeoutread.h timeoutwrite.h commands.h wait.h \
  fd.h base64.h
  	./compile qmail-smtpd.c
  
  qmail-start: \
  load qmail-start.o prot.o fd.a auto_uids.o
  	./load qmail-start prot.o fd.a auto_uids.o 
--- 1585,1605 ----
  qmail-smtpd.o: \
  compile qmail-smtpd.c sig.h readwrite.h stralloc.h gen_alloc.h \
  substdio.h alloc.h auto_qmail.h control.h received.h constmap.h \
! error.h ipme.h ip.h ipalloc.h strsalloc.h ip.h gen_alloc.h ip.h qmail.h \
  substdio.h str.h fmt.h scan.h byte.h case.h env.h now.h datetime.h \
! exit.h rcpthosts.h timeoutread.h timeoutwrite.h commands.h spf.h wait.h \
  fd.h base64.h
  	./compile qmail-smtpd.c
  
+ spf.o: \
+ compile spf.c stralloc.h gen_alloc.h alloc.h ipme.h ip.h ipalloc.h \
+ 	strsalloc.h str.h fmt.h scan.h byte.h now.h
+ 	./compile spf.c
+ 
+ spfquery.o: \
+ compile spfquery.c substdio.h subfd.h stralloc.h gen_alloc.h alloc.h spf.h exit.h
+ 	./compile spfquery.c
+ 
  qmail-start: \
  load qmail-start.o prot.o fd.a auto_uids.o
  	./load qmail-start prot.o fd.a auto_uids.o 
***************
*** 1784,1790 ****
  qmail-qread.c qmail-qstat.sh qmail-queue.c qmail-remote.c \
  qmail-rspawn.c qmail-send.c qmail-showctl.c qmail-smtpd.c \
  qmail-start.c qmail-tcpok.c qmail-tcpto.c spawn.c dnscname.c dnsfq.c \
! dnsip.c dnsmxip.c dnsptr.c hostname.c ipmeprint.c tcp-env.c \
  sendmail.c qreceipt.c qsmhook.c qbiff.c forward.c preline.c predate.c \
  except.c bouncesaying.c condredirect.c maildirmake.c maildir2mbox.c \
  maildirwatch.c splogger.c qail.sh elq.sh pinq.sh qmail-upq.sh \
--- 1823,1829 ----
  qmail-qread.c qmail-qstat.sh qmail-queue.c qmail-remote.c \
  qmail-rspawn.c qmail-send.c qmail-showctl.c qmail-smtpd.c \
  qmail-start.c qmail-tcpok.c qmail-tcpto.c spawn.c dnscname.c dnsfq.c \
! dnsip.c dnsmxip.c dnsptr.c dnstxt.c hostname.c ipmeprint.c tcp-env.c \
  sendmail.c qreceipt.c qsmhook.c qbiff.c forward.c preline.c predate.c \
  except.c bouncesaying.c condredirect.c maildirmake.c maildir2mbox.c \
  maildirwatch.c splogger.c qail.sh elq.sh pinq.sh qmail-upq.sh \
***************
*** 1818,1825 ****
  trywaitp.c sig.h sig_alarm.c sig_block.c sig_catch.c sig_pause.c \
  sig_pipe.c sig_child.c sig_term.c sig_hup.c sig_misc.c sig_bug.c \
  trysgact.c trysgprm.c env.3 env.h env.c envread.c byte.h byte_chr.c \
! byte_copy.c byte_cr.c byte_diff.c byte_rchr.c byte_zero.c str.h \
! str_chr.c str_cpy.c str_diff.c str_diffn.c str_len.c str_rchr.c \
  str_start.c lock.h lock_ex.c lock_exnb.c lock_un.c tryflock.c getln.3 \
  getln.h getln.c getln2.3 getln2.c sgetopt.3 sgetopt.h sgetopt.c \
  subgetopt.3 subgetopt.h subgetopt.c error.3 error_str.3 error_temp.3 \
--- 1857,1865 ----
  trywaitp.c sig.h sig_alarm.c sig_block.c sig_catch.c sig_pause.c \
  sig_pipe.c sig_child.c sig_term.c sig_hup.c sig_misc.c sig_bug.c \
  trysgact.c trysgprm.c env.3 env.h env.c envread.c byte.h byte_chr.c \
! byte_copy.c byte_cr.c byte_cspn.c byte_diff.c byte_rchr.c byte_rcspn.c \
! byte_zero.c str.h spf.c spf.h spfquery.c \
! str_chr.c str_cpy.c str_cpyb.c str_diff.c str_diffn.c str_len.c str_rchr.c \
  str_start.c lock.h lock_ex.c lock_exnb.c lock_un.c tryflock.c getln.3 \
  getln.h getln.c getln2.3 getln2.c sgetopt.3 sgetopt.h sgetopt.c \
  subgetopt.3 subgetopt.h subgetopt.c error.3 error_str.3 error_temp.3 \
***************
*** 1829,1835 ****
  headerbody.h headerbody.c token822.h token822.c control.h control.c \
  datetime.3 datetime.h datetime.c datetime_un.c prioq.h prioq.c \
  date822fmt.h date822fmt.c dns.h dns.c trylsock.c tryrsolv.c ip.h ip.c \
! ipalloc.h ipalloc.c select.h1 select.h2 trysysel.c ndelay.h ndelay.c \
  ndelay_off.c direntry.3 direntry.h1 direntry.h2 trydrent.c prot.h \
  prot.c chkshsgr.c warn-shsgr tryshsgr.c ipme.h ipme.c trysalen.c \
  maildir.5 maildir.h maildir.c tcp-environ.5 constmap.h constmap.c
--- 1869,1875 ----
  headerbody.h headerbody.c token822.h token822.c control.h control.c \
  datetime.3 datetime.h datetime.c datetime_un.c prioq.h prioq.c \
  date822fmt.h date822fmt.c dns.h dns.c trylsock.c tryrsolv.c ip.h ip.c \
! ipalloc.h strsalloc.h ipalloc.c select.h1 select.h2 trysysel.c ndelay.h ndelay.c \
  ndelay_off.c direntry.3 direntry.h1 direntry.h2 trydrent.c prot.h \
  prot.c chkshsgr.c warn-shsgr tryshsgr.c ipme.h ipme.c trysalen.c \
  maildir.5 maildir.h maildir.c tcp-environ.5 constmap.h constmap.c
***************
*** 1917,1928 ****
  	./compile splogger.c
  
  str.a: \
! makelib str_len.o str_diff.o str_diffn.o str_cpy.o str_chr.o \
! str_rchr.o str_start.o byte_chr.o byte_rchr.o byte_diff.o byte_copy.o \
! byte_cr.o byte_zero.o
! 	./makelib str.a str_len.o str_diff.o str_diffn.o str_cpy.o \
! 	str_chr.o str_rchr.o str_start.o byte_chr.o byte_rchr.o \
! 	byte_diff.o byte_copy.o byte_cr.o byte_zero.o
  
  str_chr.o: \
  compile str_chr.c str.h
--- 1957,1968 ----
  	./compile splogger.c
  
  str.a: \
! makelib str_len.o str_diff.o str_diffn.o str_cpy.o str_cpyb.o str_chr.o \
! str_rchr.o str_start.o byte_chr.o byte_rchr.o byte_cspn.o byte_rcspn.o \
! byte_diff.o byte_copy.o byte_cr.o byte_zero.o
! 	./makelib str.a str_len.o str_diff.o str_diffn.o str_cpy.o str_cpyb.o \
! 	str_chr.o str_rchr.o str_start.o byte_chr.o byte_rchr.o byte_cspn.o \
! 	byte_rcspn.o byte_diff.o byte_copy.o byte_cr.o byte_zero.o
  
  str_chr.o: \
  compile str_chr.c str.h
***************
*** 1932,1937 ****
--- 1972,1981 ----
  compile str_cpy.c str.h
  	./compile str_cpy.c
  
+ str_cpyb.o: \
+ compile str_cpyb.c str.h
+ 	./compile str_cpyb.c
+ 
  str_diff.o: \
  compile str_diff.c str.h
  	./compile str_diff.c
***************
*** 2071,2081 ****
  
  tcp-env: \
  load tcp-env.o dns.o remoteinfo.o timeoutread.o timeoutwrite.o \
! timeoutconn.o ip.o ipalloc.o case.a ndelay.a sig.a env.a getopt.a \
! stralloc.a alloc.a substdio.a error.a str.a fs.a dns.lib socket.lib
  	./load tcp-env dns.o remoteinfo.o timeoutread.o \
! 	timeoutwrite.o timeoutconn.o ip.o ipalloc.o case.a ndelay.a \
! 	sig.a env.a getopt.a stralloc.a alloc.a substdio.a error.a \
  	str.a fs.a  `cat dns.lib` `cat socket.lib`
  
  tcp-env.0: \
--- 2115,2125 ----
  
  tcp-env: \
  load tcp-env.o dns.o remoteinfo.o timeoutread.o timeoutwrite.o \
! timeoutconn.o ip.o ipalloc.o strsalloc.o case.a ndelay.a sig.a env.a \
! getopt.a stralloc.a alloc.a substdio.a error.a str.a fs.a dns.lib socket.lib
  	./load tcp-env dns.o remoteinfo.o timeoutread.o \
! 	timeoutwrite.o timeoutconn.o ip.o ipalloc.o strsalloc.o case.a \
! 	ndelay.a sig.a env.a getopt.a stralloc.a alloc.a substdio.a error.a \
  	str.a fs.a  `cat dns.lib` `cat socket.lib`
  
  tcp-env.0: \
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: Makefile.rej
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: Makefile~
diff -c netqmail-1.04/TARGETS ../netqmail-1.04-auth-spf/netqmail-1.04/TARGETS
*** netqmail-1.04/TARGETS	Mon Nov 24 17:16:59 2003
--- ../netqmail-1.04-auth-spf/netqmail-1.04/TARGETS	Tue Feb  3 15:07:25 2004
***************
*** 100,110 ****
--- 100,113 ----
  str_diff.o
  str_diffn.o
  str_cpy.o
+ str_cpyb.o
  str_chr.o
  str_rchr.o
  str_start.o
  byte_chr.o
  byte_rchr.o
+ byte_cspn.o
+ byte_rcspn.o
  byte_diff.o
  byte_copy.o
  byte_cr.o
***************
*** 171,178 ****
--- 174,183 ----
  timeoutconn.o
  tcpto.o
  dns.o
+ spf.o
  ip.o
  ipalloc.o
+ strsalloc.o
  hassalen.h
  ipme.o
  ndelay.o
***************
*** 212,217 ****
--- 217,225 ----
  headerbody.o
  hfield.o
  token822.o
+ spf.o
+ spfquery.o
+ spfquery
  qmail-inject
  predate.o
  predate
***************
*** 271,276 ****
--- 279,286 ----
  dnsip
  dnsmxip.o
  dnsmxip
+ dnstxt.o
+ dnstxt
  dnsfq.o
  dnsfq
  hostname.o
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: TARGETS.rej
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: TARGETS~
Only in netqmail-1.04: addresses.0
Binary files netqmail-1.04/alloc.a and ../netqmail-1.04-auth-spf/netqmail-1.04/alloc.a differ
Only in netqmail-1.04: bouncesaying.0
diff -c netqmail-1.04/byte.h ../netqmail-1.04-auth-spf/netqmail-1.04/byte.h
*** netqmail-1.04/byte.h	Mon Jun 15 05:53:16 1998
--- ../netqmail-1.04-auth-spf/netqmail-1.04/byte.h	Tue Feb  3 15:07:25 2004
***************
*** 3,8 ****
--- 3,10 ----
  
  extern unsigned int byte_chr();
  extern unsigned int byte_rchr();
+ extern unsigned int byte_cspn();
+ extern unsigned int byte_rcspn();
  extern void byte_copy();
  extern void byte_copyr();
  extern int byte_diff();
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: byte_cspn.c
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: byte_cspn.o
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: byte_rcspn.c
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: byte_rcspn.o
Binary files netqmail-1.04/case.a and ../netqmail-1.04-auth-spf/netqmail-1.04/case.a differ
Binary files netqmail-1.04/cdb.a and ../netqmail-1.04-auth-spf/netqmail-1.04/cdb.a differ
Binary files netqmail-1.04/cdbmake.a and ../netqmail-1.04-auth-spf/netqmail-1.04/cdbmake.a differ
Only in netqmail-1.04: condredirect.0
Binary files netqmail-1.04/datetime.a and ../netqmail-1.04-auth-spf/netqmail-1.04/datetime.a differ
diff -c netqmail-1.04/dns.c ../netqmail-1.04-auth-spf/netqmail-1.04/dns.c
*** netqmail-1.04/dns.c	Tue Nov 18 20:58:40 2003
--- ../netqmail-1.04-auth-spf/netqmail-1.04/dns.c	Tue Feb  3 15:07:25 2004
***************
*** 9,14 ****
--- 9,15 ----
  extern int res_search();
  #include "ip.h"
  #include "ipalloc.h"
+ #include "strsalloc.h"
  #include "fmt.h"
  #include "alloc.h"
  #include "str.h"
***************
*** 16,21 ****
--- 17,24 ----
  #include "dns.h"
  #include "case.h"
  
+ #define MAXTXT 256
+ 
  static unsigned short getshort(c) unsigned char *c;
  { unsigned short u; u = c[0]; return (u << 8) + c[1]; }
  
***************
*** 27,32 ****
--- 30,36 ----
  static int numanswers;
  static char name[MAXDNAME];
  static struct ip_address ip;
+ static char txt[MAXTXT];
  unsigned short pref;
  
  static stralloc glue = {0};
***************
*** 177,182 ****
--- 181,218 ----
   return 0;
  }
  
+ static int findtxt(wanttype)
+ int wanttype;
+ {
+  unsigned short rrtype;
+  unsigned short rrdlen;
+  int i;
+ 
+  if (numanswers <= 0) return 2;
+  --numanswers;
+  if (responsepos == responseend) return DNS_SOFT;
+ 
+  i = dn_expand(response.buf,responseend,responsepos,name,MAXDNAME);
+  if (i < 0) return DNS_SOFT;
+  responsepos += i;
+ 
+  i = responseend - responsepos;
+  if (i < 4 + 3 * 2) return DNS_SOFT;
+    
+  rrtype = getshort(responsepos);
+  rrdlen = getshort(responsepos + 8);
+  responsepos += 10;
+ 
+  if (rrtype == wanttype) {
+   str_copyb(txt, responsepos, rrdlen);
+   responsepos += rrdlen;
+   return 1;
+  }
+    
+  responsepos += rrdlen;
+  return 0;
+ }
+ 
  void dns_init(flagsearch)
  int flagsearch;
  {
***************
*** 235,249 ****
   return len;
  }
  
! int dns_ptr(sa,ip)
! stralloc *sa;
  struct ip_address *ip;
  {
   int r;
  
!  if (!stralloc_ready(sa,iaafmt((char *) 0,ip))) return DNS_MEM;
!  sa->len = iaafmt(sa->s,ip);
!  switch(resolve(sa,T_PTR))
    {
     case DNS_MEM: return DNS_MEM;
     case DNS_SOFT: return DNS_SOFT;
--- 271,288 ----
   return len;
  }
  
! static int dns_ptrplus(ssa,ip)
! strsalloc *ssa;
  struct ip_address *ip;
  {
+  stralloc sa = {0};
   int r;
  
!  if (!stralloc_ready(&sa,iaafmt((char *) 0,ip))) return DNS_MEM;
!  sa.len = iaafmt(sa.s,ip);
!  r = resolve(&sa,T_PTR);
!  alloc_free(sa.s);
!  switch(r)
    {
     case DNS_MEM: return DNS_MEM;
     case DNS_SOFT: return DNS_SOFT;
***************
*** 254,266 ****
     if (r == DNS_SOFT) return DNS_SOFT;
     if (r == 1)
      {
!      if (!stralloc_copys(sa,name)) return DNS_MEM;
!      return 0;
      }
    }
   return DNS_HARD;
  }
  
  static int dns_ipplus(ia,sa,pref)
  ipalloc *ia;
  stralloc *sa;
--- 293,327 ----
     if (r == DNS_SOFT) return DNS_SOFT;
     if (r == 1)
      {
!      stralloc sa2 = {0};
!      if (!stralloc_copys(&sa2,name)) return DNS_MEM;
!      if (!strsalloc_append(ssa,&sa2)) return DNS_MEM;
      }
    }
+  if (ssa->len) return 0;
   return DNS_HARD;
  }
  
+ int dns_ptr(ssa,ip)
+ strsalloc *ssa;
+ struct ip_address *ip;
+ {
+  int r;
+  int j;
+ 
+  if (!strsalloc_readyplus(ssa,0)) return DNS_MEM;
+  ssa->len = 0;
+  r = dns_ptrplus(ssa,ip);
+  if (r < 0)
+   {
+    for (j = 0;j < ssa->len;++j)
+     alloc_free(ssa->sa[j].s);
+    ssa->len = 0;
+   }
+  return r;
+ }
+ 
+ 
  static int dns_ipplus(ia,sa,pref)
  ipalloc *ia;
  stralloc *sa;
***************
*** 396,398 ****
--- 457,505 ----
   alloc_free(mx);
   return flagsoft;
  }
+ 
+ 
+ static int dns_txtplus(ssa,sa)
+ strsalloc *ssa;
+ stralloc *sa;
+ {
+  int r;
+ 
+  switch(resolve(sa,T_TXT)) 
+   {
+    case DNS_MEM: return DNS_MEM;
+    case DNS_SOFT: return DNS_SOFT;
+    case DNS_HARD: return DNS_HARD;
+   }
+  while ((r = findtxt(T_TXT)) != 2)
+   {
+    if (r == DNS_SOFT) return DNS_SOFT;
+    if (r == 1)
+     {
+      stralloc sa = {0};
+      if (!stralloc_copyb(&sa,txt+1,(unsigned char)txt[0])) return DNS_MEM;
+      if (!strsalloc_append(ssa,&sa)) return DNS_MEM;
+     }
+   }
+  if (ssa->len) return 0;
+  return DNS_HARD;
+ }
+ 
+ int dns_txt(ssa,sa)
+ strsalloc *ssa;
+ stralloc *sa;
+ {
+  int r;
+  int j;
+ 
+  if (!strsalloc_readyplus(ssa,0)) return DNS_MEM;
+  ssa->len = 0;
+  r = dns_txtplus(ssa,sa);
+  if (r < 0)
+   {
+    for (j = 0;j < ssa->len;++j)
+     alloc_free(ssa->sa[j].s);
+    ssa->len = 0;
+   }
+  return r;
+ }
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: dns.c~
diff -c netqmail-1.04/dns.h ../netqmail-1.04-auth-spf/netqmail-1.04/dns.h
*** netqmail-1.04/dns.h	Mon Jun 15 05:53:16 1998
--- ../netqmail-1.04-auth-spf/netqmail-1.04/dns.h	Tue Feb  3 15:07:25 2004
***************
*** 10,14 ****
--- 10,15 ----
  int dns_mxip();
  int dns_ip();
  int dns_ptr();
+ int dns_txt();
  
  #endif
Binary files netqmail-1.04/dns.o and ../netqmail-1.04-auth-spf/netqmail-1.04/dns.o differ
Binary files netqmail-1.04/dnscname and ../netqmail-1.04-auth-spf/netqmail-1.04/dnscname differ
Binary files netqmail-1.04/dnsfq and ../netqmail-1.04-auth-spf/netqmail-1.04/dnsfq differ
diff -c netqmail-1.04/dnsfq.c ../netqmail-1.04-auth-spf/netqmail-1.04/dnsfq.c
*** netqmail-1.04/dnsfq.c	Mon Jun 15 05:53:16 1998
--- ../netqmail-1.04-auth-spf/netqmail-1.04/dnsfq.c	Tue Feb  3 15:07:25 2004
***************
*** 5,19 ****
--- 5,23 ----
  #include "dnsdoe.h"
  #include "ip.h"
  #include "ipalloc.h"
+ #include "strsalloc.h"
  #include "exit.h"
  
  stralloc sa = {0};
+ strsalloc ssa = {0};
  ipalloc ia = {0};
  
  void main(argc,argv)
  int argc;
  char **argv;
  {
+  int j;
+ 
   if (!argv[1]) _exit(100);
  
   if (!stralloc_copys(&sa,argv[1]))
***************
*** 25,32 ****
    {
     substdio_putsflush(subfderr,"no IP addresses\n"); _exit(100);
    }
!  dnsdoe(dns_ptr(&sa,&ia.ix[0].ip));
!  substdio_putflush(subfdout,sa.s,sa.len);
!  substdio_putsflush(subfdout,"\n");
   _exit(0);
  }
--- 29,39 ----
    {
     substdio_putsflush(subfderr,"no IP addresses\n"); _exit(100);
    }
!  dnsdoe(dns_ptr(&ssa,&ia.ix[0].ip));
!  for(j = 0;j < ssa.len;++j)
!   {
!    substdio_putflush(subfdout,ssa.sa[j].s,ssa.sa[j].len);
!    substdio_putsflush(subfdout,"\n");
!   }
   _exit(0);
  }
Binary files netqmail-1.04/dnsfq.o and ../netqmail-1.04-auth-spf/netqmail-1.04/dnsfq.o differ
Binary files netqmail-1.04/dnsip and ../netqmail-1.04-auth-spf/netqmail-1.04/dnsip differ
Binary files netqmail-1.04/dnsmxip and ../netqmail-1.04-auth-spf/netqmail-1.04/dnsmxip differ
Binary files netqmail-1.04/dnsptr and ../netqmail-1.04-auth-spf/netqmail-1.04/dnsptr differ
diff -c netqmail-1.04/dnsptr.c ../netqmail-1.04-auth-spf/netqmail-1.04/dnsptr.c
*** netqmail-1.04/dnsptr.c	Mon Jun 15 05:53:16 1998
--- ../netqmail-1.04-auth-spf/netqmail-1.04/dnsptr.c	Tue Feb  3 15:07:25 2004
***************
*** 6,27 ****
  #include "dns.h"
  #include "dnsdoe.h"
  #include "ip.h"
  #include "exit.h"
  
! stralloc sa = {0};
  struct ip_address ip;
  
  void main(argc,argv)
  int argc;
  char **argv;
  {
   if (!argv[1]) _exit(100);
  
   ip_scan(argv[1],&ip);
  
   dns_init(0);
!  dnsdoe(dns_ptr(&sa,&ip));
!  substdio_putflush(subfdout,sa.s,sa.len);
!  substdio_putsflush(subfdout,"\n");
   _exit(0);
  }
--- 6,33 ----
  #include "dns.h"
  #include "dnsdoe.h"
  #include "ip.h"
+ #include "strsalloc.h"
  #include "exit.h"
  
! strsalloc ssa = {0};
  struct ip_address ip;
  
  void main(argc,argv)
  int argc;
  char **argv;
  {
+  int j;
+ 
   if (!argv[1]) _exit(100);
  
   ip_scan(argv[1],&ip);
  
   dns_init(0);
!  dnsdoe(dns_ptr(&ssa,&ip));
!  for(j = 0;j < ssa.len;++j)
!   {
!    substdio_putflush(subfdout,ssa.sa[j].s,ssa.sa[j].len);
!    substdio_putsflush(subfdout,"\n");
!   }
   _exit(0);
  }
Binary files netqmail-1.04/dnsptr.o and ../netqmail-1.04-auth-spf/netqmail-1.04/dnsptr.o differ
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: dnstxt
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: dnstxt.c
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: dnstxt.o
Only in netqmail-1.04: dot-qmail.0
Only in netqmail-1.04: dot-qmail.5
Binary files netqmail-1.04/env.a and ../netqmail-1.04-auth-spf/netqmail-1.04/env.a differ
Only in netqmail-1.04: envelopes.0
Binary files netqmail-1.04/error.a and ../netqmail-1.04-auth-spf/netqmail-1.04/error.a differ
Only in netqmail-1.04: except.0
Binary files netqmail-1.04/fd.a and ../netqmail-1.04-auth-spf/netqmail-1.04/fd.a differ
Only in netqmail-1.04: forgeries.0
Only in netqmail-1.04: forward.0
Binary files netqmail-1.04/fs.a and ../netqmail-1.04-auth-spf/netqmail-1.04/fs.a differ
Binary files netqmail-1.04/getln.a and ../netqmail-1.04-auth-spf/netqmail-1.04/getln.a differ
Binary files netqmail-1.04/getopt.a and ../netqmail-1.04-auth-spf/netqmail-1.04/getopt.a differ
Binary files netqmail-1.04/ipmeprint and ../netqmail-1.04-auth-spf/netqmail-1.04/ipmeprint differ
Binary files netqmail-1.04/lock.a and ../netqmail-1.04-auth-spf/netqmail-1.04/lock.a differ
Only in netqmail-1.04: maildir.0
Only in netqmail-1.04: maildir2mbox.0
Only in netqmail-1.04: maildirmake.0
Only in netqmail-1.04: maildirwatch.0
Only in netqmail-1.04: mailsubj.0
Only in netqmail-1.04: mbox.0
Binary files netqmail-1.04/ndelay.a and ../netqmail-1.04-auth-spf/netqmail-1.04/ndelay.a differ
Binary files netqmail-1.04/open.a and ../netqmail-1.04-auth-spf/netqmail-1.04/open.a differ
Only in netqmail-1.04: preline.0
Only in netqmail-1.04: qbiff.0
Only in netqmail-1.04: qmail-clean.0
Only in netqmail-1.04: qmail-command.0
Only in netqmail-1.04: qmail-control.0
Only in netqmail-1.04: qmail-control.5
diff -c netqmail-1.04/qmail-control.9 ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-control.9
*** netqmail-1.04/qmail-control.9	Mon Jun 15 05:53:16 1998
--- ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-control.9	Tue Feb  3 15:07:25 2004
***************
*** 63,68 ****
--- 63,72 ----
  .I rcpthosts	\fR(none)	\fRqmail-smtpd
  .I smtpgreeting	\fIme	\fRqmail-smtpd
  .I smtproutes	\fR(none)	\fRqmail-remote
+ .I spfbehavior	\fR0	\fRqmail-smtpd
+ .I spfexp	\fR(default)	\fRqmail-smtpd
+ .I spfguess	\fR(none)	\fRqmail-smtpd
+ .I spfrules	\fR(none)	\fRqmail-smtpd
  .I timeoutconnect	\fR60	\fRqmail-remote
  .I timeoutremote	\fR1200	\fRqmail-remote
  .I timeoutsmtpd	\fR1200	\fRqmail-smtpd
Only in netqmail-1.04: qmail-getpw.0
Only in netqmail-1.04: qmail-getpw.8
Only in netqmail-1.04: qmail-header.0
Only in netqmail-1.04: qmail-inject.0
Only in netqmail-1.04: qmail-limits.0
Only in netqmail-1.04: qmail-limits.7
Only in netqmail-1.04: qmail-local.0
Only in netqmail-1.04: qmail-log.0
Only in netqmail-1.04: qmail-lspawn.0
Only in netqmail-1.04: qmail-newmrh.0
Only in netqmail-1.04: qmail-newmrh.8
Only in netqmail-1.04: qmail-newu.0
Only in netqmail-1.04: qmail-newu.8
Only in netqmail-1.04: qmail-pop3d.0
Only in netqmail-1.04: qmail-popup.0
Only in netqmail-1.04: qmail-pw2u.0
Only in netqmail-1.04: qmail-pw2u.8
Only in netqmail-1.04: qmail-qmqpc.0
Only in netqmail-1.04: qmail-qmqpd.0
Only in netqmail-1.04: qmail-qmtpd.0
Only in netqmail-1.04: qmail-qread.0
Only in netqmail-1.04: qmail-qstat.0
Only in netqmail-1.04: qmail-queue.0
Binary files netqmail-1.04/qmail-remote and ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-remote differ
Only in netqmail-1.04: qmail-remote.0
Only in netqmail-1.04: qmail-rspawn.0
Only in netqmail-1.04: qmail-send.0
Only in netqmail-1.04: qmail-send.8
Binary files netqmail-1.04/qmail-showctl and ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-showctl differ
Only in netqmail-1.04: qmail-showctl.0
diff -c netqmail-1.04/qmail-showctl.c ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-showctl.c
*** netqmail-1.04/qmail-showctl.c	Mon Jun 15 05:53:16 1998
--- ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-showctl.c	Tue Feb  3 15:07:25 2004
***************
*** 15,20 ****
--- 15,21 ----
  #include "auto_patrn.h"
  #include "auto_spawn.h"
  #include "auto_split.h"
+ #include "spf.h"
  
  stralloc me = {0};
  int meok;
***************
*** 257,262 ****
--- 258,267 ----
  
    do_str("smtpgreeting",1,"smtpgreeting","SMTP greeting: 220 ");
    do_lst("smtproutes","No artificial SMTP routes.","SMTP route: ","");
+   do_int("spfbehavior","0","The SPF behavior is ","");
+   do_str("spfrules",0,"","The local SPF rules are: ");
+   do_str("spfguess",0,"","The guess SPF rules are: ");
+   do_str("spfexp",0,SPF_DEFEXP,"The SPF default explanation is: 550 ");
    do_int("timeoutconnect","60","SMTP client connection timeout is "," seconds");
    do_int("timeoutremote","1200","SMTP client data timeout is "," seconds");
    do_int("timeoutsmtpd","1200","SMTP server data timeout is "," seconds");
***************
*** 292,297 ****
--- 297,306 ----
      if (str_equal(d->d_name,"rcpthosts")) continue;
      if (str_equal(d->d_name,"smtpgreeting")) continue;
      if (str_equal(d->d_name,"smtproutes")) continue;
+     if (str_equal(d->d_name,"spfbehavior")) continue;
+     if (str_equal(d->d_name,"spfexp")) continue;
+     if (str_equal(d->d_name,"spfguess")) continue;
+     if (str_equal(d->d_name,"spfrules")) continue;
      if (str_equal(d->d_name,"timeoutconnect")) continue;
      if (str_equal(d->d_name,"timeoutremote")) continue;
      if (str_equal(d->d_name,"timeoutsmtpd")) continue;
Binary files netqmail-1.04/qmail-showctl.o and ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-showctl.o differ
Binary files netqmail-1.04/qmail-smtpd and ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-smtpd differ
Only in netqmail-1.04: qmail-smtpd.0
diff -c netqmail-1.04/qmail-smtpd.8 ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-smtpd.8
*** netqmail-1.04/qmail-smtpd.8	Mon Nov 24 17:16:59 2003
--- ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-smtpd.8	Tue Feb  3 16:01:15 2004
***************
*** 196,201 ****
--- 196,236 ----
  .B qmail-smtpd
  will wait for each new buffer of data from the remote SMTP client.
  Default: 1200.
+ .TP 5
+ .I spfbehavior
+ Set to a value between 1 and 6 to enable SPF checks; 0 to disable.
+ 1 selects 'annotate-only' mode, where
+ .B qmail-smtpd
+ will annotate incoming email with
+ .B Received-SPF
+ fields, but will not reject any messages.  2 will produce temporary
+ failures on DNS lookup problems so you can make sure you always have
+ meaningful Received-SPF headers.  3 selects 'reject' mode,
+ where incoming mail will be rejected if the SPF record says 'fail'.  4
+ selects a more stricter rejection mode, which is like 'reject' mode,
+ except that incoming mail will also be rejected when the SPF record
+ says 'softfail'.  5 will also reject when the SPF record says 'neutral',
+ and 6 if no SPF records are available at all (or a syntax error was
+ encountered). The contents of this file are overridden by the value of
+ the
+ .B SPFBEHAVIOR
+ environment variable, if set.
+ Default: 0.
+ .TP 5
+ .I spfrules
+ You can add a line with SPF rules that will be checked before other SPF
+ rules would fail.  This can be used to always allow certain machines to
+ send certain mails.
+ .TP 5
+ .I spfguess
+ You can add a line with SPF rules that will be checked if a sender
+ domain doesn't have a SPF record. The local rules will also be used
+ in this case.
+ .TP 5
+ .I spfexp
+ You can add a line with a an SPF explanation that will be shown to the
+ sender in case of a reject. It will override the default one. You can
+ use SPF macro expansion.
  .SH "SEE ALSO"
  tcp-env(1),
  tcp-environ(5),
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: qmail-smtpd.8~
diff -c netqmail-1.04/qmail-smtpd.c ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-smtpd.c
*** netqmail-1.04/qmail-smtpd.c	Mon Nov 24 17:16:59 2003
--- ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-smtpd.c	Tue Feb  3 16:03:18 2004
***************
*** 23,28 ****
--- 23,29 ----
  #include "timeoutread.h"
  #include "timeoutwrite.h"
  #include "commands.h"
+ #include "spf.h"
  #include "wait.h"
  #include "fd.h"
  
***************
*** 30,35 ****
--- 31,37 ----
  #define MAXHOPS 100
  unsigned int databytes = 0;
  int timeout = 1200;
+ unsigned int spfbehavior = 0;
  
  int safewrite(fd,buf,len) int fd; char *buf; int len;
  {
***************
*** 73,78 ****
--- 75,83 ----
  int err_input() { out("501 malformed auth input (#5.5.4)\r\n"); return -1; }
  
  stralloc greeting = {0};
+ stralloc spflocal = {0};
+ stralloc spfguess = {0};
+ stralloc spfexp = {0};
  
  void smtp_greet(code) char *code;
  {
***************
*** 134,139 ****
--- 139,157 ----
    if (x) { scan_ulong(x,&u); databytes = u; }
    if (!(databytes + 1)) --databytes;
   
+   if (control_readint(&spfbehavior,"control/spfbehavior") == -1)
+     die_control();
+   x = env_get("SPFBEHAVIOR");
+   if (x) { scan_ulong(x,&u); spfbehavior = u; }
+ 
+   if (control_readline(&spflocal,"control/spfrules") == -1) die_control();
+   if (spflocal.len && !stralloc_0(&spflocal)) die_nomem();
+   if (control_readline(&spfguess,"control/spfguess") == -1) die_control();
+   if (spfguess.len && !stralloc_0(&spfguess)) die_nomem();
+   if (control_rldef(&spfexp,"control/spfexp",0,SPF_DEFEXP) == -1)
+     die_control();
+   if (!stralloc_0(&spfexp)) die_nomem();
+ 
    remoteip = env_get("TCPREMOTEIP");
    if (!remoteip) remoteip = "unknown";
    local = env_get("TCPLOCALHOST");
***************
*** 231,236 ****
--- 249,256 ----
  
  int seenmail = 0;
  int flagbarf; /* defined if seenmail */
+ int flagbarfspf;
+ stralloc spfbarfmsg = {0};
  stralloc mailfrom = {0};
  stralloc rcptto = {0};
  
***************
*** 257,276 ****
--- 277,342 ----
    seenmail = 0;
    out("250 flushed\r\n");
  }
+ 
  void smtp_mail(arg) char *arg;
  {
    if (!addrparse(arg)) { err_syntax(); return; }
    flagbarf = bmfcheck();
+   flagbarfspf = 0;
+   if (spfbehavior && !relayclient)
+    { 
+     switch (spfcheck()) {
+     case SPF_NOMEM:
+       die_nomem();
+     case SPF_ERROR:
+       if (spfbehavior < 1)  break;
+       out("451 SPF lookup failure (#4.3.0)\r\n");
+       return;
+     case SPF_NONE:
+     case SPF_UNKNOWN:
+       if (spfbehavior < 6) break;
+     case SPF_NEUTRAL:
+       if (spfbehavior < 5) break;
+     case SPF_SOFTFAIL:
+       if (spfbehavior < 4) break;
+     case SPF_FAIL:
+       if (spfbehavior < 3) break;
+       if (!spfexplanation(&spfbarfmsg)) die_nomem();
+       if (!stralloc_0(&spfbarfmsg)) die_nomem();
+       flagbarfspf = 1;
+     }
+    } 
    seenmail = 1;
    if (!stralloc_copys(&rcptto,"")) die_nomem();
    if (!stralloc_copys(&mailfrom,addr.s)) die_nomem();
    if (!stralloc_0(&mailfrom)) die_nomem();
    out("250 ok\r\n");
  }
+ 
+ void err_spf() {
+   int i,j;
+ 
+   for(i = 0; i < spfbarfmsg.len; i = j + 1) {
+     j = byte_chr(spfbarfmsg.s + i, spfbarfmsg.len - i, '\n') + i;
+     if (j < spfbarfmsg.len) {
+       out("550-");
+       spfbarfmsg.s[j] = 0;
+       out(spfbarfmsg.s);
+       spfbarfmsg.s[j] = '\n';
+       out("\r\n");
+     } else {
+       out("550 ");
+       out(spfbarfmsg.s);
+       out(" (#5.7.1)\r\n");
+     }
+   }
+ }
+ 
  void smtp_rcpt(arg) char *arg; {
    if (!seenmail) { err_wantmail(); return; }
    if (!addrparse(arg)) { err_syntax(); return; }
    if (flagbarf) { err_bmf(); return; }
+   if (flagbarfspf) { err_spf(); return; }
    if (relayclient) {
      --addr.len;
      if (!stralloc_cats(&addr,relayclient)) die_nomem();
***************
*** 371,376 ****
--- 437,461 ----
    }
  }
  
+ void spfreceived()
+ {
+   stralloc sa = {0};
+   stralloc rcvd_spf = {0};
+ 
+   if (!spfbehavior || relayclient) return;
+ 
+   if (!stralloc_copys(&rcvd_spf, "Received-SPF: ")) die_nomem();
+   if (!spfinfo(&sa)) die_nomem();
+   if (!stralloc_cat(&rcvd_spf, &sa)) die_nomem();
+   if (!stralloc_append(&rcvd_spf, "\n")) die_nomem();
+   if (bytestooverflow) {
+     bytestooverflow -= rcvd_spf.len;
+     if (bytestooverflow <= 0) qmail_fail(&qqt);
+   }
+   qmail_put(&qqt,rcvd_spf.s,rcvd_spf.len);
+ }
+ 
+ 
  char accept_buf[FMT_ULONG];
  void acceptmessage(qp) unsigned long qp;
  {
***************
*** 399,404 ****
--- 484,490 ----
    out("354 go ahead\r\n");
   
    received(&qqt,"SMTP",local,remoteip,remotehost,remoteinfo,fakehelo);
+   spfreceived();
    blast(&hops);
    hops = (hops >= MAXHOPS);
    if (hops) qmail_fail(&qqt);
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: qmail-smtpd.c.rej
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: qmail-smtpd.c~
Binary files netqmail-1.04/qmail-smtpd.o and ../netqmail-1.04-auth-spf/netqmail-1.04/qmail-smtpd.o differ
Only in netqmail-1.04: qmail-start.0
Only in netqmail-1.04: qmail-start.8
Only in netqmail-1.04: qmail-tcpok.0
Only in netqmail-1.04: qmail-tcpto.0
Only in netqmail-1.04: qmail-users.0
Only in netqmail-1.04: qmail-users.5
Only in netqmail-1.04: qmail.0
Only in netqmail-1.04: qreceipt.0
Binary files netqmail-1.04/seek.a and ../netqmail-1.04-auth-spf/netqmail-1.04/seek.a differ
Binary files netqmail-1.04/sig.a and ../netqmail-1.04-auth-spf/netqmail-1.04/sig.a differ
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: spf.c
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: spf.h
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: spf.o
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: spfquery
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: spfquery.c
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: spfquery.o
Only in netqmail-1.04: splogger.0
Binary files netqmail-1.04/str.a and ../netqmail-1.04-auth-spf/netqmail-1.04/str.a differ
diff -c netqmail-1.04/str.h ../netqmail-1.04-auth-spf/netqmail-1.04/str.h
*** netqmail-1.04/str.h	Mon Jun 15 05:53:16 1998
--- ../netqmail-1.04-auth-spf/netqmail-1.04/str.h	Tue Feb  3 15:07:25 2004
***************
*** 2,7 ****
--- 2,8 ----
  #define STR_H
  
  extern unsigned int str_copy();
+ extern unsigned int str_copyb();
  extern int str_diff();
  extern int str_diffn();
  extern unsigned int str_len();
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: str_cpyb.c
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: str_cpyb.o
Binary files netqmail-1.04/stralloc.a and ../netqmail-1.04-auth-spf/netqmail-1.04/stralloc.a differ
Binary files netqmail-1.04/strerr.a and ../netqmail-1.04-auth-spf/netqmail-1.04/strerr.a differ
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: strsalloc.c
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: strsalloc.h
Only in ../netqmail-1.04-auth-spf/netqmail-1.04: strsalloc.o
Binary files netqmail-1.04/substdio.a and ../netqmail-1.04-auth-spf/netqmail-1.04/substdio.a differ
Binary files netqmail-1.04/tcp-env and ../netqmail-1.04-auth-spf/netqmail-1.04/tcp-env differ
Only in netqmail-1.04: tcp-env.0
diff -c netqmail-1.04/tcp-env.c ../netqmail-1.04-auth-spf/netqmail-1.04/tcp-env.c
*** netqmail-1.04/tcp-env.c	Mon Jun 15 05:53:16 1998
--- ../netqmail-1.04-auth-spf/netqmail-1.04/tcp-env.c	Tue Feb  3 15:07:25 2004
***************
*** 10,15 ****
--- 10,16 ----
  #include "scan.h"
  #include "subgetopt.h"
  #include "ip.h"
+ #include "strsalloc.h"
  #include "dns.h"
  #include "byte.h"
  #include "remoteinfo.h"
***************
*** 34,39 ****
--- 35,41 ----
  int argc;
  char *argv[];
  {
+  strsalloc ssa = {0};
   int dummy;
   char *proto;
   int opt;
***************
*** 74,85 ****
     temp[ip_fmt(temp,&iplocal)] = 0;
     if (!env_put2("TCPLOCALIP",temp)) die();
  
!    switch(dns_ptr(&localname,&iplocal))
      {
       case DNS_MEM: die();
       case DNS_SOFT:
         if (!stralloc_copys(&localname,"softdnserror")) die();
       case 0:
         if (!stralloc_0(&localname)) die();
         case_lowers(localname.s);
         if (!env_put2("TCPLOCALHOST",localname.s)) die();
--- 76,88 ----
     temp[ip_fmt(temp,&iplocal)] = 0;
     if (!env_put2("TCPLOCALIP",temp)) die();
  
!    switch(dns_ptr(&ssa,&iplocal))
      {
       case DNS_MEM: die();
       case DNS_SOFT:
         if (!stralloc_copys(&localname,"softdnserror")) die();
       case 0:
+        if (!stralloc_copy(&localname,&ssa.sa[0])) die();
         if (!stralloc_0(&localname)) die();
         case_lowers(localname.s);
         if (!env_put2("TCPLOCALHOST",localname.s)) die();
***************
*** 99,110 ****
     temp[ip_fmt(temp,&ipremote)] = 0;
     if (!env_put2("TCPREMOTEIP",temp)) die();
  
!    switch(dns_ptr(&remotename,&ipremote))
      {
       case DNS_MEM: die();
       case DNS_SOFT:
         if (!stralloc_copys(&remotename,"softdnserror")) die();
       case 0:
         if (!stralloc_0(&remotename)) die();
         case_lowers(remotename.s);
         if (!env_put2("TCPREMOTEHOST",remotename.s)) die();
--- 102,114 ----
     temp[ip_fmt(temp,&ipremote)] = 0;
     if (!env_put2("TCPREMOTEIP",temp)) die();
  
!    switch(dns_ptr(&ssa,&ipremote))
      {
       case DNS_MEM: die();
       case DNS_SOFT:
         if (!stralloc_copys(&remotename,"softdnserror")) die();
       case 0:
+        if (!stralloc_copy(&remotename,&ssa.sa[0])) die();
         if (!stralloc_0(&remotename)) die();
         case_lowers(remotename.s);
         if (!env_put2("TCPREMOTEHOST",remotename.s)) die();
Binary files netqmail-1.04/tcp-env.o and ../netqmail-1.04-auth-spf/netqmail-1.04/tcp-env.o differ
Only in netqmail-1.04: tcp-environ.0
Binary files netqmail-1.04/wait.a and ../netqmail-1.04-auth-spf/netqmail-1.04/wait.a differ
