Merge ~ahasenack/ubuntu/+source/exim4:bionic-exim4-uninitialized-1786508 into ubuntu/+source/exim4:ubuntu/bionic-devel

Proposed by Andreas Hasenack
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 191ee014ec2b07202a9bef3f380612b14e4e3178
Merge reported by: Christian Ehrhardt 
Merged at revision: 191ee014ec2b07202a9bef3f380612b14e4e3178
Proposed branch: ~ahasenack/ubuntu/+source/exim4:bionic-exim4-uninitialized-1786508
Merge into: ubuntu/+source/exim4:ubuntu/bionic-devel
Diff against target: 304134 lines (+300414/-0)
620 files modified
Makefile (+115/-0)
NOTICE (+152/-0)
OS/Makefile-Base (+980/-0)
OS/Makefile-Default (+321/-0)
OS/Makefile-FreeBSD (+54/-0)
OS/Makefile-Linux (+36/-0)
OS/Makefile-OpenBSD (+28/-0)
OS/Makefile-SunOS5 (+24/-0)
OS/eximon.conf-Default (+41/-0)
OS/os.Configuring (+215/-0)
OS/os.c-FreeBSD (+24/-0)
OS/os.c-Linux (+165/-0)
OS/os.c-SunOS5 (+16/-0)
OS/os.h-FreeBSD (+68/-0)
OS/os.h-Linux (+88/-0)
OS/os.h-OpenBSD (+56/-0)
OS/os.h-SunOS5 (+51/-0)
OS/unsupported/Makefile-AIX (+28/-0)
OS/unsupported/Makefile-BSDI (+21/-0)
OS/unsupported/Makefile-CYGWIN (+113/-0)
OS/unsupported/Makefile-DGUX (+32/-0)
OS/unsupported/Makefile-Darwin (+29/-0)
OS/unsupported/Makefile-DragonFly (+31/-0)
OS/unsupported/Makefile-GNU (+29/-0)
OS/unsupported/Makefile-GNUkFreeBSD (+29/-0)
OS/unsupported/Makefile-GNUkNetBSD (+29/-0)
OS/unsupported/Makefile-HI-OSF (+8/-0)
OS/unsupported/Makefile-HI-UX (+12/-0)
OS/unsupported/Makefile-HP-UX (+27/-0)
OS/unsupported/Makefile-HP-UX-9 (+15/-0)
OS/unsupported/Makefile-IRIX (+12/-0)
OS/unsupported/Makefile-IRIX6 (+13/-0)
OS/unsupported/Makefile-IRIX632 (+16/-0)
OS/unsupported/Makefile-IRIX65 (+16/-0)
OS/unsupported/Makefile-NetBSD (+27/-0)
OS/unsupported/Makefile-NetBSD-a.out (+24/-0)
OS/unsupported/Makefile-OSF1 (+10/-0)
OS/unsupported/Makefile-OpenUNIX (+17/-0)
OS/unsupported/Makefile-QNX (+30/-0)
OS/unsupported/Makefile-SCO (+28/-0)
OS/unsupported/Makefile-SCO_SV (+34/-0)
OS/unsupported/Makefile-SunOS4 (+16/-0)
OS/unsupported/Makefile-SunOS5-hal (+18/-0)
OS/unsupported/Makefile-ULTRIX (+18/-0)
OS/unsupported/Makefile-UNIX_SV (+24/-0)
OS/unsupported/Makefile-USG (+33/-0)
OS/unsupported/Makefile-Unixware7 (+32/-0)
OS/unsupported/Makefile-mips (+16/-0)
OS/unsupported/README (+14/-0)
OS/unsupported/os.c-BSDI (+19/-0)
OS/unsupported/os.c-GNU (+55/-0)
OS/unsupported/os.c-HI-OSF (+35/-0)
OS/unsupported/os.c-HP-UX (+16/-0)
OS/unsupported/os.c-IRIX (+118/-0)
OS/unsupported/os.c-IRIX6 (+118/-0)
OS/unsupported/os.c-IRIX632 (+118/-0)
OS/unsupported/os.c-IRIX65 (+118/-0)
OS/unsupported/os.c-OSF1 (+36/-0)
OS/unsupported/os.c-cygwin (+531/-0)
OS/unsupported/os.h-AIX (+27/-0)
OS/unsupported/os.h-BSDI (+15/-0)
OS/unsupported/os.h-DGUX (+28/-0)
OS/unsupported/os.h-Darwin (+48/-0)
OS/unsupported/os.h-DragonFly (+13/-0)
OS/unsupported/os.h-GNU (+23/-0)
OS/unsupported/os.h-GNUkFreeBSD (+25/-0)
OS/unsupported/os.h-GNUkNetBSD (+25/-0)
OS/unsupported/os.h-HI-OSF (+12/-0)
OS/unsupported/os.h-HI-UX (+21/-0)
OS/unsupported/os.h-HP-UX (+34/-0)
OS/unsupported/os.h-HP-UX-9 (+23/-0)
OS/unsupported/os.h-IRIX (+17/-0)
OS/unsupported/os.h-IRIX6 (+16/-0)
OS/unsupported/os.h-IRIX632 (+18/-0)
OS/unsupported/os.h-IRIX65 (+16/-0)
OS/unsupported/os.h-NetBSD (+28/-0)
OS/unsupported/os.h-NetBSD-a.out (+5/-0)
OS/unsupported/os.h-OSF1 (+16/-0)
OS/unsupported/os.h-OpenUNIX (+19/-0)
OS/unsupported/os.h-QNX (+24/-0)
OS/unsupported/os.h-SCO (+21/-0)
OS/unsupported/os.h-SCO_SV (+19/-0)
OS/unsupported/os.h-SunOS4 (+39/-0)
OS/unsupported/os.h-SunOS5-hal (+14/-0)
OS/unsupported/os.h-ULTRIX (+18/-0)
OS/unsupported/os.h-UNIX_SV (+25/-0)
OS/unsupported/os.h-USG (+19/-0)
OS/unsupported/os.h-Unixware7 (+18/-0)
OS/unsupported/os.h-cygwin (+41/-0)
OS/unsupported/os.h-mips (+27/-0)
README (+349/-0)
README.DSN (+141/-0)
README.UPDATING (+790/-0)
conf (+2/-0)
debian/EDITME.exim4-heavy.diff (+158/-0)
debian/EDITME.exim4-light.diff (+229/-0)
debian/EDITME.eximon.diff (+10/-0)
debian/EDITME.openssl.exim4-light.diff (+19/-0)
debian/NEWS (+450/-0)
debian/README.Debian.xml (+1961/-0)
debian/TODO (+2/-0)
debian/changelog (+5626/-0)
debian/changelog.Debian.old (+1128/-0)
debian/compat (+1/-0)
debian/config-custom/create-custom-config-package (+71/-0)
debian/config-custom/debian/compat (+1/-0)
debian/config-custom/debian/control (+18/-0)
debian/config-custom/debian/copyright (+15/-0)
debian/config-custom/debian/install (+2/-0)
debian/config-custom/debian/rules (+94/-0)
debian/control (+251/-0)
debian/copyright (+229/-0)
debian/create-custom-package (+95/-0)
debian/debconf/conf.d/acl/00_exim4-config_header (+8/-0)
debian/debconf/conf.d/acl/20_exim4-config_local_deny_exceptions (+49/-0)
debian/debconf/conf.d/acl/30_exim4-config_check_mail (+11/-0)
debian/debconf/conf.d/acl/30_exim4-config_check_rcpt (+363/-0)
debian/debconf/conf.d/acl/40_exim4-config_check_data (+84/-0)
debian/debconf/conf.d/auth/00_exim4-config_header (+8/-0)
debian/debconf/conf.d/auth/30_exim4-config_examples (+254/-0)
debian/debconf/conf.d/main/01_exim4-config_listmacrosdefs (+101/-0)
debian/debconf/conf.d/main/02_exim4-config_options (+218/-0)
debian/debconf/conf.d/main/03_exim4-config_tlsoptions (+85/-0)
debian/debconf/conf.d/main/90_exim4-config_log_selector (+10/-0)
debian/debconf/conf.d/retry/00_exim4-config_header (+7/-0)
debian/debconf/conf.d/retry/30_exim4-config (+19/-0)
debian/debconf/conf.d/rewrite/00_exim4-config_header (+7/-0)
debian/debconf/conf.d/rewrite/31_exim4-config_rewriting (+16/-0)
debian/debconf/conf.d/router/00_exim4-config_header (+11/-0)
debian/debconf/conf.d/router/100_exim4-config_domain_literal (+18/-0)
debian/debconf/conf.d/router/150_exim4-config_hubbed_hosts (+18/-0)
debian/debconf/conf.d/router/200_exim4-config_primary (+90/-0)
debian/debconf/conf.d/router/300_exim4-config_real_local (+22/-0)
debian/debconf/conf.d/router/400_exim4-config_system_aliases (+44/-0)
debian/debconf/conf.d/router/500_exim4-config_hubuser (+31/-0)
debian/debconf/conf.d/router/600_exim4-config_userforward (+51/-0)
debian/debconf/conf.d/router/700_exim4-config_procmail (+15/-0)
debian/debconf/conf.d/router/800_exim4-config_maildrop (+14/-0)
debian/debconf/conf.d/router/850_exim4-config_lowuid (+29/-0)
debian/debconf/conf.d/router/900_exim4-config_local_user (+15/-0)
debian/debconf/conf.d/router/mmm_mail4root (+17/-0)
debian/debconf/conf.d/transport/00_exim4-config_header (+13/-0)
debian/debconf/conf.d/transport/10_exim4-config_transport-macros (+16/-0)
debian/debconf/conf.d/transport/30_exim4-config_address_file (+11/-0)
debian/debconf/conf.d/transport/30_exim4-config_address_pipe (+10/-0)
debian/debconf/conf.d/transport/30_exim4-config_address_reply (+8/-0)
debian/debconf/conf.d/transport/30_exim4-config_mail_spool (+17/-0)
debian/debconf/conf.d/transport/30_exim4-config_maildir_home (+41/-0)
debian/debconf/conf.d/transport/30_exim4-config_maildrop_pipe (+12/-0)
debian/debconf/conf.d/transport/30_exim4-config_procmail_pipe (+10/-0)
debian/debconf/conf.d/transport/30_exim4-config_remote_smtp (+53/-0)
debian/debconf/conf.d/transport/30_exim4-config_remote_smtp_smarthost (+47/-0)
debian/debconf/conf.d/transport/35_exim4-config_address_directory (+14/-0)
debian/debconf/update-exim4.conf (+484/-0)
debian/debconf/update-exim4.conf.template (+139/-0)
debian/e-n-if-up (+37/-0)
debian/email-addresses (+9/-0)
debian/example.conf.md5 (+1/-0)
debian/exim-adduser (+52/-0)
debian/exim-gencert (+78/-0)
debian/exim4-base.config (+15/-0)
debian/exim4-base.cron.daily (+105/-0)
debian/exim4-base.dirs (+5/-0)
debian/exim4-base.doc-base.debian (+9/-0)
debian/exim4-base.doc-base.filter (+8/-0)
debian/exim4-base.doc-base.spec (+8/-0)
debian/exim4-base.docs (+15/-0)
debian/exim4-base.examples (+5/-0)
debian/exim4-base.exim4-paniclog.logrotate (+10/-0)
debian/exim4-base.exim4.init (+279/-0)
debian/exim4-base.install (+3/-0)
debian/exim4-base.links (+3/-0)
debian/exim4-base.logrotate (+9/-0)
debian/exim4-base.manpages (+12/-0)
debian/exim4-base.postinst (+103/-0)
debian/exim4-base.postrm (+65/-0)
debian/exim4-base.preinst (+35/-0)
debian/exim4-base.templates (+17/-0)
debian/exim4-config.config (+820/-0)
debian/exim4-config.dirs (+6/-0)
debian/exim4-config.docs (+1/-0)
debian/exim4-config.examples (+1/-0)
debian/exim4-config.exim4.ppp.ip-up (+15/-0)
debian/exim4-config.install (+3/-0)
debian/exim4-config.links (+15/-0)
debian/exim4-config.lintian-overrides (+1/-0)
debian/exim4-config.manpages (+4/-0)
debian/exim4-config.postinst (+408/-0)
debian/exim4-config.postrm (+30/-0)
debian/exim4-config.preinst (+39/-0)
debian/exim4-config.templates (+196/-0)
debian/exim4-daemon-custom.dirs (+3/-0)
debian/exim4-daemon-custom.docs (+1/-0)
debian/exim4-daemon-custom.install (+1/-0)
debian/exim4-daemon-custom.links (+18/-0)
debian/exim4-daemon-heavy.config (+17/-0)
debian/exim4-daemon-heavy.dirs (+4/-0)
debian/exim4-daemon-heavy.docs (+1/-0)
debian/exim4-daemon-heavy.install (+1/-0)
debian/exim4-daemon-heavy.links (+18/-0)
debian/exim4-daemon-heavy.lintian-overrides (+2/-0)
debian/exim4-daemon-heavy.templates (+5/-0)
debian/exim4-daemon-light.config (+17/-0)
debian/exim4-daemon-light.dirs (+3/-0)
debian/exim4-daemon-light.docs (+1/-0)
debian/exim4-daemon-light.install (+1/-0)
debian/exim4-daemon-light.links (+18/-0)
debian/exim4-daemon-light.lintian-overrides (+1/-0)
debian/exim4-daemon-light.postinst (+60/-0)
debian/exim4-daemon-light.prerm (+33/-0)
debian/exim4-daemon-light.templates (+5/-0)
debian/exim4-dev.install (+4/-0)
debian/exim4-dev.links (+2/-0)
debian/exim4-dev.manpages (+1/-0)
debian/exim4-localscan-plugin-config (+12/-0)
debian/exim4-localscan-plugin-config.1 (+40/-0)
debian/exim4-localscan-plugin-config.1.xml (+82/-0)
debian/exim4.config (+17/-0)
debian/exim4.install (+1/-0)
debian/exim4.links (+1/-0)
debian/exim4.postinst (+14/-0)
debian/exim4.templates (+5/-0)
debian/exim4_refresh_gnutls-params (+52/-0)
debian/eximon4.dirs (+2/-0)
debian/eximon4.links (+1/-0)
debian/eximon4.manpages (+1/-0)
debian/eximonconf-patch (+7/-0)
debian/gnutls-params-2048 (+31/-0)
debian/lynx-dump-postprocess (+49/-0)
debian/manpages/exicyclog.8 (+75/-0)
debian/manpages/exigrep.8 (+70/-0)
debian/manpages/exim4-config_files.5 (+364/-0)
debian/manpages/exim_checkaccess.8 (+80/-0)
debian/manpages/exim_convert4r4.8 (+73/-0)
debian/manpages/exim_db.8 (+193/-0)
debian/manpages/exim_dbmbuild.8 (+105/-0)
debian/manpages/exim_lock.8 (+137/-0)
debian/manpages/eximon.8 (+50/-0)
debian/manpages/exinext.8 (+73/-0)
debian/manpages/exiqgrep.8 (+88/-0)
debian/manpages/exiqsumm.8 (+74/-0)
debian/manpages/exiwhat.8 (+102/-0)
debian/manpages/update-exim4.conf.8 (+346/-0)
debian/manpages/update-exim4.conf.template.8 (+92/-0)
debian/manpages/update-exim4defaults.8 (+173/-0)
debian/minimaltest (+87/-0)
debian/mtalist (+1/-0)
debian/passwd.client (+7/-0)
debian/patches/31_eximmanpage.dpatch (+250/-0)
debian/patches/32_exim4.dpatch (+106/-0)
debian/patches/33_eximon.binary.dpatch (+18/-0)
debian/patches/34_eximstatsmanpage.dpatch (+20/-0)
debian/patches/35_install.dpatch (+49/-0)
debian/patches/50_localscan_dlopen.dpatch (+280/-0)
debian/patches/60_convert4r4.dpatch (+41/-0)
debian/patches/67_unnecessaryCopt.diff (+69/-0)
debian/patches/70_remove_exim-users_references.dpatch (+40/-0)
debian/patches/eximstats_unitialized_value.patch (+20/-0)
debian/patches/fix_smtp_banner.patch (+52/-0)
debian/patches/series (+11/-0)
debian/po/POTFILES.in (+5/-0)
debian/po/ar.po (+627/-0)
debian/po/ast.po (+645/-0)
debian/po/be.po (+636/-0)
debian/po/bg.po (+809/-0)
debian/po/bn.po (+614/-0)
debian/po/bs.po (+812/-0)
debian/po/ca.po (+826/-0)
debian/po/cs.po (+685/-0)
debian/po/cy.po (+765/-0)
debian/po/da.po (+650/-0)
debian/po/de.po (+690/-0)
debian/po/dz.po (+814/-0)
debian/po/el.po (+668/-0)
debian/po/eo.po (+631/-0)
debian/po/es.po (+936/-0)
debian/po/et.po (+751/-0)
debian/po/eu.po (+657/-0)
debian/po/fi.po (+939/-0)
debian/po/fr.po (+682/-0)
debian/po/gl.po (+788/-0)
debian/po/he.po (+617/-0)
debian/po/hr.po (+618/-0)
debian/po/hu.po (+880/-0)
debian/po/id.po (+830/-0)
debian/po/it.po (+628/-0)
debian/po/ja.po (+627/-0)
debian/po/kk.po (+610/-0)
debian/po/km.po (+627/-0)
debian/po/ko.po (+782/-0)
debian/po/lt.po (+661/-0)
debian/po/mk.po (+770/-0)
debian/po/ml.po (+631/-0)
debian/po/mr.po (+759/-0)
debian/po/nb.po (+663/-0)
debian/po/ne.po (+611/-0)
debian/po/nl.po (+687/-0)
debian/po/nn.po (+660/-0)
debian/po/pa.po (+609/-0)
debian/po/pl.po (+636/-0)
debian/po/pt.po (+888/-0)
debian/po/pt_BR.po (+673/-0)
debian/po/ro.po (+861/-0)
debian/po/ru.po (+644/-0)
debian/po/sk.po (+638/-0)
debian/po/sl.po (+832/-0)
debian/po/sq.po (+813/-0)
debian/po/sv.po (+747/-0)
debian/po/ta.po (+628/-0)
debian/po/templates.pot (+518/-0)
debian/po/th.po (+752/-0)
debian/po/tl.po (+772/-0)
debian/po/tr.po (+640/-0)
debian/po/uk.po (+682/-0)
debian/po/vi.po (+628/-0)
debian/po/wo.po (+652/-0)
debian/po/zh_CN.po (+602/-0)
debian/po/zh_TW.po (+637/-0)
debian/rules (+295/-0)
debian/script (+28/-0)
debian/source/format (+1/-0)
debian/syslog2eximlog (+60/-0)
debian/tests/CVE-2010-4344.py (+143/-0)
debian/tests/control (+3/-0)
debian/tests/daemon (+13/-0)
debian/tests/security (+6/-0)
debian/update-exim4defaults (+284/-0)
debian/upstream/signing-key.asc (+777/-0)
debian/watch (+3/-0)
doc/ChangeLog (+7030/-0)
doc/DANE-draft-notes (+11/-0)
doc/Exim3.upgrade (+671/-0)
doc/Exim4.upgrade (+1730/-0)
doc/GnuTLS-FAQ.txt (+410/-0)
doc/NewStuff (+1198/-0)
doc/OptionLists.txt (+1049/-0)
doc/README (+65/-0)
doc/README.SIEVE (+343/-0)
doc/cve-2016-9663 (+95/-0)
doc/dbm.discuss.txt (+320/-0)
doc/exim.8 (+1701/-0)
doc/experimental-spec.txt (+1080/-0)
doc/filter.txt (+1724/-0)
doc/openssl.txt (+117/-0)
doc/spec.txt (+36673/-0)
exim_monitor/EDITME (+179/-0)
exim_monitor/em_StripChart.c (+504/-0)
exim_monitor/em_TextPop.c (+767/-0)
exim_monitor/em_globals.c (+243/-0)
exim_monitor/em_hdr.h (+329/-0)
exim_monitor/em_init.c (+237/-0)
exim_monitor/em_log.c (+410/-0)
exim_monitor/em_main.c (+944/-0)
exim_monitor/em_menu.c (+994/-0)
exim_monitor/em_queue.c (+830/-0)
exim_monitor/em_strip.c (+266/-0)
exim_monitor/em_text.c (+73/-0)
exim_monitor/em_version.c (+50/-0)
exim_monitor/em_xs.c (+45/-0)
scripts/Configure (+10/-0)
scripts/Configure-Makefile (+339/-0)
scripts/Configure-config.h (+60/-0)
scripts/Configure-eximon (+51/-0)
scripts/Configure-os.c (+30/-0)
scripts/Configure-os.h (+51/-0)
scripts/MakeLinks (+132/-0)
scripts/arch-type (+74/-0)
scripts/exim_install (+472/-0)
scripts/lookups-Makefile (+194/-0)
scripts/newer (+21/-0)
scripts/os-type (+164/-0)
scripts/reversion (+124/-0)
scripts/source_checks (+52/-0)
src/EDITME (+1415/-0)
src/acl.c (+4570/-0)
src/aliases.default (+40/-0)
src/auths/Makefile (+45/-0)
src/auths/README (+98/-0)
src/auths/auth-spa.c (+1534/-0)
src/auths/auth-spa.h (+92/-0)
src/auths/call_pam.c (+205/-0)
src/auths/call_pwcheck.c (+120/-0)
src/auths/call_radius.c (+237/-0)
src/auths/check_serv_cond.c (+130/-0)
src/auths/cram_md5.c (+362/-0)
src/auths/cram_md5.h (+32/-0)
src/auths/cyrus_sasl.c (+545/-0)
src/auths/cyrus_sasl.h (+36/-0)
src/auths/dovecot.c (+513/-0)
src/auths/dovecot.h (+28/-0)
src/auths/get_data.c (+47/-0)
src/auths/get_no64_data.c (+47/-0)
src/auths/gsasl_exim.c (+634/-0)
src/auths/gsasl_exim.h (+42/-0)
src/auths/heimdal_gssapi.c (+610/-0)
src/auths/heimdal_gssapi.h (+39/-0)
src/auths/md5.c (+357/-0)
src/auths/plaintext.c (+310/-0)
src/auths/plaintext.h (+32/-0)
src/auths/pwcheck.c (+453/-0)
src/auths/pwcheck.h (+27/-0)
src/auths/spa.c (+377/-0)
src/auths/spa.h (+39/-0)
src/auths/tls.c (+94/-0)
src/auths/tls.h (+30/-0)
src/auths/xtextdecode.c (+57/-0)
src/auths/xtextencode.c (+57/-0)
src/base64.c (+289/-0)
src/blob.h (+15/-0)
src/bmi_spam.c (+470/-0)
src/bmi_spam.h (+22/-0)
src/buildconfig.c (+965/-0)
src/child.c (+520/-0)
src/config.h.defaults (+211/-0)
src/configure.default (+869/-0)
src/convert4r3.src (+1382/-0)
src/convert4r4.src (+2527/-0)
src/crypt16.c (+77/-0)
src/daemon.c (+2112/-0)
src/dane-gnu.c (+21/-0)
src/dane-openssl.c (+1721/-0)
src/dane.c (+50/-0)
src/danessl.h (+47/-0)
src/dbfn.c (+700/-0)
src/dbfunctions.h (+33/-0)
src/dbstuff.h (+786/-0)
src/dcc.c (+512/-0)
src/dcc.h (+16/-0)
src/debug.c (+271/-0)
src/deliver.c (+8592/-0)
src/directory.c (+96/-0)
src/dkim.c (+763/-0)
src/dkim.h (+32/-0)
src/dkim_transport.c (+377/-0)
src/dmarc.c (+638/-0)
src/dmarc.h (+61/-0)
src/dns.c (+1228/-0)
src/drtables.c (+728/-0)
src/dummies.c (+148/-0)
src/enq.c (+122/-0)
src/environment.c (+72/-0)
src/exicyclog.src (+350/-0)
src/exigrep.src (+374/-0)
src/exim.c (+5850/-0)
src/exim.h (+607/-0)
src/exim_checkaccess.src (+181/-0)
src/exim_dbmbuild.c (+510/-0)
src/exim_dbutil.c (+1358/-0)
src/exim_lock.c (+664/-0)
src/eximon.src (+221/-0)
src/eximstats.src (+4246/-0)
src/exinext.src (+262/-0)
src/exipick.src (+1845/-0)
src/exiqgrep.src (+209/-0)
src/exiqsumm.src (+178/-0)
src/exiwhat.src (+142/-0)
src/expand.c (+7998/-0)
src/filter.c (+2601/-0)
src/filtertest.c (+281/-0)
src/functions.h (+546/-0)
src/globals.c (+1558/-0)
src/globals.h (+984/-0)
src/hash.c (+821/-0)
src/hash.h (+79/-0)
src/header.c (+463/-0)
src/host.c (+3360/-0)
src/imap_utf7.c (+211/-0)
src/ip.c (+806/-0)
src/local_scan.c (+64/-0)
src/local_scan.h (+195/-0)
src/log.c (+1446/-0)
src/lookupapi.h (+60/-0)
src/lookups/Makefile (+71/-0)
src/lookups/README (+175/-0)
src/lookups/cdb.c (+513/-0)
src/lookups/dbmdb.c (+287/-0)
src/lookups/dnsdb.c (+611/-0)
src/lookups/dsearch.c (+157/-0)
src/lookups/ibase.c (+585/-0)
src/lookups/ldap.c (+1684/-0)
src/lookups/ldap.h (+13/-0)
src/lookups/lf_check_file.c (+113/-0)
src/lookups/lf_functions.h (+18/-0)
src/lookups/lf_quote.c (+64/-0)
src/lookups/lf_sqlperform.c (+138/-0)
src/lookups/lmdb.c (+160/-0)
src/lookups/lsearch.c (+484/-0)
src/lookups/mysql.c (+505/-0)
src/lookups/nis.c (+137/-0)
src/lookups/nisplus.c (+293/-0)
src/lookups/oracle.c (+631/-0)
src/lookups/passwd.c (+90/-0)
src/lookups/pgsql.c (+510/-0)
src/lookups/redis.c (+458/-0)
src/lookups/spf.c (+121/-0)
src/lookups/sqlite.c (+187/-0)
src/lookups/testdb.c (+103/-0)
src/lookups/whoson.c (+101/-0)
src/lss.c (+142/-0)
src/macro_predef.c (+296/-0)
src/macro_predef.h (+20/-0)
src/macros.h (+995/-0)
src/malware.c (+2123/-0)
src/match.c (+1344/-0)
src/memcheck.h (+277/-0)
src/mime.c (+811/-0)
src/mime.h (+44/-0)
src/moan.c (+773/-0)
src/mytypes.h (+120/-0)
src/os.c (+970/-0)
src/osfunctions.h (+42/-0)
src/parse.c (+2241/-0)
src/pdkim/Makefile (+19/-0)
src/pdkim/README (+9/-0)
src/pdkim/config.h (+4/-0)
src/pdkim/crypt_ver.h (+26/-0)
src/pdkim/pdkim.c (+1838/-0)
src/pdkim/pdkim.h (+323/-0)
src/pdkim/pdkim_hash.h (+38/-0)
src/pdkim/signing.c (+715/-0)
src/pdkim/signing.h (+83/-0)
src/perl.c (+197/-0)
src/queue.c (+1452/-0)
src/rda.c (+1002/-0)
src/readconf.c (+4528/-0)
src/receive.c (+4370/-0)
src/regex.c (+211/-0)
src/retry.c (+932/-0)
src/rewrite.c (+833/-0)
src/rfc2047.c (+352/-0)
src/route.c (+1931/-0)
src/routers/Makefile (+43/-0)
src/routers/README (+57/-0)
src/routers/accept.c (+141/-0)
src/routers/accept.h (+31/-0)
src/routers/dnslookup.c (+468/-0)
src/routers/dnslookup.h (+40/-0)
src/routers/ipliteral.c (+205/-0)
src/routers/ipliteral.h (+34/-0)
src/routers/iplookup.c (+420/-0)
src/routers/iplookup.h (+41/-0)
src/routers/manualroute.c (+493/-0)
src/routers/manualroute.h (+39/-0)
src/routers/queryprogram.c (+559/-0)
src/routers/queryprogram.h (+40/-0)
src/routers/redirect.c (+941/-0)
src/routers/redirect.h (+77/-0)
src/routers/rf_change_domain.c (+85/-0)
src/routers/rf_expand_data.c (+48/-0)
src/routers/rf_functions.h (+31/-0)
src/routers/rf_get_errors_address.c (+131/-0)
src/routers/rf_get_munge_headers.c (+121/-0)
src/routers/rf_get_transport.c (+90/-0)
src/routers/rf_get_ugid.c (+80/-0)
src/routers/rf_lookup_hostlist.c (+252/-0)
src/routers/rf_queue_add.c (+108/-0)
src/routers/rf_self_action.c (+141/-0)
src/routers/rf_set_ugid.c (+44/-0)
src/search.c (+828/-0)
src/setenv.c (+59/-0)
src/sha_ver.h (+42/-0)
src/sieve.c (+3677/-0)
src/smtp_in.c (+5752/-0)
src/smtp_out.c (+699/-0)
src/spam.c (+650/-0)
src/spam.h (+38/-0)
src/spf.c (+142/-0)
src/spf.h (+35/-0)
src/spool_in.c (+950/-0)
src/spool_mbox.c (+247/-0)
src/spool_out.c (+531/-0)
src/srs.c (+230/-0)
src/srs.h (+29/-0)
src/std-crypto.c (+1022/-0)
src/store.c (+580/-0)
src/store.h (+53/-0)
src/string.c (+1720/-0)
src/structs.h (+884/-0)
src/tls-gnu.c (+2635/-0)
src/tls-openssl.c (+3127/-0)
src/tls.c (+361/-0)
src/tlscert-gnu.c (+485/-0)
src/tlscert-openssl.c (+532/-0)
src/tod.c (+225/-0)
src/transport-filter.src (+93/-0)
src/transport.c (+2281/-0)
src/transports/Makefile (+27/-0)
src/transports/README (+41/-0)
src/transports/appendfile.c (+3425/-0)
src/transports/appendfile.h (+99/-0)
src/transports/autoreply.c (+883/-0)
src/transports/autoreply.h (+45/-0)
src/transports/lmtp.c (+806/-0)
src/transports/lmtp.h (+32/-0)
src/transports/pipe.c (+1167/-0)
src/transports/pipe.h (+51/-0)
src/transports/queuefile.c (+272/-0)
src/transports/queuefile.h (+29/-0)
src/transports/smtp.c (+4688/-0)
src/transports/smtp.h (+187/-0)
src/transports/smtp_socks.c (+420/-0)
src/transports/tf_maildir.c (+600/-0)
src/transports/tf_maildir.h (+20/-0)
src/tree.c (+365/-0)
src/utf8.c (+273/-0)
src/valgrind.h (+4797/-0)
src/verify.c (+3865/-0)
src/version.c (+68/-0)
src/version.sh (+4/-0)
util/.gitignore (+2/-0)
util/README (+40/-0)
util/chunking_fixqueue_finalnewlines.pl (+160/-0)
util/cramtest.pl (+60/-0)
util/gen_pkcs3.c (+266/-0)
util/logargs.sh (+26/-0)
util/mkcdb.pl (+93/-0)
util/ocsp_fetch.pl (+84/-0)
util/proxy_protocol_client.pl (+251/-0)
util/ratelimit.pl (+159/-0)
util/unknownuser.sh (+32/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
Canonical Server packageset reviewers Pending
Review via email: mp+356437@code.launchpad.net

Description of the change

The launchpad diff is incorrect, please use git for the review.

Fix a warning in the eximstats tool that could become really annoying when the daily cron job is configured to send out a statistics report.

Bileto ticket: https://bileto.ubuntu.com/#/ticket/3468
PPA: ppa:ci-train-ppa-service/3468

The bug has been updated with the SRU template and has detailed testing instructions.

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Small fix, all formal things LGTM.
Testing instructions are good and work for me to trigger the issue.
WOrks fine with the PPA build that also upgraded fine.

I do not see additional regression potential in this, nice small helpful fix +1

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Thanks, tagged and uploaded.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This is in binic-updates, setting MP to merged state

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2new file mode 100644
3index 0000000..9583062
4--- /dev/null
5+++ b/Makefile
6@@ -0,0 +1,115 @@
7+# Top-level makefile for Exim; handles creating a build directory with
8+# appropriate links, and then creating and running the main makefile in that
9+# directory.
10+
11+# Copyright (c) University of Cambridge, 1995 - 2017
12+# See the file NOTICE for conditions of use and distribution.
13+
14+# IRIX make uses the shell that is in the SHELL variable, which often defaults
15+# to csh, so put this in to make it use the Bourne shell. In systems where
16+# /bin/sh is not a Bourne-compatible shell, this line will have to be edited,
17+# or "make" must be called with a different SHELL= setting.
18+
19+SHELL=/bin/sh
20+RM_COMMAND=/bin/rm
21+
22+# If a build name has not been specified by running this make file via a
23+# command of the form "make build=xxxx", then determine the name of the
24+# operating system and the machine architecture and use that. This does not
25+# provide an override for the OS type and architecture type; they still have
26+# to be used for the OS-specific files. To override them, you can set the
27+# shell variables OSTYPE and ARCHTYPE when running make.
28+#
29+# EXIM_BUILD_SUFFIX should be used to enable parallel builds on a file
30+# system shared among different Linux distros (same os-type, same
31+# arch-type). The ../test/runtest script is expected to honour the
32+# EXIM_BUILD_SUFFIX when searching the Exim binary.
33+# NOTE: EXIM_BUILD_SUFFIX is considered *experimental*.
34+
35+buildname=$${build:-`$(SHELL) scripts/os-type`-`$(SHELL) scripts/arch-type`}$${EXIM_BUILD_SUFFIX:+.$$EXIM_BUILD_SUFFIX}
36+
37+# The default target checks for the existence of Local/Makefile, that the main
38+# makefile is built and up-to-date, and then it runs it.
39+
40+all: Local/Makefile configure
41+ @cd build-$(buildname); $(MAKE) SHELL=$(SHELL) $(MFLAGS)
42+
43+
44+# This pair for the convenience of of the Debian maintainers
45+exim: Local/Makefile configure
46+ @cd build-$(buildname); $(MAKE) SHELL=$(SHELL) $(MFLAGS) exim
47+utils: Local/Makefile configure
48+ @cd build-$(buildname); $(MAKE) SHELL=$(SHELL) $(MFLAGS) utils
49+
50+
51+Local/Makefile:
52+ @echo ""
53+ @echo "*** Please create Local/Makefile by copying src/EDITME and making"
54+ @echo "*** appropriate changes for your site."
55+ @echo ""
56+ @test ! -d Local && mkdir Local
57+ @false
58+
59+# This is separated off so that "make build-directory" can be obeyed on
60+# its own if necessary.
61+
62+build-directory:
63+ @builddir=build-$(buildname); \
64+ case "$$builddir" in *UnKnown*) exit 1;; esac; \
65+ $(SHELL) -c "test -d $$builddir -a -r $$builddir/version.c || \
66+ (mkdir $$builddir; cd $$builddir; $(SHELL) ../scripts/MakeLinks)";
67+
68+checks:
69+ $(SHELL) scripts/source_checks
70+
71+# The "configure" target ensures that the build directory exists, then arranges
72+# to build the main makefile from inside the build directory, by calling the
73+# Configure-Makefile script. This does its own dependency checking because of
74+# the optional files.
75+
76+configure: checks build-directory
77+ @cd build-$(buildname); \
78+ build=$(build) $(SHELL) ../scripts/Configure-Makefile
79+
80+# The "makefile" target forces a rebuild of the makefile (as opposed to
81+# "configure", which doesn't force it).
82+
83+makefile: build-directory
84+ @cd build-$(buildname); $(RM_COMMAND) -f Makefile; \
85+ build=$(build) $(SHELL) ../scripts/Configure-Makefile
86+
87+# The installation commands are kept in a separate script, which expects
88+# to be run from inside the build directory.
89+
90+install: all
91+ @cd build-$(buildname); \
92+ build=$(build) $(SHELL) ../scripts/exim_install $(INSTALL_ARG)
93+
94+# Tidy-up targets
95+
96+clean:; @echo ""; echo '*** "make clean" just removes all .o and .a files'
97+ @echo '*** Use "make makefile" to force a rebuild of the makefile'
98+ @echo ""
99+ cd build-$(buildname); \
100+ $(RM_COMMAND) -f *.o lookups/*.o lookups/*.a auths/*.o auths/*.a \
101+ routers/*.o routers/*.a transports/*.o transports/*.a \
102+ pdkim/*.o pdkim/*.a
103+
104+clean_exim:; cd build-$(buildname); \
105+ $(RM_COMMAND) -f *.o lookups/*.o lookups/*.a auths/*.o auths/*.a \
106+ routers/*.o routers/*.a transports/*.o transports/*.a lookups/*.so
107+
108+distclean:; $(RM_COMMAND) -rf build-* cscope*
109+
110+cscope.files: FRC
111+ echo "-q" > $@
112+ echo "-p3" >> $@
113+ find src Local OS exim_monitor -name "*.[cshyl]" -print \
114+ -o -name "os.[ch]*" -print \
115+ -o -name "*akefile*" -print \
116+ -o -name config.h.defaults -print \
117+ -o -name EDITME -print >> $@
118+
119+FRC:
120+
121+# End of top-level makefile
122diff --git a/NOTICE b/NOTICE
123new file mode 100644
124index 0000000..b4a5c40
125--- /dev/null
126+++ b/NOTICE
127@@ -0,0 +1,152 @@
128+THE EXIM MAIL TRANSFER AGENT
129+----------------------------
130+
131+Copyright (c) 2004 University of Cambridge
132+
133+This program is free software; you can redistribute it and/or modify
134+it under the terms of the GNU General Public License as published by
135+the Free Software Foundation; either version 2 of the License, or
136+(at your option) any later version.
137+
138+In addition, for the avoidance of any doubt, permission is granted to
139+link this program with OpenSSL or any other library package and to
140+(re)distribute the binaries produced as the result of such linking.
141+
142+This program is distributed in the hope that it will be useful,
143+but WITHOUT ANY WARRANTY; without even the implied warranty of
144+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
145+GNU General Public License for more details.
146+
147+You should have received a copy of the GNU General Public License
148+along with this program; if not, write to the Free Software
149+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
150+
151+
152+UNSOLICITED EMAIL
153+-----------------
154+
155+The use, supply or promotion of Exim for the purpose of sending bulk,
156+unsolicited electronic mail is incompatible with the basic aims of the program,
157+which revolve around the free provision of a service that enhances the quality
158+of personal communications. The author of Exim regards indiscriminate
159+mass-mailing as an antisocial, irresponsible abuse of the Internet.
160+
161+
162+INCORPORATED CODE
163+-----------------
164+
165+A number of pieces of external code are included in the Exim distribution.
166+
167+ . Support for the cdb (Constant DataBase) lookup method is provided by code
168+ contributed by Nigel Metheringham of Planet Online Ltd. which contains
169+ the following statements:
170+ _________________________________________________________________________
171+
172+ Copyright (c) 1998 Nigel Metheringham, Planet Online Ltd
173+
174+ This program is free software; you can redistribute it and/or modify it
175+ under the terms of the GNU General Public License as published by the
176+ Free Software Foundation; either version 2 of the License, or (at your
177+ option) any later version.
178+
179+ This code implements Dan Bernstein's Constant DataBase (cdb) spec.
180+ Information, the spec and sample code for cdb can be obtained from
181+ http://www.pobox.com/~djb/cdb.html. This implementation borrows some code
182+ from Dan Bernstein's implementation (which has no license restrictions
183+ applied to it).
184+ _________________________________________________________________________
185+
186+ The implementation is completely contained within the code of Exim. It
187+ does not link against an external cdb library.
188+
189+ . Client support for Microsoft's "Secure Password Authentication" is pro-
190+ vided by code contributed by Marc Prud'hommeaux. Server support was
191+ contributed by Tom Kistner. This includes code taken from the Samba
192+ project, which is released under the Gnu GPL.
193+
194+
195+ . Support for calling the Cyrus "pwcheck" and "saslauthd" daemons is
196+ provided by code taken from the Cyrus-SASL library and adapted by
197+ Alexander S. Sabourenkov. The permission notice appears below, in
198+ accordance with the conditions expressed therein.
199+
200+ _________________________________________________________________________
201+
202+ Copyright (c) 2001 Carnegie Mellon University. All rights reserved.
203+
204+ Redistribution and use in source and binary forms, with or without
205+ modification, are permitted provided that the following conditions are
206+ met:
207+
208+ 1. Redistributions of source code must retain the above copyright
209+ notice, this list of conditions and the following disclaimer.
210+
211+ 2. Redistributions in binary form must reproduce the above copyright
212+ notice, this list of conditions and the following disclaimer in the
213+ documentation and/or other materials provided with the distribution.
214+
215+ 3. The name 'Carnegie Mellon University' must not be used to endorse or
216+ promote products derived from this software without prior written
217+ permission. For permission or any other legal details, please
218+ contact
219+
220+ Office of Technology Transfer
221+ Carnegie Mellon University
222+ 5000 Forbes Avenue
223+ Pittsburgh, PA 15213-3890
224+ (412) 268-4387, fax: (412) 268-7395
225+ tech-transfer@andrew.cmu.edu
226+
227+ 4. Redistributions of any form whatsoever must retain the following
228+ acknowledgment:
229+ This product includes software developed by Computing Services at
230+ Carnegie Mellon University (http://www.cmu.edu/computing/).
231+
232+ CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
233+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
234+ FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR ANY
235+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
236+ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
237+ CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
238+ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
239+ _________________________________________________________________________
240+
241+
242+ . The Exim Monitor program, which is an X-Window application, includes
243+ modified versions of the Athena StripChart and TextPop widgets. This code
244+ is copyright by DEC and MIT, and their permission notice appears below,
245+ in accordance with the conditions expressed therein.
246+
247+ _________________________________________________________________________
248+
249+ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard,
250+ Massachusetts, and the Massachusetts Institute of Technology, Cambridge,
251+ Massachusetts.
252+
253+ All Rights Reserved
254+
255+ Permission to use, copy, modify, and distribute this software and its
256+ documentation for any purpose and without fee is hereby granted, provided
257+ that the above copyright notice appear in all copies and that both that
258+ copyright notice and this permission notice appear in supporting documen-
259+ tation, and that the names of Digital or MIT not be used in advertising
260+ or publicity pertaining to distribution of the software without specific,
261+ written prior permission.
262+
263+ DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
264+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
265+ DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
266+ ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
267+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
268+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
269+ SOFTWARE.
270+ _________________________________________________________________________
271+
272+
273+ . Some of the code to support the use of maildirsize files for maildir
274+ deliveries is taken from the Courier Imapd source code. This code is
275+ released under the GPL.
276+ _________________________________________________________________________
277+
278+--
279+Philip Hazel University of Cambridge Computing Service,
280diff --git a/OS/Makefile-Base b/OS/Makefile-Base
281new file mode 100644
282index 0000000..dcd87c2
283--- /dev/null
284+++ b/OS/Makefile-Base
285@@ -0,0 +1,980 @@
286+# This file is the basis of the main makefile for Exim and friends. The
287+# makefile at the top level arranges to build the main makefile by calling
288+# scripts/Configure-Makefile from within the build directory. This
289+# concatenates the configuration settings from Local/Makefile and other,
290+# optional, Local/* files at the front of this file, to create Makefile in the
291+# build directory.
292+#
293+# Copyright (c) The Exim Maintainers 2017
294+
295+SHELL = $(MAKE_SHELL)
296+SCRIPTS = ../scripts
297+O = ../OS
298+EDITME = ../Local/Makefile
299+EXIMON_EDITME = ../Local/eximon.conf
300+
301+# The compiler used for linking is normally the same as the compiler used for
302+# compiling. However, by giving it a different name, we can override it from
303+# the command line, and this is helpful for certain types of testing.
304+
305+LNCC = $(CC)
306+
307+# The compile commands can be very long. To make the output look better,
308+# they are not normally echoed in full. To get full echoing, the caller
309+# must set FULLECHO='' on the command line and call make with -e. We default
310+# FULLECHO to '@' to suppress the full echo. Then define an abbreviation.
311+
312+FULLECHO = @
313+FE = $(FULLECHO)
314+
315+# The default target double-checks the existence of $(EDITME) and then arranges
316+# to touch it if it exists and any of the optional configuration files, which
317+# depend on the os or the architecture, have been altered. The same sub-target
318+# does the same thing for the eximon configuration file if it exists. Then
319+# there is a check that the Makefile (the one built from this file) is
320+# up-to-date. Then the os-specific source files and the C configuration file
321+# are set up, and finally it goes to the main Exim target.
322+
323+all: utils exim
324+config: $(EDITME) checklocalmake Makefile os.c config.h version.h version.sh macro.c
325+
326+checklocalmake:
327+ @if $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE) $(EDITME) || \
328+ $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(ARCHTYPE) $(EDITME) || \
329+ $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EDITME); \
330+ then \
331+ touch $(EDITME); \
332+ fi
333+ @if $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE) $(EXIMON_EDITME) || \
334+ $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(ARCHTYPE) $(EXIMON_EDITME) || \
335+ $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EXIMON_EDITME); \
336+ then \
337+ if [ -f $(EXIMON_EDITME) ]; then touch $(EXIMON_EDITME); fi \
338+ fi
339+
340+$(EDITME):
341+ @echo " "
342+ @echo "*** Please create Local/Makefile by copying src/EDITME and making"
343+ @echo "*** appropriate changes for your site."
344+ @echo " "
345+ @false
346+
347+$(EXIMON_EDITME):
348+ @echo " "
349+ @echo "*** Please create Local/eximon.conf by copying exim_monitor/EDITME and making"
350+ @echo "*** appropriate changes for your site."
351+ @echo " "
352+ @test ! -d ../Local && mkdir ../Local
353+ @false
354+
355+# Check that the local Makefile is up-to-date
356+
357+Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \
358+ $(SCRIPTS)/Configure $(SCRIPTS)/Configure-Makefile $(EDITME)
359+ @echo " "
360+ @echo "*** Makefile needs rebuilding"
361+ @echo "*** Please run \"make makefile\" at top level"
362+ @echo " "
363+ @false
364+
365+# Build (link) the os.h file
366+
367+#os.h: $(SCRIPTS)/Configure-os.h \
368+# $(O)/os.h-AIX $(O)/os.h-BSDI $(O)/os.h-cygwin \
369+# $(O)/os.h-Darwin $(O)/os.h-DGUX $(O)/os.h-DragonFly \
370+# $(O)/os.h-FreeBSD $(O)/os.h-GNU $(O)/os.h-GNUkFreeBSD \
371+# $(O)/os.h-GNUkNetBSD $(O)/os.h-HI-OSF \
372+# $(O)/os.h-HI-UX $(O)/os.h-HP-UX $(O)/os.h-HP-UX-9 \
373+# $(O)/os.h-IRIX $(O)/os.h-IRIX6 $(O)/os.h-IRIX632 \
374+# $(O)/os.h-IRIX65 $(O)/os.h-Linux $(O)/os.h-mips \
375+# $(O)/os.h-NetBSD $(O)/os.h-NetBSD-a.out \
376+# $(O)/os.h-OpenBSD $(O)/os.h-OpenUNIX $(O)/os.h-OSF1 \
377+# $(O)/os.h-QNX $(O)/os.h-SCO $(O)/os.h-SCO_SV \
378+# $(O)/os.h-SunOS4 $(O)/os.h-SunOS5 $(O)/os.h-SunOS5-hal \
379+# $(O)/os.h-ULTRIX $(O)/os.h-UNIX_SV \
380+# $(O)/os.h-Unixware7 $(O)/os.h-USG
381+# $(SHELL) $(SCRIPTS)/Configure-os.h
382+
383+os.h: $(SCRIPTS)/Configure-os.h \
384+ $(O)/os.h-FreeBSD \
385+ $(O)/os.h-Linux \
386+ $(O)/os.h-OpenBSD \
387+ $(O)/os.h-SunOS5
388+ $(SHELL) $(SCRIPTS)/Configure-os.h
389+
390+# Build the os.c file
391+
392+#os.c: ../src/os.c \
393+# $(SCRIPTS)/Configure-os.c \
394+# $(O)/os.c-cygwin $(O)/os.c-GNU $(O)/os.c-HI-OSF \
395+# $(O)/os.c-IRIX $(O)/os.c-IRIX6 $(O)/os.c-IRIX632 \
396+# $(O)/os.c-IRIX65 $(O)/os.c-Linux $(O)/os.c-OSF1
397+# $(SHELL) $(SCRIPTS)/Configure-os.c
398+
399+os.c: ../src/os.c \
400+ $(SCRIPTS)/Configure-os.c \
401+ $(O)/os.c-Linux
402+ $(SHELL) $(SCRIPTS)/Configure-os.c
403+
404+# Build the config.h file.
405+
406+config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
407+ $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
408+
409+# Build the builtin-macros data struct
410+
411+MACRO_HSRC = macro_predef.h os.h globals.h config.h \
412+ routers/accept.h routers/dnslookup.h routers/ipliteral.h \
413+ routers/iplookup.h routers/manualroute.h routers/queryprogram.h \
414+ routers/redirect.h
415+
416+OBJ_MACRO = macro_predef.o \
417+ macro-globals.o macro-readconf.o macro-route.o macro-transport.o macro-drtables.o \
418+ macro-appendfile.o macro-autoreply.o macro-lmtp.o macro-pipe.o macro-queuefile.o \
419+ macro-smtp.o macro-accept.o macro-dnslookup.o macro-ipliteral.o macro-iplookup.o \
420+ macro-manualroute.o macro-queryprogram.o macro-redirect.o \
421+ macro-auth-spa.o macro-cram_md5.o macro-cyrus_sasl.o macro-dovecot.o macro-gsasl_exim.o \
422+ macro-heimdal_gssapi.o macro-plaintext.o macro-spa.o macro-tls.o\
423+ macro-dkim.o
424+
425+$(OBJ_MACRO): $(MACRO_HSRC)
426+
427+macro_predef.o : macro_predef.c
428+ @echo "$(CC) -DMACRO_PREDEF macro_predef.c"
429+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ macro_predef.c
430+macro-globals.o : globals.c
431+ @echo "$(CC) -DMACRO_PREDEF globals.c"
432+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ globals.c
433+macro-readconf.o : readconf.c
434+ @echo "$(CC) -DMACRO_PREDEF readconf.c"
435+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ readconf.c
436+macro-route.o : route.c
437+ @echo "$(CC) -DMACRO_PREDEF route.c"
438+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ route.c
439+macro-transport.o: transport.c
440+ @echo "$(CC) -DMACRO_PREDEF transport.c"
441+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transport.c
442+macro-drtables.o : drtables.c
443+ @echo "$(CC) -DMACRO_PREDEF drtables.c"
444+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ drtables.c
445+macro-appendfile.o : transports/appendfile.c
446+ @echo "$(CC) -DMACRO_PREDEF transports/appendfile.c"
447+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/appendfile.c
448+macro-autoreply.o : transports/autoreply.c
449+ @echo "$(CC) -DMACRO_PREDEF transports/autoreply.c"
450+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/autoreply.c
451+macro-lmtp.o: transports/lmtp.c
452+ @echo "$(CC) -DMACRO_PREDEF transports/lmtp.c"
453+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/lmtp.c
454+macro-pipe.o : transports/pipe.c
455+ @echo "$(CC) -DMACRO_PREDEF transports/pipe.c"
456+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/pipe.c
457+macro-queuefile.o : transports/queuefile.c
458+ @echo "$(CC) -DMACRO_PREDEF transports/queuefile.c"
459+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/queuefile.c
460+macro-smtp.o : transports/smtp.c
461+ @echo "$(CC) -DMACRO_PREDEF transports/smtp.c"
462+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/smtp.c
463+macro-accept.o : routers/accept.c
464+ @echo "$(CC) -DMACRO_PREDEF routers/accept.c"
465+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/accept.c
466+macro-dnslookup.o : routers/dnslookup.c
467+ @echo "$(CC) -DMACRO_PREDEF routers/dnslookup.c"
468+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/dnslookup.c
469+macro-ipliteral.o : routers/ipliteral.c
470+ @echo "$(CC) -DMACRO_PREDEF routers/ipliteral.c"
471+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/ipliteral.c
472+macro-iplookup.o : routers/iplookup.c
473+ @echo "$(CC) -DMACRO_PREDEF routers/iplookup.c"
474+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/iplookup.c
475+macro-manualroute.o : routers/manualroute.c
476+ @echo "$(CC) -DMACRO_PREDEF routers/manualroute.c"
477+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/manualroute.c
478+macro-queryprogram.o : routers/queryprogram.c
479+ @echo "$(CC) -DMACRO_PREDEF routers/queryprogram.c"
480+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/queryprogram.c
481+macro-redirect.o : routers/redirect.c
482+ @echo "$(CC) -DMACRO_PREDEF routers/redirect.c"
483+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/redirect.c
484+macro-auth-spa.o : auths/auth-spa.c
485+ @echo "$(CC) -DMACRO_PREDEF auths/auth-spa.c"
486+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/auth-spa.c
487+macro-cram_md5.o : auths/cram_md5.c
488+ @echo "$(CC) -DMACRO_PREDEF auths/cram_md5.c"
489+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/cram_md5.c
490+macro-cyrus_sasl.o : auths/cyrus_sasl.c
491+ @echo "$(CC) -DMACRO_PREDEF auths/cyrus_sasl.c"
492+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/cyrus_sasl.c
493+macro-dovecot.o: auths/dovecot.c
494+ @echo "$(CC) -DMACRO_PREDEF auths/dovecot.c"
495+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/dovecot.c
496+macro-gsasl_exim.o : auths/gsasl_exim.c
497+ @echo "$(CC) -DMACRO_PREDEF auths/gsasl_exim.c"
498+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/gsasl_exim.c
499+macro-heimdal_gssapi.o: auths/heimdal_gssapi.c
500+ @echo "$(CC) -DMACRO_PREDEF auths/heimdal_gssapi.c"
501+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/heimdal_gssapi.c
502+macro-plaintext.o : auths/plaintext.c
503+ @echo "$(CC) -DMACRO_PREDEF auths/plaintext.c"
504+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/plaintext.c
505+macro-spa.o : auths/spa.c
506+ @echo "$(CC) -DMACRO_PREDEF auths/spa.c"
507+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/spa.c
508+macro-tls.o: auths/tls.c
509+ @echo "$(CC) -DMACRO_PREDEF auths/tls.c"
510+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/tls.c
511+macro-dkim.o: dkim.c
512+ @echo "$(CC) -DMACRO_PREDEF dkim.c"
513+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ dkim.c
514+
515+macro_predef: $(OBJ_MACRO)
516+ @echo "$(LNCC) -o $@"
517+ $(FE)$(LNCC) -o $@ $(LFLAGS) $(OBJ_MACRO)
518+
519+macro.c: macro_predef
520+ ./macro_predef > macro.c
521+
522+# This target is recognized specially by GNU make. It records those targets
523+# that do not correspond to files that are being built and which should
524+# therefore always be run, even if the files exist. This shouldn't in fact be a
525+# problem, but it does no harm. Other make programs will just ignore this.
526+
527+.PHONY: all config utils \
528+ buildauths buildlookups buildpdkim buildrouters \
529+ buildtransports checklocalmake clean
530+
531+
532+utils: $(EXIM_MONITOR) exicyclog exinext exiwhat \
533+ exigrep eximstats exipick exiqgrep exiqsumm \
534+ transport-filter.pl convert4r3 convert4r4 \
535+ exim_checkaccess \
536+ exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock
537+
538+
539+# Targets for special-purpose configuration header builders
540+buildconfig: buildconfig.c
541+ @echo "$(CC) buildconfig.c"
542+ $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
543+
544+
545+# Target for the exicyclog utility script
546+exicyclog: config ../src/exicyclog.src
547+ @rm -f exicyclog
548+ @. ./version.sh && sed \
549+ -e "s?PROCESSED_FLAG?This file has been so processed.?"\
550+ -e "/^# /p" \
551+ -e "/^# /d" \
552+ -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
553+ -e "s?CONFIGURE_FILE_USE_EUID?$(CONFIGURE_FILE_USE_EUID)?" \
554+ -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
555+ -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
556+ -e "s?EXICYCLOG_MAX?$(EXICYCLOG_MAX)?" \
557+ -e "s?COMPRESS_COMMAND?$(COMPRESS_COMMAND)?" \
558+ -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
559+ -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
560+ -e "s?CHMOD_COMMAND?$(CHMOD_COMMAND)?" \
561+ -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
562+ -e "s?MV_COMMAND?$(MV_COMMAND)?" \
563+ -e "s?RM_COMMAND?$(RM_COMMAND)?" \
564+ -e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
565+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
566+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
567+ ../src/exicyclog.src > exicyclog-t
568+ @mv exicyclog-t exicyclog
569+ @chmod a+x exicyclog
570+ @echo ">>> exicyclog script built"
571+
572+# Target for the exinext utility script
573+exinext: config ../src/exinext.src
574+ @rm -f exinext
575+ @. ./version.sh && sed \
576+ -e "s?PROCESSED_FLAG?This file has been so processed.?"\
577+ -e "/^# /p" \
578+ -e "/^# /d" \
579+ -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
580+ -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
581+ -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
582+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
583+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
584+ ../src/exinext.src > exinext-t
585+ @mv exinext-t exinext
586+ @chmod a+x exinext
587+ @echo ">>> exinext script built"
588+
589+# Target for the exiwhat utility script
590+exiwhat: config ../src/exiwhat.src
591+ @rm -f exiwhat
592+ @. ./version.sh && sed \
593+ -e "s?PROCESSED_FLAG?This file has been so processed.?"\
594+ -e "/^# /p" \
595+ -e "/^# /d" \
596+ -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
597+ -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
598+ -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
599+ -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
600+ -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
601+ -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
602+ -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
603+ -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
604+ -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
605+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
606+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
607+ ../src/exiwhat.src > exiwhat-t
608+ @mv exiwhat-t exiwhat
609+ @chmod a+x exiwhat
610+ @echo ">>> exiwhat script built"
611+
612+# Target for the exim_checkaccess utility script
613+exim_checkaccess: config ../src/exim_checkaccess.src
614+ @rm -f exim_checkaccess
615+ @. ./version.sh && sed \
616+ -e "s?PROCESSED_FLAG?This file has been so processed.?"\
617+ -e "/^# /p" \
618+ -e "/^# /d" \
619+ -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
620+ -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
621+ -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
622+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
623+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
624+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
625+ ../src/exim_checkaccess.src > exim_checkaccess-t
626+ @mv exim_checkaccess-t exim_checkaccess
627+ @chmod a+x exim_checkaccess
628+ @echo ">>> exim_checkaccess script built"; echo ""
629+
630+# Target for the Exim monitor start-up script
631+eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
632+ ../Local/eximon.conf
633+ @rm -f eximon
634+ $(SHELL) $(SCRIPTS)/Configure-eximon
635+ @. ./version.sh && sed \
636+ -e "s?PROCESSED_FLAG?This file has been so processed.?"\
637+ -e "/^# /p" \
638+ -e "/^# /d" \
639+ -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
640+ -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
641+ -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
642+ -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
643+ -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
644+ -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
645+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
646+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
647+ ../src/eximon.src >> eximon
648+ @echo ">>> eximon script built"; echo ""
649+
650+# Targets for utilities; these are all Perl scripts that have to get the
651+# location of Perl put in them. A few need other things as well.
652+
653+exigrep: config ../src/exigrep.src
654+ @rm -f exigrep
655+ @. ./version.sh && sed \
656+ -e "s?PROCESSED_FLAG?This file has been so processed.?"\
657+ -e "/^# /p" \
658+ -e "/^# /d" \
659+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
660+ -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
661+ -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
662+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
663+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
664+ ../src/exigrep.src > exigrep-t
665+ @mv exigrep-t exigrep
666+ @chmod a+x exigrep
667+ @echo ">>> exigrep script built"
668+
669+eximstats: config ../src/eximstats.src
670+ @rm -f eximstats
671+ @. ./version.sh && sed \
672+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
673+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
674+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
675+ ../src/eximstats.src > eximstats-t
676+ @mv eximstats-t eximstats
677+ @chmod a+x eximstats
678+ @echo ">>> eximstats script built"
679+
680+exiqgrep: config ../src/exiqgrep.src
681+ @rm -f exiqgrep
682+ @. ./version.sh && sed \
683+ -e "s?PROCESSED_FLAG?This file has been so processed.?"\
684+ -e "/^# /p" \
685+ -e "/^# /d" \
686+ -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
687+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
688+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
689+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
690+ ../src/exiqgrep.src > exiqgrep-t
691+ @mv exiqgrep-t exiqgrep
692+ @chmod a+x exiqgrep
693+ @echo ">>> exiqgrep script built"
694+
695+exiqsumm: config ../src/exiqsumm.src
696+ @rm -f exiqsumm
697+ @. ./version.sh && sed \
698+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
699+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
700+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
701+ ../src/exiqsumm.src > exiqsumm-t
702+ @mv exiqsumm-t exiqsumm
703+ @chmod a+x exiqsumm
704+ @echo ">>> exiqsumm script built"
705+
706+exipick: config ../src/exipick.src
707+ @rm -f exipick
708+ @. ./version.sh && sed \
709+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
710+ -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
711+ -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
712+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
713+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
714+ ../src/exipick.src > exipick-t
715+ @mv exipick-t exipick
716+ @chmod a+x exipick
717+ @echo ">>> exipick script built"
718+
719+transport-filter.pl: config ../src/transport-filter.src
720+ @rm -f transport-filter.pl
721+ @. ./version.sh && sed \
722+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
723+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
724+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
725+ ../src/transport-filter.src > transport-filter.pl-t
726+ @mv transport-filter.pl-t transport-filter.pl
727+ @chmod a+x transport-filter.pl
728+ @echo ">>> transport-filter.pl script built"
729+
730+convert4r3: config ../src/convert4r3.src
731+ @rm -f convert4r3
732+ @. ./version.sh && sed \
733+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
734+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
735+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
736+ ../src/convert4r3.src > convert4r3-t
737+ @mv convert4r3-t convert4r3
738+ @chmod a+x convert4r3
739+ @echo ">>> convert4r3 script built"
740+
741+convert4r4: config ../src/convert4r4.src
742+ @rm -f convert4r4
743+ @. ./version.sh && sed \
744+ -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
745+ -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
746+ -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
747+ ../src/convert4r4.src > convert4r4-t
748+ @mv convert4r4-t convert4r4
749+ @chmod a+x convert4r4
750+ @echo ">>> convert4r4 script built"
751+
752+
753+# These are objects of optional features. They are always compiled, but
754+# if the corresponding #defines are not set, they wind up empty and
755+# are thrown away by the linker.
756+
757+OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
758+OBJ_EXPERIMENTAL = bmi_spam.o \
759+ dane.o \
760+ dcc.o \
761+ dmarc.o \
762+ imap_utf7.o \
763+ spf.o \
764+ srs.o \
765+ utf8.o
766+
767+# Targets for final binaries; the main one has a build number which is
768+# updated each time. We don't bother with that for the auxiliaries.
769+
770+OBJ_LOOKUPS = lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o
771+
772+OBJ_EXIM = acl.o base64.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
773+ directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
774+ filtertest.o globals.o dkim.o dkim_transport.o hash.o \
775+ header.o host.o ip.o log.o lss.o match.o moan.o \
776+ os.o parse.o queue.o \
777+ rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
778+ route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
779+ std-crypto.o store.o string.o tls.o tod.o transport.o tree.o verify.o \
780+ environment.o macro.o \
781+ $(OBJ_LOOKUPS) \
782+ local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
783+ $(OBJ_EXPERIMENTAL)
784+
785+exim: buildlookups buildauths pdkim/pdkim.a \
786+ buildrouters buildtransports \
787+ $(OBJ_EXIM) version.o
788+ @echo "$(LNCC) -o exim"
789+ $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
790+ routers/routers.a transports/transports.a lookups/lookups.a \
791+ auths/auths.a pdkim/pdkim.a \
792+ $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
793+ $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
794+ $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
795+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
796+ echo $(STRIP_COMMAND) exim; \
797+ $(STRIP_COMMAND) exim; \
798+ fi
799+ $(EXIM_CHMOD)
800+ @echo " "
801+ @echo ">>> exim binary built"
802+ @echo " "
803+
804+# The utility for dumping the contents of an exim database
805+
806+OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
807+
808+exim_dumpdb: $(OBJ_DUMPDB)
809+ @echo "$(LNCC) -o exim_dumpdb"
810+ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
811+ $(LIBS) $(EXTRALIBS) $(DBMLIB)
812+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
813+ echo $(STRIP_COMMAND) exim_dumpdb; \
814+ $(STRIP_COMMAND) exim_dumpdb; \
815+ fi
816+ @echo ">>> exim_dumpdb utility built"
817+ @echo " "
818+
819+# The utility for interrogating/fixing the contents of an exim database
820+
821+OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
822+
823+exim_fixdb: $(OBJ_FIXDB) buildauths
824+ @echo "$(LNCC) -o exim_fixdb"
825+ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
826+ auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB)
827+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
828+ echo $(STRIP_COMMAND) exim_fixdb; \
829+ $(STRIP_COMMAND) exim_fixdb; \
830+ fi
831+ @echo ">>> exim_fixdb utility built"
832+ @echo " "
833+
834+# The utility for tidying the contents of an exim database
835+
836+OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
837+
838+exim_tidydb: $(OBJ_TIDYDB)
839+ @echo "$(LNCC) -o exim_tidydb"
840+ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
841+ $(LIBS) $(EXTRALIBS) $(DBMLIB)
842+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
843+ echo $(STRIP_COMMAND) exim_tidydb; \
844+ $(STRIP_COMMAND) exim_tidydb; \
845+ fi
846+ @echo ">>> exim_tidydb utility built"
847+ @echo " "
848+
849+# The utility for building dbm files
850+
851+exim_dbmbuild: exim_dbmbuild.o
852+ @echo "$(LNCC) -o exim_dbmbuild"
853+ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
854+ $(LIBS) $(EXTRALIBS) $(DBMLIB)
855+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
856+ echo $(STRIP_COMMAND) exim_dbmbuild; \
857+ $(STRIP_COMMAND) exim_dbmbuild; \
858+ fi
859+ @echo ">>> exim_dbmbuild utility built"
860+ @echo " "
861+
862+# The utility for locking a mailbox while messing around with it
863+
864+exim_lock: exim_lock.c os.h
865+ @echo "$(CC) exim_lock.c"
866+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
867+ @echo "$(LNCC) -o exim_lock"
868+ $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
869+ $(LIBS) $(EXTRALIBS)
870+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
871+ echo $(STRIP_COMMAND) exim_lock; \
872+ $(STRIP_COMMAND) exim_lock; \
873+ fi
874+ @echo ">>> exim_lock utility built"
875+ @echo " "
876+
877+# The X-based Exim monitor program's binary part. There's a macro for cutting
878+# out the modified TextPop module, because some antique link editors cannot
879+# handle the fact that it is redefining things that are found later in the
880+# Xaw library.
881+
882+# Object modules that are the unique Eximon modules
883+
884+MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
885+ em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
886+ em_text.o em_xs.o
887+
888+# The complete modules list also includes some specially compiled versions of
889+# code from the main Exim source tree.
890+
891+OBJ_MONBIN = util-spool_in.o \
892+ util-store.o \
893+ util-string.o \
894+ util-queue.o \
895+ util-tod.o \
896+ tree.o \
897+ $(MONBIN)
898+
899+eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) \
900+ ../exim_monitor/em_version.c
901+ @echo "$(CC) exim_monitor/em_version.c"
902+ $(FE)$(CC) -o em_version.o -c \
903+ $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
904+ @echo "$(LNCC) -o eximon.bin"
905+ $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
906+ $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
907+ $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
908+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
909+ echo $(STRIP_COMMAND) eximon.bin; \
910+ $(STRIP_COMMAND) eximon.bin; \
911+ fi
912+ @echo ">>> exim monitor binary built"
913+ @echo " "
914+
915+
916+# Compile step for most of the exim modules. HDRS is a list of headers
917+# which cause everything to be rebuilt. PHDRS is the same, for the use
918+# of routers, transports, and authenticators. I can't find a way of doing this
919+# in one. This list is overkill, but it doesn't really take much time to
920+# rebuild Exim on a modern computer.
921+
922+HDRS = blob.h \
923+ config.h \
924+ dbfunctions.h \
925+ dbstuff.h \
926+ exim.h \
927+ functions.h \
928+ globals.h \
929+ hash.h \
930+ local_scan.h \
931+ macros.h \
932+ mytypes.h \
933+ sha_ver.h \
934+ structs.h \
935+ os.h
936+PHDRS = ../config.h \
937+ ../dbfunctions.h \
938+ ../dbstuff.h \
939+ ../exim.h \
940+ ../functions.h \
941+ ../globals.h \
942+ ../local_scan.h \
943+ ../macros.h \
944+ ../mytypes.h \
945+ ../structs.h \
946+ ../os.h
947+
948+.SUFFIXES: .o .c
949+.c.o:; @echo "$(CC) $*.c"
950+ $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
951+
952+# Update Exim's version information and build the version object.
953+
954+version.h version.sh::
955+ @../scripts/reversion
956+
957+cnumber.h: version.h
958+
959+version.o: $(HDRS) cnumber.h version.h version.c
960+
961+# This is the dummy module for use by test compiles of individual modules. It
962+# contains functions such as log_write() that may be called from bits of Exim
963+# in the tested code.
964+
965+dummies.o: dummies.c
966+
967+# Compile instructions for perl.o for when EXIM_PERL is set
968+
969+perl.o: $(HDRS) perl.c
970+ @echo "$(PERL_CC) perl.c"
971+ $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
972+
973+# Compile instructions for the database utility modules
974+
975+exim_dumpdb.o: $(HDRS) exim_dbutil.c
976+ @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
977+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
978+ -DCOMPILE_UTILITY \
979+ -DEXIM_DUMPDB \
980+ -o exim_dumpdb.o exim_dbutil.c
981+
982+exim_fixdb.o: $(HDRS) exim_dbutil.c
983+ @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
984+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
985+ -DCOMPILE_UTILITY \
986+ -DEXIM_FIXDB \
987+ -o exim_fixdb.o exim_dbutil.c
988+
989+exim_tidydb.o: $(HDRS) exim_dbutil.c
990+ @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
991+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
992+ -DCOMPILE_UTILITY \
993+ -DEXIM_TIDYDB \
994+ -o exim_tidydb.o exim_dbutil.c
995+
996+# Compile instructions for exim_dbmbuild
997+
998+exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
999+ @echo "$(CC) exim_dbmbuild.c"
1000+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY \
1001+ -o exim_dbmbuild.o exim_dbmbuild.c
1002+
1003+# Utilities use special versions of some modules - typically with debugging
1004+# calls cut out.
1005+
1006+util-spool_in.o: $(HDRS) spool_in.c
1007+ @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
1008+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
1009+
1010+util-store.o: $(HDRS) store.c
1011+ @echo "$(CC) -DCOMPILE_UTILITY store.c"
1012+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
1013+
1014+util-string.o: $(HDRS) string.c
1015+ @echo "$(CC) -DCOMPILE_UTILITY string.c"
1016+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
1017+
1018+util-queue.o: $(HDRS) queue.c
1019+ @echo "$(CC) -DCOMPILE_UTILITY queue.c"
1020+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-queue.o queue.c
1021+
1022+util-tod.o: $(HDRS) tod.c
1023+ @echo "$(CC) -DCOMPILE_UTILITY tod.c"
1024+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-tod.o tod.c
1025+
1026+util-os.o: $(HDRS) os.c
1027+ @echo "$(CC) -DCOMPILE_UTILITY os.c"
1028+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
1029+ -DCOMPILE_UTILITY \
1030+ -DOS_LOAD_AVERAGE \
1031+ -DFIND_RUNNING_INTERFACES \
1032+ -o util-os.o os.c
1033+
1034+# The local scan module depends only on its own special header, and is compiled
1035+# from a source whose location is set by configuration.
1036+
1037+local_scan.o: config local_scan.h ../$(LOCAL_SCAN_SOURCE)
1038+ @echo "$(CC) local_scan.c"
1039+ $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
1040+
1041+# Dependencies for the "ordinary" exim modules
1042+
1043+acl.o: $(HDRS) acl.c
1044+base64.o: $(HDRS) mime.h base64.c
1045+child.o: $(HDRS) child.c
1046+crypt16.o: $(HDRS) crypt16.c
1047+daemon.o: $(HDRS) daemon.c
1048+dbfn.o: $(HDRS) dbfn.c
1049+debug.o: $(HDRS) debug.c
1050+deliver.o: $(HDRS) transports/smtp.h deliver.c
1051+directory.o: $(HDRS) directory.c
1052+dns.o: $(HDRS) dns.c
1053+enq.o: $(HDRS) enq.c
1054+exim.o: $(HDRS) exim.c
1055+expand.o: $(HDRS) expand.c
1056+environment.o: $(HDRS) environment.c
1057+filter.o: $(HDRS) filter.c
1058+filtertest.o: $(HDRS) filtertest.c
1059+globals.o: $(HDRS) globals.c
1060+hash.o: $(HDRS) hash.c
1061+header.o: $(HDRS) header.c
1062+host.o: $(HDRS) host.c
1063+ip.o: $(HDRS) ip.c
1064+log.o: $(HDRS) log.c
1065+lss.o: $(HDRS) lss.c
1066+match.o: $(HDRS) match.c
1067+moan.o: $(HDRS) moan.c
1068+os.o: $(HDRS) $(OS_C_INCLUDES) os.c
1069+parse.o: $(HDRS) parse.c
1070+queue.o: $(HDRS) queue.c
1071+rda.o: $(HDRS) rda.c
1072+readconf.o: $(HDRS) readconf.c
1073+receive.o: $(HDRS) receive.c
1074+retry.o: $(HDRS) retry.c
1075+rewrite.o: $(HDRS) rewrite.c
1076+rfc2047.o: $(HDRS) rfc2047.c
1077+route.o: $(HDRS) route.c
1078+search.o: $(HDRS) search.c
1079+sieve.o: $(HDRS) sieve.c
1080+smtp_in.o: $(HDRS) smtp_in.c
1081+smtp_out.o: $(HDRS) smtp_out.c
1082+spool_in.o: $(HDRS) spool_in.c
1083+spool_out.o: $(HDRS) spool_out.c
1084+std-crypto.o: $(HDRS) std-crypto.c
1085+store.o: $(HDRS) store.c
1086+string.o: $(HDRS) string.c
1087+tls.o: $(HDRS) tls.c \
1088+ tls-gnu.c tlscert-gnu.c \
1089+ tls-openssl.c tlscert-openssl.c
1090+tod.o: $(HDRS) tod.c
1091+transport.o: $(HDRS) transport.c
1092+tree.o: $(HDRS) tree.c
1093+verify.o: $(HDRS) transports/smtp.h verify.c
1094+dkim.o: $(HDRS) pdkim/pdkim.h dkim.c
1095+dkim_transport.o: $(HDRS) dkim_transport.c
1096+
1097+# Dependencies for WITH_CONTENT_SCAN modules
1098+
1099+malware.o: $(HDRS) malware.c
1100+mime.o: $(HDRS) mime.h mime.c
1101+regex.o: $(HDRS) regex.c
1102+spam.o: $(HDRS) spam.c
1103+spool_mbox.o: $(HDRS) spool_mbox.c
1104+
1105+
1106+# Dependencies for EXPERIMENTAL_* modules
1107+
1108+bmi_spam.o: $(HDRS) bmi_spam.c
1109+dane.o: $(HDRS) dane.c dane-gnu.c dane-openssl.c
1110+dcc.o: $(HDRS) dcc.h dcc.c
1111+dmarc.o: $(HDRS) pdkim/pdkim.h dmarc.h dmarc.c
1112+imap_utf7.o: $(HDRS) imap_utf7.c
1113+spf.o: $(HDRS) spf.h spf.c
1114+srs.o: $(HDRS) srs.h srs.c
1115+utf8.o: $(HDRS) utf8.c
1116+
1117+# The module containing tables of available lookups, routers, auths, and
1118+# transports must be rebuilt if any of them are. However, because the makefiles
1119+# for the drivers are always run, we don't actually put the dependencies here,
1120+# because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
1121+# drtables.o even though the .a files haven't in fact been updated. Instead
1122+# it is arranged that the lower-level makefiles remove drtables.o when they
1123+# rebuild the .a files.
1124+
1125+drtables.o: $(HDRS) drtables.c
1126+
1127+# We depend upon object files built as part of building the lookups library
1128+# When using parallel make, we don't have the dependency to force building
1129+# in the sub-directory unless we force that dependency:
1130+
1131+$(OBJ_LOOKUPS): buildlookups
1132+
1133+# The exim monitor's private modules - the sources live in a private
1134+# subdirectory. The final binary combines the private modules with some
1135+# modules from the main exim binary.
1136+
1137+em_StripChart.o: ../exim_monitor/em_StripChart.c
1138+em_TextPop.o: ../exim_monitor/em_TextPop.c
1139+em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
1140+em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
1141+em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
1142+em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
1143+em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
1144+em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
1145+em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
1146+em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
1147+em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
1148+em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
1149+$(MONBIN): $(HDRS)
1150+ @echo "$(CC) exim_monitor/`echo $@ | sed 's/o$$/c/'`"
1151+ $(FE)$(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
1152+ ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
1153+
1154+
1155+# Targets for the various libraries that Exim uses.
1156+
1157+# The lookups library.
1158+
1159+buildlookups: config
1160+ @cd lookups && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
1161+ CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" HDRS="../version.h $(PHDRS)" \
1162+ FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" \
1163+ INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"
1164+ @echo " "
1165+
1166+# The routers library.
1167+
1168+buildrouters: config
1169+ @cd routers && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
1170+ FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
1171+ INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
1172+ @echo " "
1173+
1174+# The transports library.
1175+
1176+buildtransports: config
1177+ @cd transports && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
1178+ FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
1179+ INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
1180+ @echo " "
1181+
1182+# The library of authorization modules
1183+
1184+buildauths: config
1185+ @cd auths && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
1186+ FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
1187+ INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
1188+ @echo " "
1189+
1190+# The PDKIM library
1191+
1192+buildpdkim: pdkim/pdkim.a
1193+pdkim/pdkim.a: config
1194+ @cd pdkim && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
1195+ FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
1196+ INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
1197+ @echo " "
1198+
1199+# The "clean", "install", and "makefile" targets just pass themselves back to
1200+# the main Exim makefile. These targets will be obeyed only if "make" is obeyed
1201+# for them in the build directory.
1202+
1203+clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
1204+
1205+# Targets for building stand-alone testing programs for basic testing of
1206+# some of the building blocks. These are not integrated with the makefile-
1207+# building targets. If you change something that is going to cause the
1208+# makefile to be rebuilt, you must run "make makefile" before running one
1209+# of these.
1210+
1211+# The testing programs use different versions of some modules - usually
1212+# with bits cut out that are not relevant to the test in hand. For those
1213+# that are used by several tests, we use a different name.
1214+
1215+sa-globals.o: $(HDRS) globals.c
1216+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
1217+
1218+sa-os.o: $(HDRS) os.c
1219+ $(CC) -c $(CFLAGS) $(INCLUDE) \
1220+ -DFIND_RUNNING_INTERFACES \
1221+ -o sa-os.o os.c
1222+
1223+# These are the test targets themselves
1224+
1225+test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
1226+ string.o tod.o version.o utf8.o
1227+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
1228+ $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY store.c
1229+ $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
1230+ dummies.o sa-globals.o sa-os.o store.o string.o \
1231+ tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
1232+ rm -f dbfn.o store.o
1233+
1234+test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
1235+ store.o string.o tod.o tree.o
1236+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
1237+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
1238+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
1239+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
1240+ $(LNCC) -o test_host $(LFLAGS) \
1241+ host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
1242+ tod.o tree.o $(LIBS) $(LIBRESOLV)
1243+ rm -f child.o dummies.o host.o dns.o
1244+
1245+test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
1246+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
1247+ $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
1248+ sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
1249+ rm -f os.o
1250+
1251+test_parse: config.h parse.c dummies.o sa-globals.o \
1252+ store.o string.o tod.o version.o utf8.o
1253+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
1254+ $(LNCC) -o test_parse $(LFLAGS) parse.o \
1255+ dummies.o sa-globals.o store.o string.o tod.o version.o \
1256+ utf8.o $(LDFLAGS)
1257+ rm -f parse.o
1258+
1259+test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
1260+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
1261+ $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
1262+ dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)
1263+ rm -f string.o
1264+
1265+# End
1266diff --git a/OS/Makefile-Default b/OS/Makefile-Default
1267new file mode 100644
1268index 0000000..b3990fe
1269--- /dev/null
1270+++ b/OS/Makefile-Default
1271@@ -0,0 +1,321 @@
1272+##################################################
1273+# The Exim mail transport agent #
1274+##################################################
1275+
1276+# Generic default make file containing settings that relate to the OS or
1277+# to selectable features within the OS. The configuration options for Exim
1278+# itself live in Local/Makefile, which is constructed by editing src/EDITME.
1279+
1280+# These settings are basic defaults which may be overridden, either by the
1281+# generic OS-specific files, or by site-specific files. Do not edit this file.
1282+# Instead, edit or create suitable OS-specific and/or site specific files.
1283+# See the manual for details.
1284+
1285+
1286+# MAKE_SHELL contains the name of the shell to be used for executing commands
1287+# from the make files. Normally /bin/sh should be used.
1288+
1289+MAKE_SHELL=/bin/sh
1290+
1291+
1292+# BASENAME_COMMAND contains the path to the "basename" command, which varies
1293+# from OS to OS. This is used when building the Exim monitor script only. (See
1294+# also HOSTNAME_COMMAND.) If BASENAME_COMMAND is set to "look_for_it" then the
1295+# script checks for /usr/bin/basename and /bin/basename, and if neither is
1296+# found, it uses /usr/ucb/basename. This copes with Solaris 2 and Linux, both
1297+# of which come in different versions.
1298+
1299+BASENAME_COMMAND=/usr/bin/basename
1300+
1301+
1302+# If you set STRIP_COMMAND to the path of the "strip" command, it will be run
1303+# on every binary that is built. It is left unset by default, which leaves
1304+# the binaries unstripped.
1305+
1306+# STRIP_COMMAND=/usr/bin/strip
1307+
1308+
1309+# Some of the following commands live in different places in different OS. We
1310+# include them all here for generality.
1311+
1312+CHOWN_COMMAND=/usr/bin/chown
1313+CHGRP_COMMAND=/usr/bin/chgrp
1314+CHMOD_COMMAND=/usr/bin/chmod
1315+MV_COMMAND=/bin/mv
1316+RM_COMMAND=/bin/rm
1317+TOUCH_COMMAND=/usr/bin/touch
1318+
1319+
1320+# Some operating systems have different ways of building libraries of
1321+# functions. This macro defines the command to do this, defaulting to
1322+# the "ar" command with options "cq".
1323+
1324+AR=ar cq
1325+
1326+
1327+# Not all operating systems have the iconv() function. Those that do have
1328+#
1329+# HAVE_ICONV=yes
1330+#
1331+# in their OS-specific Makefiles. On those that don't it is possible to
1332+# install an independent implementation of iconv(). If you've done this,
1333+# add "HAVE_ICONV=yes" to your Local/Makefile.
1334+
1335+
1336+# Perl is not necessary for running Exim itself, except when EXIM_PERL
1337+# is set to cause Perl embedding. However, some Perl utilities are provided
1338+# for processing the logs. Perl 5 is assumed.
1339+
1340+PERL_COMMAND=/usr/bin/perl
1341+
1342+
1343+# CC contains the name of the C compiler to be used.
1344+
1345+CC=gcc
1346+
1347+
1348+# CFLAGS contains flags to be passed to the compiler. Nothing is defaulted
1349+# here; instead each OS-dependent Makefile contains a default setting.
1350+
1351+# CFLAGS=-O
1352+
1353+
1354+# LFLAGS contains flags to be passed to the link editor. Nothing is defaulted
1355+# here; instead each OS-dependent Makefile contains a default setting if one
1356+# is needed.
1357+
1358+# LFLAGS=
1359+
1360+
1361+# PCRE_LIBS contains the library to be linked for PCRE
1362+
1363+PCRE_LIBS=-lpcre
1364+
1365+
1366+# LIBS and EXTRALIBS contain library settings that are used on linking
1367+# commands to build binaries. The OS-dependent Makefile may contain a default
1368+# setting for LIBS, leaving EXTRALIBS available for adding further libraries
1369+# that are required for optional extras.
1370+
1371+# LIBS=
1372+# EXTRALIBS=
1373+
1374+
1375+# LIBS_EXIM and EXTRALIBS_EXIM contain library settings that are used
1376+# only when linking the Exim binary. They are not used for other binaries.
1377+# One possible use is for the TCP wrappers library.
1378+
1379+# LIBS_EXIM=
1380+# EXTRALIBS_EXIM=
1381+
1382+
1383+# LIBS_EXIMON and EXTRALIBS_EXIMON contain library settings that are
1384+# used only when linking the Exim monitor binary. They are not used for
1385+# other binaries.
1386+
1387+# LIBS_EXIMON=
1388+# EXTRALIBS_EXIMON=
1389+
1390+
1391+# The error name for quota exceeded varies among operating systems, and
1392+# even, unfortunately, in different versions of the same operating system.
1393+# EDQUOT was not in Sys V, but is in SPEC 1170, apparently. It was used
1394+# in SunOS4, but got taken out for SunOS5, where ENOSPC was given if a quota
1395+# was exceeded. However, it got put back into SunOS5 with a patch to 5.4 in
1396+# order to comply with SPEC 1170. Thus even different patch levels of the same
1397+# system (SunOS5) may use different numbers.
1398+#
1399+# If you don't have quotas or are not interested in handling quota errors
1400+# specially, just set this variable to 0. If it is not set, it defaults to
1401+# EDQUOT if that is defined for the OS; otherwise it defaults to ENOSPC.
1402+
1403+# ERRNO_QUOTA=EDQUOT
1404+
1405+
1406+# The exiwhat utility script finds all the processes running Exim, and sends
1407+# them a SIGUSR1 signal to get them to write their status to a file. There are
1408+# two ways in which this can be done:
1409+#
1410+# (1) If the OS has a command to find processes and signal them, that can be
1411+# used. Linux has "killall"; Solaris has "pkill". (Note: "killall" on Solaris
1412+# does something very different - and disastrous.) The following are set in the
1413+# OS-specific Makefiles for those OS where this can be done:
1414+
1415+# EXIWHAT_MULTIKILL_CMD=
1416+# EXIWHAT_MULTIKILL_ARG=
1417+
1418+# (2) For other operating systems, exiwhat calls the ps command and egreps the
1419+# output in order to find all the processes running Exim. The arguments for the
1420+# various commands needed to do this vary from OS to OS. These defaults work on
1421+# Solaris 2, HPUX, and IRIX. The OS-specific Makefiles have different versions
1422+# for other systems, and you can override with your own requirements in your
1423+# private Makefiles in the Local directory. The most commonly found
1424+# alternatives are -ax instead of -e for the ps argument, and / instead of a
1425+# blank before the name exim for the egrep argument on systems whose ps output
1426+# shows the full path name. The quotes for the egrep argument are specified
1427+# here so that leading white space can be used. This value should always be
1428+# given in single quotes.
1429+
1430+EXIWHAT_PS_CMD=/bin/ps
1431+EXIWHAT_PS_ARG=-e
1432+EXIWHAT_EGREP_ARG=' exim( |$$|-)'
1433+
1434+# For both kinds of exiwhat usage, the next setting specifies the signal that
1435+# is sent.
1436+
1437+EXIWHAT_KILL_SIGNAL=-USR1
1438+
1439+
1440+# IPv6 is gradually spreading more and more widely. Most operating systems seem
1441+# to support it nowadays. If you set this option, IPv6 support will be included
1442+# in the Exim binary. As well as the basic enabling option, there are
1443+# parameters for include and library directories that may be needed for IPv6 on
1444+# some systems, where the support is not yet in the standard library.
1445+
1446+# HAVE_IPV6=YES
1447+# IPV6_INCLUDE=-I /usr/ipv6/include
1448+# IPV6_LIBS=-L/usr/ipv6/libs -linet6
1449+
1450+# Exim uses the function getaddrinfo() for converting IPv6 addresses in text
1451+# form to binary. Apparently some operating systems do not support this, or not
1452+# correctly, and require the use of the function inet_pton() instead. The
1453+# following setting enables this. Note, however, the inet_pton() has reduced
1454+# functionality compared with getaddrinfo(). In particular, it does not
1455+# recognize the percent convention for identifying scopes (interfaces) that is
1456+# used by some operating systems.
1457+
1458+# IPV6_USE_INET_PTON=yes
1459+
1460+# HOSTNAME_COMMAND contains the path to the "hostname" command, which varies
1461+# from OS to OS. This is used when building the Exim monitor script only. (See
1462+# also BASENAME_COMMAND.) If HOSTNAME_COMMAND is set to "look_for_it" then the
1463+# script checks for /usr/bin/hostname and /bin/hostname, and if neither is
1464+# found, it uses /usr/ucb/basename. This copes with Solaris 2, which comes in
1465+# different versions.
1466+
1467+HOSTNAME_COMMAND=/bin/hostname
1468+
1469+
1470+# INCLUDE contains arbitrary include parameters that you may need to use
1471+# when building exim. It is added to every compile command.
1472+
1473+# INCLUDE=-I /some/special/include-directory
1474+
1475+
1476+# Some OS require a separate library to be quoted when linking programs that
1477+# call name resolver functions. This can be set in LIBRESOLV, which is left
1478+# unset here, but is set is some of the OS-specific Makefiles.
1479+
1480+# LIBRESOLV=
1481+
1482+
1483+# Additional libraries and include directories may be required for some
1484+# lookup styles, e.g. LDAP or SQL. LOOKUP_LIBS is included only on the
1485+# command for linking Exim itself, not on any auxiliary programs. You
1486+# don't need to set LOOKUP_INCLUDE if the relevant directories are already
1487+# specified in INCLUDE.
1488+
1489+# LOOKUP_INCLUDE=-I /usr/local/ldap/include -I /usr/local/sql/include
1490+# LOOKUP_LIBS=-L/usr/local/lib -lldap -llber
1491+
1492+
1493+# RANLIB should be set to something that does nothing on systems that do not
1494+# have the ranlib command or do not need to run it on library files.
1495+
1496+RANLIB=ranlib
1497+
1498+
1499+# EXIM_CHMOD is available to specify a command that is automatically applied
1500+# to the Exim binary immediately it is compiled. (I find this useful when
1501+# building test versions.)
1502+
1503+EXIM_CHMOD=@true
1504+
1505+
1506+# LOCAL_SCAN_SOURCE defines the file in which the function local_scan() is
1507+# defined. This provides the administrator with a hook for including C code
1508+# for scanning incoming mails. The path that is defined must be relative to
1509+# the Exim distribution directory. For example
1510+
1511+# LOCAL_SCAN_SOURCE=Local/local_scan.c
1512+
1513+# The default setting points to a template function that doesn't actually do
1514+# any scanning, but just accepts the message.
1515+
1516+LOCAL_SCAN_SOURCE=src/local_scan.c
1517+
1518+# If you want to specify options for your local_scan() that can be set from
1519+# the main Exim configuration file, you need to uncomment the following line,
1520+# and then provide a table of options in your local_scan() source, as described
1521+# in the reference manual.
1522+
1523+# LOCAL_SCAN_HAS_OPTIONS=yes
1524+
1525+
1526+#############################################################################
1527+# The following are all concerned with configuring the way Exim handles its
1528+# database (hints) and other dbm files.
1529+
1530+# Some systems require a separate library to be supplied when linking programs
1531+# that make use of DBM library calls. This can be set in DBMLIB, which is unset
1532+# by default, but is set in some of the OS-specific Makefiles. Setting it in
1533+# your Local/Makefile will override any other setting.
1534+
1535+# DBMLIB=
1536+
1537+
1538+# When Exim is attempting to lock one of its database (hints) files, it
1539+# applies a timeout which can be altered here.
1540+
1541+# EXIMDB_LOCK_TIMEOUT=60
1542+
1543+
1544+# By default, Exim uses traditional ndbm function calls to handle its indexed
1545+# hints databases. On systems that have Berkeley db installed, this still
1546+# works via the compatibility interface. However, by defining USE_DB you can
1547+# make it use native db function calls.
1548+
1549+# USE_DB=YES
1550+
1551+# Similarly, if you are using gdbm, Exim will by default use the ndbm
1552+# compatibility interface. However, by defining USE_GDBM you can make it
1553+# use the native gdbm function calls.
1554+
1555+# USE_GDBM=YES
1556+
1557+
1558+#############################################################################
1559+# The following definitions are relevant only when compiling the Exim monitor
1560+# program, which requires an X11 display. See the variable EXIM_MONITOR in
1561+# src/EDITME for how to suppress this compilation.
1562+
1563+# X11 contains the location of the X11 libraries and include files.
1564+
1565+X11=/usr/X11R6
1566+
1567+# XINCLUDE contains options for header inclusion when compiling functions
1568+# that call X11 functions.
1569+
1570+XINCLUDE=-I$(X11)/include
1571+
1572+# XLFLAGS contains flags to be passed to the linker when linking the monitor.
1573+
1574+XLFLAGS=-L$(X11)/lib
1575+
1576+# X11_LD_LIB contains the name of the X11 library that is to be added to
1577+# LD_LIBRARY_PATH when running the monitor program.
1578+
1579+X11_LD_LIB=$(X11)/lib
1580+
1581+# A modified version of the Athena TextPop module is supplied with Exim. The
1582+# modification is to remove the "replace" part of the "search and replace"
1583+# operation because it isn't wanted. TextPop is only one of a number of
1584+# modules that make up the Text widget. Some antique link editors cannot handle
1585+# the case of a replacement module for one of a set of modules. To allow
1586+# the monitor to be linked in such cases, set the value of EXIMON_TEXTPOP
1587+# to be empty. The search operations will then contain a useless "replace"
1588+# option, which is untidy, but does no harm.
1589+
1590+EXIMON_TEXTPOP=em_TextPop.o
1591+
1592+# End
1593diff --git a/OS/Makefile-FreeBSD b/OS/Makefile-FreeBSD
1594new file mode 100644
1595index 0000000..7c6c064
1596--- /dev/null
1597+++ b/OS/Makefile-FreeBSD
1598@@ -0,0 +1,54 @@
1599+# Exim: OS-specific make file for FreeBSD
1600+# There's no setting of CFLAGS here, to allow the system default
1601+# for "make" to be the default.
1602+
1603+CHOWN_COMMAND=/usr/sbin/chown
1604+STRIP_COMMAND=/usr/bin/strip
1605+CHMOD_COMMAND=/bin/chmod
1606+
1607+# FreeBSD Ports no longer insert compatibility symlinks into /usr/bin for
1608+# scripting languages which traditionally have had them.
1609+PERL_COMMAND=/usr/local/bin/perl
1610+
1611+HAVE_SA_LEN=YES
1612+
1613+# crypt() is in a separate library
1614+LIBS=-lcrypt -lm -lutil
1615+
1616+# Dynamically loaded modules need to be built with -fPIC
1617+CFLAGS_DYNAMIC=-shared -rdynamic -fPIC
1618+
1619+# FreeBSD always ships with Berkeley DB
1620+USE_DB=yes
1621+
1622+# This code for building outside ports suggested by Richard Clayton
1623+.ifdef X11BASE
1624+X11=${X11BASE}
1625+.elifdef LOCALBASE
1626+X11=$(LOCALBASE)
1627+.else
1628+X11=/usr/local
1629+.endif
1630+
1631+# nb: FreeBSD is entirely elf; objformat was removed prior to FreeBSD 7
1632+# http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/objformat/Attic/objformat.c
1633+# deleted Jan 2007.
1634+#
1635+# So if this fails, you're on an ancient unsupported FreeBSD release *and*
1636+# running GUI software, which seems both unusual and unwise.
1637+#
1638+# http://www.freebsd.org/doc/handbook/binary-formats.html suggests that the
1639+# switch to default to ELF came with FreeBSD 3. elf(5) claims ELF support
1640+# introduced in FreeBSD 2.2.6.
1641+#
1642+XINCLUDE=-I$(X11)/include
1643+XLFLAGS=-L$(X11)/lib -Wl,-rpath,${X11}/lib
1644+X11_LD_LIB=$(X11)/lib
1645+
1646+EXIWHAT_PS_ARG=-ax
1647+EXIWHAT_EGREP_ARG='/exim( |$$)'
1648+EXIWHAT_MULTIKILL_CMD='killall -m'
1649+EXIWHAT_MULTIKILL_ARG='^exim($$|-[0-9.]+-[0-9]+$$)'
1650+EXIWHAT_KILL_SIGNAL=-USR1
1651+
1652+# End
1653diff --git a/OS/Makefile-Linux b/OS/Makefile-Linux
1654new file mode 100644
1655index 0000000..990f884
1656--- /dev/null
1657+++ b/OS/Makefile-Linux
1658@@ -0,0 +1,36 @@
1659+# Exim: OS-specific make file for Linux. This is for modern Linuxes,
1660+# which use libc6.
1661+#
1662+# For Linux, we assume GNU Make; at time of writing, the only extension
1663+# used is ?= which is actually portable to other maintained Make variants,
1664+# just is not POSIX.
1665+
1666+HAVE_ICONV=yes
1667+
1668+BASENAME_COMMAND=look_for_it
1669+CHOWN_COMMAND=look_for_it
1670+CHGRP_COMMAND=look_for_it
1671+CHMOD_COMMAND=look_for_it
1672+
1673+# Preserve CFLAGS and CFLAGS_DYNAMIC from the caller/environment
1674+CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
1675+CFLAGS_DYNAMIC ?= -shared -rdynamic
1676+
1677+DBMLIB = -ldb
1678+USE_DB = yes
1679+
1680+LIBS = -lnsl -lcrypt -lm
1681+LIBRESOLV = -lresolv
1682+
1683+X11=/usr/X11R6
1684+XINCLUDE=-I$(X11)/include
1685+XLFLAGS=-L$(X11)/lib
1686+X11_LD_LIB=$(X11)/lib
1687+
1688+EXIWHAT_PS_ARG=ax
1689+EXIWHAT_EGREP_ARG='/exim( |$$)'
1690+EXIWHAT_MULTIKILL_CMD=killall
1691+EXIWHAT_MULTIKILL_ARG=exim
1692+EXIWHAT_KILL_SIGNAL=-USR1
1693+
1694+# End
1695diff --git a/OS/Makefile-OpenBSD b/OS/Makefile-OpenBSD
1696new file mode 100644
1697index 0000000..1022abb
1698--- /dev/null
1699+++ b/OS/Makefile-OpenBSD
1700@@ -0,0 +1,28 @@
1701+# Exim: OS-specific make file for OpenBSD
1702+
1703+CHOWN_COMMAND=/usr/sbin/chown
1704+CHGRP_COMMAND=/usr/sbin/chgrp
1705+CHMOD_COMMAND=/bin/chmod
1706+
1707+CFLAGS=-O2 -Wall
1708+
1709+LIBS=-lm
1710+
1711+HAVE_SA_LEN=YES
1712+
1713+X11=/usr/X11R6
1714+XINCLUDE=-I$(X11)/include
1715+XLFLAGS=-L$(X11)/lib
1716+
1717+EXIWHAT_MULTIKILL_CMD=pkill
1718+EXIWHAT_MULTIKILL_ARG='exim( |$$|-)'
1719+EXIWHAT_PS_ARG=-ax
1720+EXIWHAT_EGREP_ARG='/exim( |$$)'
1721+EXIWHAT_KILL_SIGNAL=-USR1
1722+
1723+HAVE_IPV6=YES
1724+
1725+# OpenBSD always ships with Berkeley DB
1726+USE_DB=yes
1727+
1728+# End
1729diff --git a/OS/Makefile-SunOS5 b/OS/Makefile-SunOS5
1730new file mode 100644
1731index 0000000..568e99f
1732--- /dev/null
1733+++ b/OS/Makefile-SunOS5
1734@@ -0,0 +1,24 @@
1735+# Exim: OS-specific make file for SunOS5
1736+
1737+CFLAGS=-O
1738+
1739+HAVE_ICONV=yes
1740+
1741+BASENAME_COMMAND=look_for_it
1742+HOSTNAME_COMMAND=look_for_it
1743+
1744+RANLIB=@true
1745+LIBS=-lsocket -lnsl -lkstat -lm
1746+LIBRESOLV=-lresolv
1747+
1748+EXIWHAT_MULTIKILL_CMD=pkill
1749+EXIWHAT_MULTIKILL_ARG='exim( |$$|-)'
1750+
1751+X11=/usr/openwin
1752+XINCLUDE=-I$(X11)/include
1753+XLFLAGS=-L$(X11)/lib -R$(X11)/lib
1754+X11LIB=$(X11)/lib
1755+
1756+OS_C_INCLUDES=setenv.c
1757+
1758+# End
1759diff --git a/OS/eximon.conf-Default b/OS/eximon.conf-Default
1760new file mode 100644
1761index 0000000..2f874ef
1762--- /dev/null
1763+++ b/OS/eximon.conf-Default
1764@@ -0,0 +1,41 @@
1765+# Exim: Default settings for the eximon script which fires up the Exim monitor.
1766+# These can be overridden by OS-specific scripts and local installation
1767+# scripts, and also at run time by shell variables.
1768+
1769+# The name of the eximon binary, usually the same as the eximon script,
1770+# with .bin stuck on the end.
1771+
1772+EXIMON_BINARY="${EXIMON_BINARY-$0.bin}"
1773+
1774+# The remaining parameters are values likely to be changed to suit the
1775+# user's taste. They are documented in the EDITME file.
1776+
1777+WINDOW_TITLE=${EXIMON_WINDOW_TITLE-'"${hostname} eximon"'}
1778+
1779+ACTION_OUTPUT=${EXIMON_ACTION_OUTPUT-no}
1780+ACTION_QUEUE_UPDATE=${EXIMON_ACTION_QUEUE_UPDATE-yes}
1781+BODY_MAX=${EXIMON_BODY_MAX-20000}
1782+LOG_DEPTH=${EXIMON_LOG_DEPTH-300}
1783+LOG_WIDTH=${EXIMON_LOG_WIDTH-${EXIMON_WIDTH-950}}
1784+LOG_BUFFER=${EXIMON_LOG_BUFFER-20K}
1785+LOG_FONT=${EXIMON_LOG_FONT--misc-fixed-medium-r-normal-*-14-140-*-*-*-*-iso8859-1}
1786+LOG_STRIPCHARTS='/ <= /in/
1787+ / => /out/
1788+ / => .+ R=local/local/
1789+ / => .+ T=[^ ]*smtp/smtp/'
1790+MENU_EVENT=${EXIMON_MENU_EVENT-'Shift<Btn1Down>'}
1791+MIN_HEIGHT=${EXIMON_MIN_HEIGHT-162}
1792+MIN_WIDTH=${EXIMON_MIN_WIDTH-103}
1793+QUEUE_DEPTH=${EXIMON_QUEUE_DEPTH-200}
1794+QUEUE_WIDTH=${EXIMON_QUEUE_WIDTH-${EXIMON_WIDTH-950}}
1795+QUEUE_FONT=${EXIMON_QUEUE_FONT-${LOG_FONT}}
1796+QUEUE_MAX_ADDRESSES=${EXIMON_QUEUE_MAX_ADDRESSES-10}
1797+QUEUE_INTERVAL=${EXIMON_QUEUE_INTERVAL-300}
1798+QUEUE_STRIPCHART_NAME=${EXIMON_QUEUE_STRIPCHART_NAME-queue}
1799+SIZE_STRIPCHART=${EXIMON_SIZE_STRIPCHART}
1800+SIZE_STRIPCHART_NAME=${EXIMON_SIZE_STRIPCHART_NAME}
1801+START_SMALL=${EXIMON_START_SMALL-no}
1802+STRIPCHART_INTERVAL=${EXIMON_STRIPCHART_INTERVAL-60}
1803+TEXT_DEPTH=${EXIMON_TEXT_DEPTH-200}
1804+
1805+# End
1806diff --git a/OS/os.Configuring b/OS/os.Configuring
1807new file mode 100644
1808index 0000000..465bc26
1809--- /dev/null
1810+++ b/OS/os.Configuring
1811@@ -0,0 +1,215 @@
1812+Configuring Exim for different Operating Systems
1813+------------------------------------------------
1814+
1815+These notes describe the way in which Exim is configured at the C program level
1816+for different operating systems. The normal configuration options that apply
1817+independently of the operating system are specified by creating files in the
1818+Local directory, as described in chapter 4 of the manual.
1819+
1820+These notes cover the os.* files in the OS directory, and contain information
1821+for people who want to port the program to some new OS, or to modify the
1822+configuration for an existing port. If you are just wanting to compile Exim on
1823+a system that it already knows about, you do not need to read further unless
1824+there are problems.
1825+
1826+The os.c-<ostype> files
1827+-----------------------
1828+
1829+There may be an os.c-<ostype> file for each operating system, but for many of
1830+them it is not necessary. No error occurs is there isn't one. There is a
1831+generic file called os.c which contains code that is common to two or more OS
1832+for setting a restarting or a non-restarting signal, for computing the load
1833+average, and for finding all the network interface addresses. A few OS have
1834+their own individual code for one or more of these. When they do, the code is
1835+put into an os.c-<ostype> file, which also defines a macro such as
1836+OS_RESTARTING_SIGNAL (for example) to cut out the common code in the generic
1837+os.c.
1838+
1839+The os.h-<ostype> files
1840+-----------------------
1841+
1842+For each OS that Exim knows about, there is an os.h-<ostype> file, where
1843+<ostype> is the OS name. The relevant file is included as a C header file for
1844+all Exim compilation by pointing a symbolic link called os.h at it from the
1845+build directory. The settings are as follows:
1846+
1847+The select() function
1848+---------------------
1849+
1850+There is a difference in the data type for the second argument to the select()
1851+function in some OS. The macro SELECT_ARG2_TYPE can be used to define the type.
1852+If it is not defined in os.h, then it is defaulted to fs_set in exim.h.
1853+
1854+The dn_expand() function
1855+------------------------
1856+
1857+There is a difference in the data type for the fourth argument to the
1858+dn_expand() function in some OS. The macro DN_EXPAND_ARG4_TYPE can be used to
1859+define the type. If it is not defined in os.h, then it is defaulted to char *
1860+in exim.h.
1861+
1862+The h_errno variable
1863+--------------------
1864+
1865+If NEED_H_ERRNO is defined, then a definition of the form
1866+
1867+extern int h_errno
1868+
1869+is included in the compiled code of Exim.
1870+
1871+The strerror() function
1872+-----------------------
1873+
1874+Most systems provide the ANSI standard strerror() function; older systems may
1875+instead have an errlist[] variable in which to look up error texts. Defining
1876+STRERROR_FROM_ERRLIST causes Exim to build its own strerror() function that
1877+mimics the ANSI function by lookup up the error code in errlist.
1878+
1879+Truncating files
1880+----------------
1881+
1882+The fcntl() option for truncating the length of a file is called F_FREESP in
1883+most systems; in some, however, it is called O_TRUNC. Some os.h files define
1884+F_FREESP to be O_TRUNC for this reason.
1885+
1886+Finding local interfaces
1887+------------------------
1888+
1889+The SIOCGIFCONF ioctl for finding local interfaces behaves differently on BSD
1890+systems. It returns a vector of ifreq blocks containing sockaddr structures
1891+that can be longer than their sizeof definition, making the returned ifreq
1892+blocks longer than their sizeof definitions. BSD sockaddrs structures contain
1893+an sa_len field giving the actual size. To cope with difference, there is a
1894+macro called HAVE_SA_LEN. If it is defined, code that works on BSD systems is
1895+used. Otherwise, the objects returned by SIOCGIFCONF are assumed to be of
1896+length sizeof(struct ifreq).
1897+
1898+On some operating systems, the SIOCGIFCONF ioctl returns the IP addresses
1899+with the list of interfaces, and there is no need to call SIOCGIFADDR for each
1900+individual address. Mostly, making the second call does no harm, but on Linux
1901+when there are IP aliases, it causes things to go wrong. This also happens on
1902+BSDI and GNU Hurd. Therefore, there is now a macro to cut it out, called
1903+SIOCGIFCONF_GIVES_ADDR.
1904+
1905+Note that, if IPv6 support is configured, Exim cannot find the IPv6 addresses
1906+on local interfaces by itself. You need to set the local_interfaces option in
1907+this situation.
1908+
1909+Computing load averages
1910+-----------------------
1911+
1912+There are several different ways that load averages are computed. One-off code
1913+is put in the os.c-<ostype>, but several OS use similar methods, and these
1914+are coded in the generic os.c, using a number of parameters to make variations
1915+between OS.
1916+
1917+Sometimes the load average is not available to unprivileged callers. If
1918+LOAD_AVG_NEEDS_ROOT is set, Exim ensures that it is root before trying to
1919+obtain a load average value.
1920+
1921+(1) If HAVE_BSD_GETLOADAVG is defined, Exim uses a simple call to the
1922+getloadavg() function.
1923+
1924+(2) If HAVE_KSTAT is defined, Exim uses the kstat package as found in Solaris 2
1925+(but nowhere else as yet). It uses some supplementary definitions:
1926+
1927+ LOAD_AVG_KSTAT the kstat to use
1928+ LOAD_AVG_KSTAT_MODULE the module to access
1929+ LOAD_AVG_KSTAT_SYMBOL the symbol containing the value we want
1930+ LOAD_AVG_KSTAT_FIELD the field identity
1931+
1932+(3) If HAVE_DEV_KMEM is defined, Exim reads load average values from the
1933+/dev/kmem device. It uses some supplementary definitions:
1934+
1935+ LOAD_AVG_TYPE the data type
1936+ LOAD_AVG_SYMBOL the symbol to look up
1937+ KERNEL_PATH the name of the kernel
1938+ FSCALE a scaling factor
1939+
1940+Sometimes FSCALE is defined in system headers so need not be defined in the
1941+os.h-<ostype> file.
1942+
1943+Glibc systems and IP options
1944+----------------------------
1945+
1946+The code for inspecting IP options is the same in all OS except for systems
1947+using glibc (e.g. Linux), which uses a different structure to return data from
1948+getsockopt(). To handle this, there is a macro called
1949+
1950+ GLIBC_IP_OPTIONS
1951+
1952+which should be set for Linux (in os.h-Linux) and any other operating system
1953+that uses glibc.
1954+
1955+Options for statvfs()
1956+---------------------
1957+
1958+The following settings apply to the compilation of the Exim monitor as well as
1959+to the main Exim binary.
1960+
1961+#undefine HAVE_STATFS
1962+
1963+Exim has options for checking the amount of space in the spool partition
1964+before accepting a message, and the monitor has the ability to display a
1965+stripchart of the percentage fullness of a particular disc partition, usually
1966+/var/spool/mail. The standard way of finding out the data is to call the
1967+statvfs() function, but some operating systems use statfs() and some may not
1968+have the ability at all. The Exim code uses STATVFS() for this function and
1969+this gets defined appropriately. HAVE_STATFS is defined before including the
1970+os.h file; undefining it suppresses the code for checking a partition in the
1971+main binary, and for monitoring disc partition in the monitor.
1972+
1973+When HAVE_STATFS is defined, the distinction between statvfs() and statfs() is
1974+made by checking HAVE_SYS_STATVFS_H. If it is defined, then sys/statvfs.h is
1975+included. Otherwise, STATVFS() is defined as a macro for statfs(), and some
1976+further includes are done, according to the following definitions:
1977+
1978+#define HAVE_SYS_MOUNT_H
1979+#define HAVE_VFS_H
1980+
1981+Each of those definitions causes the inclusion of the corresponding system
1982+header file in the Exim monitor compilation. For example, the first one causes
1983+
1984+#include <sys/mount.h>
1985+
1986+to be obeyed. Different systems may require different combinations of these
1987+headers.
1988+
1989+The sys/resource.h header
1990+-------------------------
1991+
1992+One OS does not have the sys/resource.h header. If NO_SYS_RESOURCE_H is defined
1993+in an os.h-<ostype> file, then the #include for this header is skipped in
1994+exim.h.
1995+
1996+Support for login_cap functions
1997+-------------------------------
1998+
1999+Some of the BSD systems support functions for controlling the resources that
2000+user processes can use (e.g. login_getpwclass). If HAVE_SETCLASSRESOURCES is
2001+defined, Exim supports this feature for running pipe deliveries, using the
2002+setclassresources() function.
2003+
2004+The crypt_h header
2005+------------------
2006+
2007+Some OS require crypt.h to be included to get a prototype for the crypt()
2008+function. This is needed only when compiling with AUTH support. If CRYPT_H is
2009+defined, then this header is included.
2010+
2011+mmap() support
2012+--------------
2013+
2014+The CDB support includes the option of handling file operations by using
2015+mmap()/munmap(). This gives a reasonable performance increase which will
2016+probably scale over multiple processes (since the files are mapped read-only
2017+shared). The vast majority of modern operating systems will support mmap
2018+(certainly in the simplified way that it is being used here). For example any
2019+BSD 4.x derived or POSIX compliant system will support it, as will pretty much
2020+any system using dynamically shared link libraries.
2021+
2022+If the OS is believed to support mmap() then the symbol HAVE_MMAP is defined.
2023+Not all systems that support mmap will have had their config files updated to
2024+reflect this. Currently Linux, Sun, BSD and SGI/mips systems have been updated.
2025+
2026+*** End ***
2027diff --git a/OS/os.c-FreeBSD b/OS/os.c-FreeBSD
2028new file mode 100644
2029index 0000000..715a9ed
2030--- /dev/null
2031+++ b/OS/os.c-FreeBSD
2032@@ -0,0 +1,24 @@
2033+/*************************************************
2034+* Exim - an Internet mail transport agent *
2035+*************************************************/
2036+
2037+/* Copyright (c) Jeremy Harris 2017 */
2038+/* See the file NOTICE for conditions of use and distribution. */
2039+
2040+/* FreeBSD-specific code. This is concatenated onto the generic
2041+src/os.c file. */
2042+
2043+
2044+/*************
2045+* Sendfile *
2046+*************/
2047+
2048+ssize_t
2049+os_sendfile(int out, int in, off_t * off, size_t cnt)
2050+{
2051+off_t written;
2052+return sendfile(in, out, *off, cnt, NULL, &written, 0) < 0
2053+ ? (ssize_t) -1 : (ssize_t) written;
2054+}
2055+
2056+/* End of os.c-Linux */
2057diff --git a/OS/os.c-Linux b/OS/os.c-Linux
2058new file mode 100644
2059index 0000000..a10bc7d
2060--- /dev/null
2061+++ b/OS/os.c-Linux
2062@@ -0,0 +1,165 @@
2063+/*************************************************
2064+* Exim - an Internet mail transport agent *
2065+*************************************************/
2066+
2067+/* Copyright (c) University of Cambridge 1997 - 2017 */
2068+/* See the file NOTICE for conditions of use and distribution. */
2069+
2070+/* Linux-specific code. This is concatenated onto the generic
2071+src/os.c file. */
2072+
2073+
2074+/*************************************************
2075+* Load average computation *
2076+*************************************************/
2077+
2078+/*Linux has an apparently unique way of getting the load average, so we provide
2079+a unique function here, and define OS_LOAD_AVERAGE to stop src/os.c trying to
2080+provide the function. However, when compiling os.c for utilities, we may not
2081+want this at all, so check that it isn't set first. */
2082+
2083+#if !defined(OS_LOAD_AVERAGE) && defined(__linux__)
2084+#define OS_LOAD_AVERAGE
2085+
2086+/* Linux has 2 ways of returning load average:
2087+
2088+ (1) Do a read on /proc/loadavg
2089+ (2) Use the sysinfo library function and syscall
2090+
2091+The latter is simpler but in Linux 2.0 - 2.2 (and probably later releases) is
2092+exceptionally slow - 10-50ms per call is not unusual and about 100x slow the
2093+first method. This cripples high performance mail servers by increasing CPU
2094+utilisation by 3-5x.
2095+
2096+In Exim's very early days, it used the 1st method. Later, it switched to the
2097+2nd method. Now it tries the 1st method and falls back to the 2nd if /proc is
2098+unavailable. */
2099+
2100+#include <sys/sysinfo.h>
2101+
2102+static int
2103+linux_slow_getloadavg(void)
2104+{
2105+struct sysinfo s;
2106+double avg;
2107+if (sysinfo(&s) < 0) return -1;
2108+avg = (double) (s.loads[0]) / (1<<SI_LOAD_SHIFT);
2109+return (int)(avg * 1000.0);
2110+}
2111+
2112+int
2113+os_getloadavg(void)
2114+{
2115+char buffer[40];
2116+double avg;
2117+int count;
2118+int fd = open ("/proc/loadavg", O_RDONLY);
2119+if (fd == -1) return linux_slow_getloadavg();
2120+count = read (fd, buffer, sizeof(buffer));
2121+(void)close (fd);
2122+if (count <= 0) return linux_slow_getloadavg();
2123+count = sscanf (buffer, "%lf", &avg);
2124+if (count < 1) return linux_slow_getloadavg();
2125+return (int)(avg * 1000.0);
2126+}
2127+#endif /* OS_LOAD_AVERAGE */
2128+
2129+
2130+
2131+
2132+
2133+/*************************************************
2134+* Finding interface addresses *
2135+*************************************************/
2136+
2137+/* This function is not required for utilities; we cut it out if
2138+FIND_RUNNING_INTERFACES is already defined. */
2139+
2140+#ifndef FIND_RUNNING_INTERFACES
2141+
2142+/* This code, contributed by Jason Gunthorpe, appears to be the current
2143+way of finding IPv6 interfaces in Linux. It first calls the common function in
2144+order to find IPv4 interfaces, then grobbles around to find the others. Jason
2145+said, "This is so horrible, don't look. Slightly ripped from net-tools
2146+ifconfig." It gets called by virtue of os_find_running_interfaces being defined
2147+as a macro for os_find_running_interfaces_linux in the os.h-Linux file. */
2148+
2149+ip_address_item *
2150+os_find_running_interfaces_linux(void)
2151+{
2152+ip_address_item *yield = NULL;
2153+
2154+#if HAVE_IPV6
2155+ip_address_item *last = NULL;
2156+ip_address_item *next;
2157+char addr6p[8][5];
2158+unsigned int plen, scope, dad_status, if_idx;
2159+char devname[20+1];
2160+FILE *f;
2161+#endif
2162+
2163+yield = os_common_find_running_interfaces();
2164+
2165+#if HAVE_IPV6
2166+
2167+/* Open the /proc file; give up if we can't. */
2168+
2169+if ((f = fopen("/proc/net/if_inet6", "r")) == NULL) return yield;
2170+
2171+/* Pick out the data from within the file, and add it on to the chain */
2172+
2173+last = yield;
2174+if (last != NULL) while (last->next != NULL) last = last->next;
2175+
2176+while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
2177+ addr6p[0], addr6p[1], addr6p[2], addr6p[3],
2178+ addr6p[4], addr6p[5], addr6p[6], addr6p[7],
2179+ &if_idx, &plen, &scope, &dad_status, devname) != EOF)
2180+ {
2181+ struct sockaddr_in6 addr;
2182+
2183+ /* This data has to survive for ever, so use malloc. */
2184+
2185+ next = store_malloc(sizeof(ip_address_item));
2186+ next->next = NULL;
2187+ next->port = 0;
2188+ sprintf(CS next->address, "%s:%s:%s:%s:%s:%s:%s:%s",
2189+ addr6p[0], addr6p[1], addr6p[2], addr6p[3],
2190+ addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
2191+
2192+ /* Normalize the representation */
2193+
2194+ inet_pton(AF_INET6, CS next->address, &addr.sin6_addr);
2195+ inet_ntop(AF_INET6, &addr.sin6_addr, CS next->address, sizeof(next->address));
2196+
2197+ if (yield == NULL) yield = last = next; else
2198+ {
2199+ last->next = next;
2200+ last = next;
2201+ }
2202+
2203+ DEBUG(D_interface)
2204+ debug_printf("Actual local interface address is %s (%s)\n", last->address,
2205+ devname);
2206+ }
2207+fclose(f);
2208+#endif /* HAVE_IPV6 */
2209+
2210+return yield;
2211+}
2212+
2213+#endif /* FIND_RUNNING_INTERFACES */
2214+
2215+
2216+/*************
2217+* Sendfile *
2218+*************/
2219+#include <sys/sendfile.h>
2220+
2221+ssize_t
2222+os_sendfile(int out, int in, off_t * off, size_t cnt)
2223+{
2224+return sendfile(out, in, off, cnt);
2225+}
2226+
2227+/* End of os.c-Linux */
2228diff --git a/OS/os.c-SunOS5 b/OS/os.c-SunOS5
2229new file mode 100644
2230index 0000000..1624869
2231--- /dev/null
2232+++ b/OS/os.c-SunOS5
2233@@ -0,0 +1,16 @@
2234+/*************************************************
2235+* Exim - an Internet mail transport agent *
2236+*************************************************/
2237+
2238+/* Copyright (c) University of Cambridge 2016 */
2239+/* Copyright (c) Jeremy Harris 2016 */
2240+/* See the file NOTICE for conditions of use and distribution. */
2241+
2242+/* Solaris-specific code. This is concatenated onto the generic
2243+src/os.c file. */
2244+
2245+#if defined(MISSING_UNSETENV_3) && !defined(COMPILE_UTILITY)
2246+# include "setenv.c"
2247+#endif
2248+
2249+/* End of os.c-SunOS5 */
2250diff --git a/OS/os.h-FreeBSD b/OS/os.h-FreeBSD
2251new file mode 100644
2252index 0000000..8b1af39
2253--- /dev/null
2254+++ b/OS/os.h-FreeBSD
2255@@ -0,0 +1,68 @@
2256+/* Exim: OS-specific C header file for FreeBSD */
2257+/* Copyright (c) University of Cambridge 2017 */
2258+/* See the file NOTICE for conditions of use and distribution. */
2259+
2260+
2261+#include <sys/types.h>
2262+
2263+#define HAVE_BSD_GETLOADAVG
2264+#define HAVE_SETCLASSRESOURCES
2265+#define HAVE_MMAP
2266+#define HAVE_SYS_MOUNT_H
2267+#define SIOCGIFCONF_GIVES_ADDR
2268+#define HAVE_SRANDOMDEV
2269+#define HAVE_ARC4RANDOM
2270+
2271+typedef struct flock flock_t;
2272+
2273+/* iconv arg2 type: libiconv in Ports uses "const char* * inbuf" and was
2274+ * traditionally the only approach available. The iconv functionality
2275+ * in libc is "char ** restrict src".
2276+ *
2277+ * <https://www.freebsd.org/doc/en/books/porters-handbook/using-iconv.html>
2278+ * says that libc has iconv since 2013, in 10-CURRENT. FreeBSD man-pages
2279+ * shows it included in 10.0-RELEASE. Writing this in 2017, 10.3 is the
2280+ * oldest supported release, so we should assume non-libiconv by default.
2281+ * (Actually, people still using old releases past EOL; we shouldn't support
2282+ * them but I don't want to deal with howls of complaints because we dare
2283+ * to not support the unsupported, so guard this on FreeBSD 10+)
2284+ *
2285+ * Thus we no longer override iconv.
2286+ *
2287+ * However, if libiconv is installed, and anything adds /usr/local/include
2288+ * to include-path (likely) then we'll get that. So define a variable
2289+ * which makes the libiconv try to not interfere with OS iconv.
2290+ */
2291+#if __FreeBSD__ >= 10
2292+# define LIBICONV_PLUG
2293+#endif
2294+/* for more specific version constraints, include <sys/param.h> and look at
2295+ * __FreeBSD_version */
2296+
2297+
2298+/* When using DKIM, setting OS_SENDFILE can increase
2299+performance on outgoing mail a bit. */
2300+
2301+#define OS_SENDFILE
2302+extern ssize_t os_sendfile(int, int, off_t *, size_t);
2303+
2304+
2305+/*******************/
2306+
2307+/* TCP_FASTOPEN support. There does not seems to be a
2308+MSG_FASTOPEN defined yet... */
2309+#define EXIM_TFO_PROBE
2310+
2311+#include <netinet/tcp.h> /* for TCP_FASTOPEN */
2312+#include <sys/socket.h> /* for MSG_FASTOPEN */
2313+#if defined(TCP_FASTOPEN) && !defined(MSG_FASTOPEN)
2314+# define MSG_FASTOPEN 0x20000000
2315+#endif
2316+
2317+/* for TCP state-variable values, for TFO logging */
2318+#include <netinet/tcp_fsm.h>
2319+#define TCP_SYN_RECV TCPS_SYN_RECEIVED
2320+
2321+/*******************/
2322+
2323+/* End */
2324diff --git a/OS/os.h-Linux b/OS/os.h-Linux
2325new file mode 100644
2326index 0000000..88c4d91
2327--- /dev/null
2328+++ b/OS/os.h-Linux
2329@@ -0,0 +1,88 @@
2330+/* Exim: OS-specific C header file for Linux */
2331+/* Copyright (c) University of Cambridge 2017 */
2332+/* See the file NOTICE for conditions of use and distribution. */
2333+
2334+
2335+/* Some old systems we've received bug-reports for have a <limits.h> which
2336+does not pull in <features.h>. Best to just pull it in now and have done
2337+with the issue. */
2338+
2339+#include <features.h>
2340+#include <sys/types.h>
2341+
2342+
2343+#define CRYPT_H
2344+#define GLIBC_IP_OPTIONS
2345+#define HAVE_MMAP
2346+#define HAVE_BSD_GETLOADAVG
2347+#define HAVE_SYS_STATVFS_H
2348+#define NO_IP_VAR_H
2349+#define SIG_IGN_WORKS
2350+
2351+/* When using DKIM, setting OS_SENDFILE can increase
2352+performance on outgoing mail a bit. Note: With older glibc versions
2353+this setting will conflict with the _FILE_OFFSET_BITS=64 setting
2354+defined as part of the Linux CFLAGS. As of 2017 those are declared
2355+to be too old to build by default. */
2356+
2357+#define OS_SENDFILE
2358+extern ssize_t os_sendfile(int, int, off_t *, size_t);
2359+
2360+#define F_FREESP O_TRUNC
2361+typedef struct flock flock_t;
2362+
2363+#define os_strsignal strsignal
2364+#define OS_STRSIGNAL
2365+
2366+#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD_kernel__)
2367+# define SIOCGIFCONF_GIVES_ADDR
2368+# define HAVE_SYS_MOUNT_H
2369+#endif
2370+
2371+#if defined(__linux__)
2372+
2373+/* Some versions of Linux need explicit sync-ing of directories as well as
2374+files. This setting requests that. If the directory is on NFS, it may not
2375+be possible to sync it - in that case, Exim now should ignore the error. But
2376+if you have problems in that area, try undefining this. But be aware that you
2377+may be in a situation where files are not being properly "committed to stable
2378+storage" as quickly as Exim thinks they are. */
2379+
2380+#define NEED_SYNC_DIRECTORY
2381+
2382+#define os_find_running_interfaces os_find_running_interfaces_linux
2383+
2384+/* Need a prototype for the Linux-specific function. The structure hasn't
2385+been defined yet, so we need to pre-declare it. */
2386+
2387+struct ip_address_item;
2388+extern struct ip_address_item *os_find_running_interfaces_linux(void);
2389+
2390+#endif /* __linux__ */
2391+
2392+/* Some folks running "unusual" setups with very old libc environments have
2393+found that _GNU_SOURCE=1 before <features.h> is not sufficient to define some
2394+constants needed for 64-bit arithmetic. If you encounter build errors based
2395+on LLONG_MIN being undefined and various other escape hatches have not helped,
2396+then change the 0 to 1 in the next block. */
2397+
2398+#if 0
2399+# define LLONG_MIN LONG_LONG_MIN
2400+# define LLONG_MAX LONG_LONG_MAX
2401+#endif
2402+
2403+#if _POSIX_C_SOURCE >= 200809L || _ATFILE_SOUCE
2404+# define EXIM_HAVE_OPENAT
2405+#endif
2406+
2407+/* TCP Fast Open support */
2408+
2409+#include <netinet/tcp.h> /* for TCP_FASTOPEN */
2410+#include <sys/socket.h> /* for MSG_FASTOPEN */
2411+#if defined(TCP_FASTOPEN) && !defined(MSG_FASTOPEN)
2412+# define MSG_FASTOPEN 0x20000000
2413+#endif
2414+#define EXIM_HAVE_TCPI_UNACKED
2415+
2416+
2417+/* End */
2418diff --git a/OS/os.h-OpenBSD b/OS/os.h-OpenBSD
2419new file mode 100644
2420index 0000000..81ed487
2421--- /dev/null
2422+++ b/OS/os.h-OpenBSD
2423@@ -0,0 +1,56 @@
2424+/* Exim: OS-specific C header file for OpenBSD */
2425+/* Copyright (c) University of Cambridge 2017 */
2426+/* See the file NOTICE for conditions of use and distribution. */
2427+
2428+
2429+#define HAVE_BSD_GETLOADAVG
2430+#define HAVE_MMAP
2431+#define HAVE_SYS_MOUNT_H
2432+#define SIOCGIFCONF_GIVES_ADDR
2433+#define HAVE_ARC4RANDOM
2434+/* In May 2014, OpenBSD 5.5 was released which cleaned up the arc4random_* API
2435+ which removed the arc4random_stir() function. Set NOT_HAVE_ARC4RANDOM_STIR
2436+ if the version released is past that point. */
2437+#include <sys/param.h>
2438+#if OpenBSD >= 201405
2439+# define NOT_HAVE_ARC4RANDOM_STIR
2440+#endif
2441+
2442+typedef struct flock flock_t;
2443+
2444+#define os_strsignal strsignal
2445+#define OS_STRSIGNAL
2446+
2447+typedef struct __res_state *res_state;
2448+
2449+/* default is non-const */
2450+#define ICONV_ARG2_TYPE const char **
2451+
2452+#ifndef EPROTO
2453+# define EPROTO 71
2454+#endif
2455+
2456+/* We need to force this; the automatic in buildconfig.c gets %ld */
2457+#ifdef OFF_T_FMT
2458+# undef OFF_T_FMT
2459+# undef LONGLONG_T
2460+#endif
2461+#define OFF_T_FMT "%lld"
2462+#define LONGLONG_T long long int
2463+
2464+#ifdef PID_T_FMT
2465+# undef PID_T_FMT
2466+#endif
2467+#define PID_T_FMT "%d"
2468+
2469+#ifdef INO_T_FMT
2470+# undef INO_T_FMT
2471+#endif
2472+#define INO_T_FMT "%llu"
2473+
2474+#ifdef TIME_T_FMT
2475+# undef TIME_T_FMT
2476+#endif
2477+#define TIME_T_FMT "%lld"
2478+
2479+/* End */
2480diff --git a/OS/os.h-SunOS5 b/OS/os.h-SunOS5
2481new file mode 100644
2482index 0000000..dfbd8f1
2483--- /dev/null
2484+++ b/OS/os.h-SunOS5
2485@@ -0,0 +1,51 @@
2486+/* Exim: OS-specific C header file for SunOS5 aka Solaris */
2487+
2488+#define CRYPT_H
2489+#define HAVE_MMAP
2490+#define HAVE_SYS_STATVFS_H
2491+#define F_FAVAIL f_favail
2492+#define SIOCGIFCONF_GIVES_ADDR
2493+
2494+#define HAVE_GETIPNODEBYNAME 1
2495+#define HAVE_GETIPNODEBYADDR 1
2496+
2497+#define HAVE_KSTAT
2498+#define LOAD_AVG_KSTAT "system_misc"
2499+#define LOAD_AVG_KSTAT_MODULE "unix"
2500+#define LOAD_AVG_SYMBOL "avenrun_1min"
2501+#define LOAD_AVG_FIELD value.ui32
2502+
2503+#define os_strsignal strsignal
2504+#define OS_STRSIGNAL
2505+
2506+/* This is needed for some early Solaris releases, but causes trouble
2507+in the current ones, so it is out by default. */
2508+
2509+/* #define EXIM_SOCKLEN_T size_t */
2510+
2511+/* This is different from Linux and all other PAM implementations,
2512+it seems. */
2513+
2514+#define PAM_CONVERSE_ARG2_TYPE struct pam_message
2515+
2516+
2517+/* default is non-const */
2518+#define ICONV_ARG2_TYPE const char **
2519+
2520+#if _POSIX_C_SOURCE < 200112L
2521+# define MISSING_UNSETENV_3
2522+#endif
2523+
2524+
2525+/* SunOS5 doesn't accept getcwd(NULL, 0) to auto-allocate
2526+a buffer */
2527+
2528+#define OS_GETCWD
2529+
2530+
2531+#ifndef MIN
2532+# define MIN(a,b) (((a)<(b))?(a):(b))
2533+# define MAX(a,b) (((a)>(b))?(a):(b))
2534+#endif
2535+
2536+/* End */
2537diff --git a/OS/unsupported/Makefile-AIX b/OS/unsupported/Makefile-AIX
2538new file mode 100644
2539index 0000000..fc32aa2
2540--- /dev/null
2541+++ b/OS/unsupported/Makefile-AIX
2542@@ -0,0 +1,28 @@
2543+# Exim: OS-specific make file for AIX
2544+# Written by Nick Waterman (nick@cimio.co.uk)
2545+# Modified by PH following a message from Mike Meredith
2546+
2547+# Note that the output of uname -m is probably not what Philip expected,
2548+# so you might end up with more build-AIX-random_number directories than
2549+# you expected if you have too many AIX boxes, but it seems to work... I
2550+# blame IBM.
2551+
2552+# Note that nowadays you have to pay extra for a cc compiler with AIX!
2553+
2554+CC=gcc
2555+
2556+# This needs to be in here rather than os.h-AIX because of regexp stuff.
2557+# basically strchr is a #define, which means "extern char *strchr()"
2558+# ruins things. __STR31__ seems to get around this by magic. The AIX
2559+# include files are quite a confusing maze.
2560+# Mike M says this is not necessary any more; possibly this is related to
2561+# using gcc. Commented out by PH.
2562+#CFLAGS = -D__STR31__
2563+
2564+CFLAGS = -mcpu=power4 -maix64 -O3
2565+
2566+# Needed for vfork() and vfork() only?
2567+
2568+LIBS = -lbsd -lm
2569+
2570+# End
2571diff --git a/OS/unsupported/Makefile-BSDI b/OS/unsupported/Makefile-BSDI
2572new file mode 100644
2573index 0000000..d56aa9b
2574--- /dev/null
2575+++ b/OS/unsupported/Makefile-BSDI
2576@@ -0,0 +1,21 @@
2577+# Exim: OS-specific make file for BSDI aka BSD/OS. Its antique link editor
2578+# cannot handle the TextPop overriding.
2579+
2580+CFLAGS=-O
2581+CHOWN_COMMAND=/usr/sbin/chown
2582+
2583+HAVE_SA_LEN=YES
2584+
2585+X11=/usr/X11
2586+XINCLUDE=-I$(X11)/include
2587+XLFLAGS=-L$(X11)/lib
2588+X11_LD_LIB=$(X11)/lib
2589+
2590+LIBS_EXIMON=-lSM -lICE -lipc -lm
2591+EXIMON_TEXTPOP=
2592+
2593+EXIWHAT_PS_ARG=-ax
2594+EXIWHAT_EGREP_ARG='/exim( |$$)'
2595+EXIWHAT_KILL_SIGNAL=-USR1
2596+
2597+# End
2598diff --git a/OS/unsupported/Makefile-CYGWIN b/OS/unsupported/Makefile-CYGWIN
2599new file mode 100644
2600index 0000000..006e9fe
2601--- /dev/null
2602+++ b/OS/unsupported/Makefile-CYGWIN
2603@@ -0,0 +1,113 @@
2604+# OS-specific file for Cygwin.
2605+
2606+# This file provided by Pierre A. Humblet <Pierre.Humblet@ieee.org>
2607+
2608+HAVE_IPV6 = yes
2609+HAVE_ICONV = yes
2610+# Use c99 to have %z
2611+CFLAGS= -g -Wall -std=c99 -U __STRICT_ANSI__
2612+LIBS= -lcrypt -lresolv
2613+LIBS_EXIM= -liconv
2614+EXIWHAT_PS_ARG=-as
2615+EXIWHAT_KILL_SIGNAL=-USR1
2616+EXIWHAT_EGREP_ARG='/(EXIM|exim)[0-9. -]*$$'
2617+
2618+DBMLIB=-lgdbm
2619+USE_GDBM=YES
2620+
2621+# Some OS add a suffix to executables
2622+EXE = .exe
2623+
2624+# To add a resource file with an icon
2625+LIBS_EXIM +=../Local/exim_res.o
2626+
2627+# To produce a linker map
2628+#LIBS_EXIM+=-Wl,-Map,Exim.Map
2629+
2630+
2631+##################################################
2632+# The following is normally set in local/Makefile.
2633+# Makefile.cygwin provides defaults with which the
2634+# precompiled version is built
2635+##################################################
2636+
2637+BIN_DIRECTORY=/usr/bin
2638+CONFIGURE_FILE=/etc/exim.conf
2639+EXIM_USER=18 # This changes if user exim exists
2640+EXIM_GROUP=544 # Administrators
2641+SPOOL_DIRECTORY=/var/spool/exim
2642+LOG_FILE_PATH=/var/log/exim/exim_%s.log
2643+TIMEZONE_DEFAULT = ""
2644+
2645+AUTH_CRAM_MD5=yes
2646+AUTH_PLAINTEXT=yes
2647+AUTH_SPA=yes
2648+
2649+SUPPORT_TLS=yes
2650+TLS_LIBS=-lssl -lcrypto
2651+
2652+ROUTER_ACCEPT=yes
2653+ROUTER_DNSLOOKUP=yes
2654+ROUTER_IPLITERAL=yes
2655+ROUTER_MANUALROUTE=yes
2656+ROUTER_QUERYPROGRAM=yes
2657+ROUTER_REDIRECT=yes
2658+
2659+TRANSPORT_APPENDFILE=yes
2660+TRANSPORT_AUTOREPLY=yes
2661+TRANSPORT_PIPE=yes
2662+TRANSPORT_SMTP=yes
2663+
2664+SUPPORT_MAILDIR=yes
2665+SUPPORT_MAILSTORE=yes
2666+SUPPORT_MBX=yes
2667+
2668+LOOKUP_DBM=yes
2669+LOOKUP_LSEARCH=yes
2670+
2671+# LOOKUP_CDB=yes
2672+LOOKUP_DNSDB=yes
2673+LOOKUP_DSEARCH=yes
2674+LOOKUP_LDAP=yes
2675+# LOOKUP_MYSQL=yes
2676+# LOOKUP_NIS=yes
2677+# LOOKUP_NISPLUS=yes
2678+# LOOKUP_ORACLE=yes
2679+LOOKUP_PASSWD=yes
2680+# LOOKUP_PGSQL=yes
2681+# LOOKUP_WHOSON=yes
2682+
2683+LDAP_LIB_TYPE=OPENLDAP2
2684+LOOKUP_LIBS=-lldap -llber
2685+
2686+WITH_CONTENT_SCAN=yes
2687+
2688+# It is important to define these variables but the values are always overridden
2689+CONFIGURE_OWNER=18
2690+CONFIGURE_GROUP=544
2691+
2692+EXICYCLOG_MAX=10
2693+
2694+COMPRESS_COMMAND=/usr/bin/gzip
2695+COMPRESS_SUFFIX=gz
2696+ZCAT_COMMAND=/usr/bin/zcat
2697+
2698+# EXIM_PERL=perl.o
2699+
2700+# Comment the two lines below if you do not have PAM, e.g. from
2701+# ftp://ftp.uni-erlangen.de/pub/pc/gnuwin32/cygwin/porters/Humblet_Pierre_A
2702+SUPPORT_PAM=yes
2703+CFLAGS += -DINCLUDE_PAM -I ../pam -I ../../pam
2704+
2705+# All modes are in octal and must start with 0
2706+EXIMDB_DIRECTORY_MODE = 01777
2707+EXIMDB_MODE = 0666
2708+EXIMDB_LOCKFILE_MODE = 0666
2709+INPUT_DIRECTORY_MODE = 01777
2710+LOG_DIRECTORY_MODE = 01777
2711+LOG_MODE = 0666
2712+MSGLOG_DIRECTORY_MODE = 01777
2713+SPOOL_DIRECTORY_MODE = 01777
2714+SPOOL_MODE = 0600
2715+
2716+# End
2717diff --git a/OS/unsupported/Makefile-DGUX b/OS/unsupported/Makefile-DGUX
2718new file mode 100644
2719index 0000000..667c63f
2720--- /dev/null
2721+++ b/OS/unsupported/Makefile-DGUX
2722@@ -0,0 +1,32 @@
2723+# Exim: OS-specific make file for DGUX
2724+#
2725+# Written by Ken Bailey (K.Bailey@rbgkew.org.uk) Feb 1998
2726+# on dgux R4.11MU04 generic AViiON mc88100
2727+# with no X
2728+
2729+# Minor tidies to remove settings that are actually the default,
2730+# in line with the style of other system files - PH.
2731+
2732+BASENAME_COMMAND=/bin/basename
2733+CHOWN_COMMAND=/bin/chown
2734+CHGRP_COMMAND=/bin/chgrp
2735+CHMOD_COMMAND=/bin/chmod
2736+
2737+# PERL
2738+# Perl is not necessary for running Exim itself, but some Perl utilities
2739+# are provided for processing the logs. Perl 5 is assumed.
2740+# DG ship perl version 4.036 in /bin/perl so need to use locally installed perl
2741+
2742+PERL_COMMAND=/usr/local/bin/perl
2743+
2744+# dg's version of gcc likes O2
2745+
2746+CFLAGS=-O2
2747+
2748+RANLIB=@true
2749+LIBS=-lsocket -lnsl -lm
2750+LIBRESOLV=-lresolv
2751+DBMLIB=-ldbm
2752+
2753+# End
2754+
2755diff --git a/OS/unsupported/Makefile-Darwin b/OS/unsupported/Makefile-Darwin
2756new file mode 100644
2757index 0000000..be0d952
2758--- /dev/null
2759+++ b/OS/unsupported/Makefile-Darwin
2760@@ -0,0 +1,29 @@
2761+# Exim: OS-specific make file for Darwin (Mac OS X).
2762+
2763+CC=cc
2764+
2765+BASENAME_COMMAND=look_for_it
2766+CHOWN_COMMAND=/usr/sbin/chown
2767+CHMOD_COMMAND=/bin/chmod
2768+
2769+HAVE_SA_LEN=YES
2770+
2771+# Removed -DBIND_8_COMPAT for 4.61
2772+# CFLAGS=-O -no-cpp-precomp -DBIND_8_COMPAT
2773+
2774+CFLAGS=-O -no-cpp-precomp
2775+LIBRESOLV=-lresolv
2776+
2777+USE_DB = yes
2778+DBMLIB =
2779+
2780+X11=/usr/X11R6
2781+XINCLUDE=-I$(X11)/include
2782+XLFLAGS=-L$(X11)/lib
2783+X11_LD_LIB=$(X11)/lib
2784+
2785+EXIWHAT_PS_ARG=ax
2786+EXIWHAT_EGREP_ARG='/exim( |$$)'
2787+EXIWHAT_KILL_SIGNAL=-USR1
2788+
2789+# End
2790diff --git a/OS/unsupported/Makefile-DragonFly b/OS/unsupported/Makefile-DragonFly
2791new file mode 100644
2792index 0000000..c49c59f
2793--- /dev/null
2794+++ b/OS/unsupported/Makefile-DragonFly
2795@@ -0,0 +1,31 @@
2796+# Exim: OS-specific make file for DragonFly
2797+# There's no setting of CFLAGS here, to allow the system default
2798+# for "make" to be the default.
2799+
2800+CHOWN_COMMAND=/usr/sbin/chown
2801+CHMOD_COMMAND=/bin/chmod
2802+
2803+HAVE_SA_LEN=YES
2804+
2805+# crypt() is in a separate library
2806+LIBS=-lcrypt -lm
2807+
2808+# DragonFly always ships with Berkeley DB
2809+USE_DB=yes
2810+
2811+# X11 may be under /usr/pkg/xorg/ for example.
2812+# X11=/usr/X11R6
2813+X11=$(X11BASE)
2814+
2815+XINCLUDE=-I$(X11)/include
2816+XLFLAGS=-L$(X11)/lib
2817+XLFLAGS+=-Wl,-rpath,${X11BASE}/lib
2818+X11_LD_LIB=$(X11)/lib
2819+
2820+EXIWHAT_PS_ARG=-ax
2821+EXIWHAT_EGREP_ARG='/exim( |$$)'
2822+EXIWHAT_MULTIKILL_CMD='killall -m'
2823+EXIWHAT_MULTIKILL_ARG='^exim($$|-[0-9.]+-[0-9]+$$)'
2824+EXIWHAT_KILL_SIGNAL=-USR1
2825+
2826+# End
2827diff --git a/OS/unsupported/Makefile-GNU b/OS/unsupported/Makefile-GNU
2828new file mode 100644
2829index 0000000..e464341
2830--- /dev/null
2831+++ b/OS/unsupported/Makefile-GNU
2832@@ -0,0 +1,29 @@
2833+# Exim: OS-specific make file for GNU and variants.
2834+
2835+HAVE_ICONV=yes
2836+
2837+BASENAME_COMMAND=look_for_it
2838+CHOWN_COMMAND=look_for_it
2839+CHGRP_COMMAND=look_for_it
2840+CHMOD_COMMAND=look_for_it
2841+
2842+CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
2843+
2844+DBMLIB = -ldb
2845+USE_DB = yes
2846+
2847+LIBS = -lnsl -lcrypt -lm
2848+LIBRESOLV = -lresolv
2849+
2850+X11=/usr/X11R6
2851+XINCLUDE=-I$(X11)/include
2852+XLFLAGS=-L$(X11)/lib
2853+X11_LD_LIB=$(X11)/lib
2854+
2855+EXIWHAT_PS_ARG=ax
2856+EXIWHAT_EGREP_ARG='/exim( |$$)'
2857+EXIWHAT_MULTIKILL_CMD=killall
2858+EXIWHAT_MULTIKILL_ARG=exim
2859+EXIWHAT_KILL_SIGNAL=-USR1
2860+
2861+# End
2862diff --git a/OS/unsupported/Makefile-GNUkFreeBSD b/OS/unsupported/Makefile-GNUkFreeBSD
2863new file mode 100644
2864index 0000000..8019281
2865--- /dev/null
2866+++ b/OS/unsupported/Makefile-GNUkFreeBSD
2867@@ -0,0 +1,29 @@
2868+# Exim: OS-specific make file for GNU and variants.
2869+
2870+HAVE_ICONV=yes
2871+
2872+BASENAME_COMMAND=look_for_it
2873+CHOWN_COMMAND=look_for_it
2874+CHGRP_COMMAND=look_for_it
2875+CHMOD_COMMAND=look_for_it
2876+
2877+CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
2878+
2879+DBMLIB = -ldb
2880+USE_DB = yes
2881+
2882+LIBS = -lnsl -lcrypt -lm
2883+LIBRESOLV = -lresolv
2884+
2885+X11=/usr/X11R6
2886+XINCLUDE=-I$(X11)/include
2887+XLFLAGS=-L$(X11)/lib
2888+X11_LD_LIB=$(X11)/lib
2889+
2890+EXIWHAT_PS_ARG=ax
2891+EXIWHAT_EGREP_ARG='/exim( |$$)'
2892+EXIWHAT_MULTIKILL_CMD=killall
2893+EXIWHAT_MULTIKILL_ARG=exim4
2894+EXIWHAT_KILL_SIGNAL=-USR1
2895+
2896+# End
2897diff --git a/OS/unsupported/Makefile-GNUkNetBSD b/OS/unsupported/Makefile-GNUkNetBSD
2898new file mode 100644
2899index 0000000..8019281
2900--- /dev/null
2901+++ b/OS/unsupported/Makefile-GNUkNetBSD
2902@@ -0,0 +1,29 @@
2903+# Exim: OS-specific make file for GNU and variants.
2904+
2905+HAVE_ICONV=yes
2906+
2907+BASENAME_COMMAND=look_for_it
2908+CHOWN_COMMAND=look_for_it
2909+CHGRP_COMMAND=look_for_it
2910+CHMOD_COMMAND=look_for_it
2911+
2912+CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
2913+
2914+DBMLIB = -ldb
2915+USE_DB = yes
2916+
2917+LIBS = -lnsl -lcrypt -lm
2918+LIBRESOLV = -lresolv
2919+
2920+X11=/usr/X11R6
2921+XINCLUDE=-I$(X11)/include
2922+XLFLAGS=-L$(X11)/lib
2923+X11_LD_LIB=$(X11)/lib
2924+
2925+EXIWHAT_PS_ARG=ax
2926+EXIWHAT_EGREP_ARG='/exim( |$$)'
2927+EXIWHAT_MULTIKILL_CMD=killall
2928+EXIWHAT_MULTIKILL_ARG=exim4
2929+EXIWHAT_KILL_SIGNAL=-USR1
2930+
2931+# End
2932diff --git a/OS/unsupported/Makefile-HI-OSF b/OS/unsupported/Makefile-HI-OSF
2933new file mode 100644
2934index 0000000..da3d487
2935--- /dev/null
2936+++ b/OS/unsupported/Makefile-HI-OSF
2937@@ -0,0 +1,8 @@
2938+# Exim: OS-specific make file for HI-OSF/1-MJ and HI-UX/MPP
2939+
2940+CC=cc
2941+CFLAGS=-O
2942+RANLIB=@true
2943+EXIWHAT_EGREP_ARG='/exim( |$$)'
2944+
2945+# End
2946diff --git a/OS/unsupported/Makefile-HI-UX b/OS/unsupported/Makefile-HI-UX
2947new file mode 100644
2948index 0000000..870ee84
2949--- /dev/null
2950+++ b/OS/unsupported/Makefile-HI-UX
2951@@ -0,0 +1,12 @@
2952+# Exim: OS-specific make file for HI-UX
2953+
2954+CC=cc -Aa -D_HIUX_SOURCE
2955+HAVE_SETRESUID=YES
2956+HAVE_SETEUID=NO
2957+XINCLUDE=-I/usr/include/X11R5
2958+XLFLAGS=-L/usr/lib/X11R5
2959+DBMLIB = -lndbm
2960+NEED_H_ERRNO=1
2961+RANLIB=@true
2962+
2963+# End
2964diff --git a/OS/unsupported/Makefile-HP-UX b/OS/unsupported/Makefile-HP-UX
2965new file mode 100644
2966index 0000000..ea35144
2967--- /dev/null
2968+++ b/OS/unsupported/Makefile-HP-UX
2969@@ -0,0 +1,27 @@
2970+# Exim: OS-specific make file for HP-UX later than 9
2971+
2972+# HP ANSI C compiler
2973+#CC=cc
2974+#CFLAGS=+O2 +Onolimit -z -D_XOPEN_SOURCE_EXTENDED
2975+# Users of the A.06.00 compiler might need to use +O1 rather than +O2 as
2976+# there have been some problems reported with this compiler with +O2 set.
2977+
2978+# gcc
2979+CFLAGS=-O -D_XOPEN_SOURCE_EXTENDED
2980+LDFLAGS=-Wl,-z
2981+LIBS=-lm
2982+
2983+BASENAME_COMMAND=/bin/basename
2984+HAVE_ICONV=yes
2985+HAVE_SETRESUID=YES
2986+HAVE_SETEUID=NO
2987+XINCLUDE=-I/usr/include/X11R6 -I/usr/contrib/X11R6/include
2988+XLFLAGS=-L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib
2989+X11_LD_LIB=/usr/contrib/X11R6/lib
2990+EXIMON_TEXTPOP=
2991+DBMLIB=-lndbm
2992+RANLIB=@true
2993+
2994+OS_C_INCLUDES=setenv.c
2995+
2996+# End
2997diff --git a/OS/unsupported/Makefile-HP-UX-9 b/OS/unsupported/Makefile-HP-UX-9
2998new file mode 100644
2999index 0000000..1530009
3000--- /dev/null
3001+++ b/OS/unsupported/Makefile-HP-UX-9
3002@@ -0,0 +1,15 @@
3003+# Exim: OS-specific make file for HP-UX 9
3004+
3005+CFLAGS=-O
3006+BASENAME_COMMAND=/bin/basename
3007+HAVE_ICONV=yes
3008+HAVE_SETRESUID=YES
3009+HAVE_SETEUID=NO
3010+XINCLUDE=-I/usr/include/X11R5
3011+XLFLAGS=-L/usr/lib/X11R5 -L/usr/contrib/X11R5/lib
3012+X11_LD_LIB=/usr/contrib/X11R5/lib
3013+EXIMON_TEXTPOP=
3014+DBMLIB=-lndbm
3015+RANLIB=@true
3016+
3017+# End
3018diff --git a/OS/unsupported/Makefile-IRIX b/OS/unsupported/Makefile-IRIX
3019new file mode 100644
3020index 0000000..7b95783
3021--- /dev/null
3022+++ b/OS/unsupported/Makefile-IRIX
3023@@ -0,0 +1,12 @@
3024+# Exim: OS-specific make file for IRIX
3025+
3026+HAVE_ICONV=yes
3027+BASENAME_COMMAND=/sbin/basename
3028+HOSTNAME_COMMAND=/usr/bsd/hostname
3029+CFLAGS=-OPT:Olimit=1500
3030+LIBS=-lmld -lm
3031+XINCLUDE=-I/usr/include/X11
3032+vfork=fork
3033+RANLIB=@true
3034+
3035+# End
3036diff --git a/OS/unsupported/Makefile-IRIX6 b/OS/unsupported/Makefile-IRIX6
3037new file mode 100644
3038index 0000000..be01138
3039--- /dev/null
3040+++ b/OS/unsupported/Makefile-IRIX6
3041@@ -0,0 +1,13 @@
3042+# Exim: OS-specific make file for IRIX6 on 64-bit systems
3043+
3044+HAVE_ICONV=yes
3045+HOSTNAME_COMMAND=/usr/bsd/hostname
3046+CFLAGS=-O2 -n32 -OPT:Olimit=4000
3047+LFLAGS=-n32
3048+LIBS=-lelf -lm
3049+XINCLUDE=-I/usr/include/X11
3050+XLFLAGS=
3051+vfork=fork
3052+RANLIB=@true
3053+
3054+# End
3055diff --git a/OS/unsupported/Makefile-IRIX632 b/OS/unsupported/Makefile-IRIX632
3056new file mode 100644
3057index 0000000..b567fc6
3058--- /dev/null
3059+++ b/OS/unsupported/Makefile-IRIX632
3060@@ -0,0 +1,16 @@
3061+# Exim: OS-specific make file for IRIX 6 on 32-bit systems.
3062+# There seems to be some variation. The commented settings show
3063+# some alternatives.
3064+
3065+HAVE_ICONV=yes
3066+HOSTNAME_COMMAND=/usr/bsd/hostname
3067+#CFLAGS=-OPT:Olimit=1500 -32 -mips2
3068+CFLAGS=-32
3069+LFLAGS=-32
3070+#LIBS=-lmld
3071+LIBS=-lelf -lm
3072+XINCLUDE=-I/usr/include/X11
3073+vfork=fork
3074+RANLIB=@true
3075+
3076+# End
3077diff --git a/OS/unsupported/Makefile-IRIX65 b/OS/unsupported/Makefile-IRIX65
3078new file mode 100644
3079index 0000000..50e7745
3080--- /dev/null
3081+++ b/OS/unsupported/Makefile-IRIX65
3082@@ -0,0 +1,16 @@
3083+# Exim: OS-specific make file for IRIX 6.5
3084+
3085+HAVE_ICONV=yes
3086+HOSTNAME_COMMAND=/usr/bsd/hostname
3087+CC=cc
3088+CFLAGS=-O2 -OPT:Olimit=0
3089+# CFLAGS=-O2 # override with this (in your Local/Makefile) if using gcc
3090+LFLAGS=-Wl,-LD_MSG:off=85
3091+LFLAGS=
3092+# nlist has moved from libmld to libelf
3093+LIBS=-lelf -lm
3094+XINCLUDE=-I/usr/include/X11
3095+vfork=fork
3096+RANLIB=@true
3097+
3098+# End
3099diff --git a/OS/unsupported/Makefile-NetBSD b/OS/unsupported/Makefile-NetBSD
3100new file mode 100644
3101index 0000000..35d03a2
3102--- /dev/null
3103+++ b/OS/unsupported/Makefile-NetBSD
3104@@ -0,0 +1,27 @@
3105+# Exim: OS-specific make file for NetBSD (ELF object format)
3106+
3107+CHOWN_COMMAND=/usr/sbin/chown
3108+CHMOD_COMMAND=/bin/chmod
3109+
3110+CFLAGS ?= -O2
3111+
3112+HAVE_SA_LEN=YES
3113+HAVE_IPV6=YES
3114+LIBS=-lcrypt -lm
3115+
3116+X11=/usr/X11R6
3117+XINCLUDE=-I$(X11)/include
3118+XLFLAGS=-L$(X11)/lib
3119+X11_LD_LIB=$(X11)/lib
3120+
3121+EXIWHAT_PS_ARG=-ax
3122+EXIWHAT_EGREP_ARG='/exim( |$$)'
3123+EXIWHAT_KILL_SIGNAL=-USR1
3124+
3125+# NetBSD always ships with Berkeley DB
3126+USE_DB=yes
3127+
3128+# NetBSD ELF linker needs a -R flag.
3129+XLFLAGS+=-Wl,-R$(X11)/lib/
3130+
3131+# End
3132diff --git a/OS/unsupported/Makefile-NetBSD-a.out b/OS/unsupported/Makefile-NetBSD-a.out
3133new file mode 100644
3134index 0000000..e210efd
3135--- /dev/null
3136+++ b/OS/unsupported/Makefile-NetBSD-a.out
3137@@ -0,0 +1,24 @@
3138+# Exim: OS-specific make file for NetBSD (a.out/COFF object format)
3139+
3140+CHOWN_COMMAND=/usr/sbin/chown
3141+CHMOD_COMMAND=/bin/chmod
3142+
3143+CFLAGS ?= -O2
3144+
3145+HAVE_SA_LEN=YES
3146+HAVE_IPV6=YES
3147+LIBS=-lcrypt -lm
3148+
3149+X11=/usr/X11R6
3150+XINCLUDE=-I$(X11)/include
3151+XLFLAGS=-L$(X11)/lib
3152+X11_LD_LIB=$(X11)/lib
3153+
3154+EXIWHAT_PS_ARG=-ax
3155+EXIWHAT_EGREP_ARG='/exim( |$$)'
3156+EXIWHAT_KILL_SIGNAL=-USR1
3157+
3158+# NetBSD always ships with Berkeley DB
3159+USE_DB=yes
3160+
3161+# End
3162diff --git a/OS/unsupported/Makefile-OSF1 b/OS/unsupported/Makefile-OSF1
3163new file mode 100644
3164index 0000000..811ca07
3165--- /dev/null
3166+++ b/OS/unsupported/Makefile-OSF1
3167@@ -0,0 +1,10 @@
3168+# Exim: OS-specific make file for OSF1
3169+
3170+CFLAGS=-O
3171+LIBS=-liconv -lm
3172+HAVE_CRYPT16=yes
3173+HAVE_ICONV=yes
3174+HOSTNAME_COMMAND=/usr/bin/hostname
3175+EXIWHAT_EGREP_ARG='/exim( |$$)'
3176+
3177+# End
3178diff --git a/OS/unsupported/Makefile-OpenUNIX b/OS/unsupported/Makefile-OpenUNIX
3179new file mode 100644
3180index 0000000..e4d7261
3181--- /dev/null
3182+++ b/OS/unsupported/Makefile-OpenUNIX
3183@@ -0,0 +1,17 @@
3184+# Exim: OS-specific make file for OpenUNIX
3185+
3186+CC=/usr/bin/cc
3187+CFLAGS=-O -I/usr/local/include
3188+LFLAGS=-L/usr/local/lib
3189+
3190+LIBS=-lsocket -lnsl -lelf -lgen -lresolv -lm
3191+EXTRALIBS_EXIMON=-lICE -lSM
3192+
3193+RANLIB=@true
3194+ERRNO_QUOTA=0
3195+
3196+X11=/usr/lib/X11
3197+XINCLUDE=-I/usr/include/X11
3198+XLFLAGS=-L/usr/lib -L$(X11)/lib
3199+
3200+# End
3201diff --git a/OS/unsupported/Makefile-QNX b/OS/unsupported/Makefile-QNX
3202new file mode 100644
3203index 0000000..3cf81c4
3204--- /dev/null
3205+++ b/OS/unsupported/Makefile-QNX
3206@@ -0,0 +1,30 @@
3207+# Exim: OS-specific makefile for QNX
3208+
3209+BASENAME_COMMAND=/bin/basename
3210+MAKE_SHELL=/usr/bin/bash
3211+
3212+CHOWN_COMMAND=/bin/chown
3213+CHGRP_COMMAND=/bin/chgrp
3214+CHMOD_COMMAND=/bin/chmod
3215+HOSTNAME_COMMAND=/bin/hostname
3216+MV_COMMAND=/bin/mv
3217+PERL_COMMAND=/usr/bin/perl
3218+RM_COMMAND=/bin/rm
3219+
3220+AR=ar -rc
3221+
3222+CC=cc
3223+CFLAGS=-Otax
3224+LIBIDENTCFLAGS=
3225+
3226+RANLIB=@true
3227+DBMLIB=-ldb
3228+USE_DB=yes
3229+LIBS=-lsocket -lm
3230+
3231+X11=/usr/X11R6
3232+XINCLUDE=-I$(X11)/include
3233+XLFLAGS=-L$(X11)/lib
3234+X11_LD_LIB=$(X11)/lib
3235+
3236+# End
3237diff --git a/OS/unsupported/Makefile-SCO b/OS/unsupported/Makefile-SCO
3238new file mode 100644
3239index 0000000..baa61d8
3240--- /dev/null
3241+++ b/OS/unsupported/Makefile-SCO
3242@@ -0,0 +1,28 @@
3243+# Exim: OS-specific make file for SCO
3244+
3245+# It was reported that some versions of gcc (e.g. 2.8.1) require this to be
3246+# CFLAGS=-melf
3247+
3248+CFLAGS=-b elf
3249+
3250+RANLIB=@true
3251+DBMLIB=-lndbm
3252+ERRNO_QUOTA=0
3253+LIBS=-lsocket -lm
3254+HAVE_ICONV=yes
3255+
3256+X11=/usr/lib/X11
3257+XINCLUDE=-I/usr/include/X11
3258+XLFLAGS=-L/usr/lib -L$(X11)/lib
3259+X11_LD_LIB=$(X11)/lib
3260+
3261+# Changes from Frank Bernhardt (30/09/04)
3262+
3263+BASENAME_COMMAND=/bin/basename
3264+CHOWN_COMMAND=/bin/chown
3265+CHGRP_COMMAND=/bin/chgrp
3266+CHMOD_COMMAND=/bin/chmod
3267+HOSTNAME_COMMAND=/usr/bin/hostname
3268+TOUCH_COMMAND=/bin/touch
3269+
3270+# End
3271diff --git a/OS/unsupported/Makefile-SCO_SV b/OS/unsupported/Makefile-SCO_SV
3272new file mode 100644
3273index 0000000..249b81a
3274--- /dev/null
3275+++ b/OS/unsupported/Makefile-SCO_SV
3276@@ -0,0 +1,34 @@
3277+# Exim: OS-specific make file for SCO_SV release 5 (tested on 5.0.5 & 5.0.5)
3278+# (see the UNIX_SV files for SCO 4.2)
3279+# Supplied by: Tony Earnshaw <tonye@ilion.nl>
3280+
3281+# Note that 'gcc -melf -m486' applies to gcc 2.7.2 and higher;
3282+# 2.7.1 and SCO's SDK need '-belf'.
3283+
3284+# Removed -lwrap (PH 27/7/00) because not all systems have it
3285+
3286+CFLAGS=-melf -O3 -m486
3287+LFLAGS=-L/lib -L/usr/lib -L/usr/local/lib
3288+LIBS=-ltinfo -lsocket -lm
3289+
3290+HAVE_ICONV=yes
3291+
3292+RANLIB=@true
3293+DBMLIB=-lndbm
3294+ERRNO_QUOTA=0
3295+
3296+X11=/usr/lib/X11
3297+XINCLUDE=-I/usr/include/X11
3298+XLFLAGS=-L/usr/lib -L$(X11)/lib
3299+X11_LD_LIB=$(X11)/lib
3300+
3301+# Changes from Frank Bernhardt (30/9/04)
3302+
3303+BASENAME_COMMAND=/bin/basename
3304+CHOWN_COMMAND=/bin/chown
3305+CHGRP_COMMAND=/bin/chgrp
3306+CHMOD_COMMAND=/bin/chmod
3307+HOSTNAME_COMMAND=/usr/bin/hostname
3308+TOUCH_COMMAND=/bin/touch
3309+
3310+# End
3311diff --git a/OS/unsupported/Makefile-SunOS4 b/OS/unsupported/Makefile-SunOS4
3312new file mode 100644
3313index 0000000..c876998
3314--- /dev/null
3315+++ b/OS/unsupported/Makefile-SunOS4
3316@@ -0,0 +1,16 @@
3317+# Exim: OS-specific make file for SunOS4
3318+
3319+CFLAGS=-O
3320+
3321+CHOWN_COMMAND=/usr/etc/chown
3322+HOSTNAME_COMMAND=/usr/bin/hostname
3323+EXIT_FAILURE=1
3324+EXIT_SUCCESS=0
3325+LIBRESOLV=-lresolv
3326+XINCLUDE=-I/usr/include/X11
3327+
3328+EXIWHAT_PS_ARG=-ax
3329+EXIWHAT_EGREP_ARG='/exim( |$$)'
3330+EXIWHAT_KILL_SIGNAL=-30
3331+
3332+# End
3333diff --git a/OS/unsupported/Makefile-SunOS5-hal b/OS/unsupported/Makefile-SunOS5-hal
3334new file mode 100644
3335index 0000000..05ea893
3336--- /dev/null
3337+++ b/OS/unsupported/Makefile-SunOS5-hal
3338@@ -0,0 +1,18 @@
3339+# Exim: OS-specific make file for SunOS5 on a HAL
3340+
3341+# Note: The HAL runs a standard SunOS5 except that it has a 64 bit C
3342+# compiler called hcc. To make things work pass the -KV7 flag to force
3343+# 32bit compilation - this is necessary to interwork with some libraries.
3344+
3345+CC=hcc
3346+CFLAGS=-O -KV7
3347+LIBIDENTCFLAGS="-KV7 -O -DHAVE_ANSIHEADERS"
3348+LIBIDENTNAME=sunos5
3349+RANLIB=@true
3350+LIBS=-lsocket -lnsl -lkstat -lm
3351+LIBRESOLV=-lresolv
3352+X11=/usr/X11R6
3353+XINCLUDE=-I$(X11)/include
3354+XLFLAGS=-L$(X11)/lib -R$(X11)/lib
3355+
3356+# End
3357diff --git a/OS/unsupported/Makefile-ULTRIX b/OS/unsupported/Makefile-ULTRIX
3358new file mode 100644
3359index 0000000..9e912b3
3360--- /dev/null
3361+++ b/OS/unsupported/Makefile-ULTRIX
3362@@ -0,0 +1,18 @@
3363+# Exim: OS-specific make file for Ultrix
3364+
3365+MAKE_SHELL=/usr/bin/sh5
3366+
3367+CFLAGS=-O
3368+
3369+# This can either be /usr/include/X11 or /usr/include/mit depending on
3370+# the particular version of ULTRIX.
3371+
3372+XINCLUDE=-I/usr/include/X11 -I/usr/include/mit
3373+
3374+DBMLIB=-lgdbm
3375+
3376+EXIWHAT_PS_ARG=-ax
3377+EXIWHAT_EGREP_ARG='/exim( |$$)'
3378+EXIWHAT_KILL_SIGNAL=-USR1
3379+
3380+# End
3381diff --git a/OS/unsupported/Makefile-UNIX_SV b/OS/unsupported/Makefile-UNIX_SV
3382new file mode 100644
3383index 0000000..bfcfae1
3384--- /dev/null
3385+++ b/OS/unsupported/Makefile-UNIX_SV
3386@@ -0,0 +1,24 @@
3387+# Exim: OS-specific make file for SCO SVR4.2MP (and maybe Unixware)
3388+#
3389+# *** Note that for SCO 5 the configuration file is called SCO_SV,
3390+# *** and that Unixware7 has its own configuration. This is an old
3391+# *** file that is retained for compatibility.
3392+#
3393+# Note that SCO does not include dbm/ndbm with their standard compiler
3394+# (it is available with /usr/ucb/cc, but that has bugs of its own). You
3395+# should install gcc and gdbm, then execute 'make install-compat' in the
3396+# gdbm source directory.
3397+
3398+CC=gcc -I/usr/local/include
3399+CFLAGS=-O
3400+
3401+RANLIB=@true
3402+DBMLIB=-lgdbm -L/usr/local/lib
3403+ERRNO_QUOTA=0
3404+LIBS=-lsocket -lelf -lgen -lnsl -lresolv -lm
3405+
3406+X11=/usr/lib/X11
3407+XINCLUDE=-I/usr/include/X11
3408+XLFLAGS=-L/usr/lib -L$(X11)/lib
3409+
3410+# End
3411diff --git a/OS/unsupported/Makefile-USG b/OS/unsupported/Makefile-USG
3412new file mode 100644
3413index 0000000..753a2d7
3414--- /dev/null
3415+++ b/OS/unsupported/Makefile-USG
3416@@ -0,0 +1,33 @@
3417+# Exim: OS-specific make file for Unixware 2.x
3418+#
3419+# Note that Unixware does not include db/dbm/ndbm with their standard compiler
3420+# (it is available with /usr/ucb/cc, but that has bugs of its own). You
3421+# should install gcc and Berkeley DB (or another dbm library if you really
3422+# insist). If you use a different dbm library you will need to override
3423+# DBMLIB below.
3424+#
3425+# DB 1.85 and 2.x can be found at http://www.sleepycat.com/.
3426+# They have different characteristics. See the discussion of dbm libraries
3427+# in doc/dbm.discuss.txt in the Exim distribution.
3428+#
3429+# DB needs to be compiled with gcc and you need a 'cc' in your path
3430+# before the Unixware CC to compile it.
3431+#
3432+# Don't bother even starting to install exim on Unixware unless
3433+# you have installed gcc and use it for everything.
3434+
3435+CC=gcc -I/usr/local/include
3436+CFLAGS=-O
3437+
3438+RANLIB=@true
3439+DBMLIB=-ldb -L/usr/local/lib
3440+USE_DB=YES
3441+ERRNO_QUOTA=0
3442+LIBS=-lsocket -lelf -lgen -lnsl -lresolv -lm
3443+
3444+X11=/usr/lib/X11
3445+XINCLUDE=-I/usr/include/X11
3446+XLFLAGS=-L/usr/lib -L$(X11)/lib
3447+X11_LD_LIB=$(X11)/lib
3448+
3449+# End
3450diff --git a/OS/unsupported/Makefile-Unixware7 b/OS/unsupported/Makefile-Unixware7
3451new file mode 100644
3452index 0000000..88a8838
3453--- /dev/null
3454+++ b/OS/unsupported/Makefile-Unixware7
3455@@ -0,0 +1,32 @@
3456+# Exim: OS-specific make file for Unixware7
3457+# Based on information from James FitzGibbon <james@ehlo.com>
3458+
3459+# If you want to use libbind, you need to
3460+# add -I/usr/local/bind/include to CFLAGS
3461+# add -L/usr/local/bind/lib to LFLAGS
3462+# remove -lresolv from LIBS
3463+# add LOOKUP_LIBS=-lbind
3464+# The new settings should go in your Local/Makefile rather than here; then
3465+# they will be usable for subsequent Exim releases.
3466+
3467+CC=/usr/bin/cc
3468+CFLAGS=-O -I/usr/local/include
3469+LFLAGS=-L/usr/local/lib
3470+
3471+HAVE_ICONV=yes
3472+
3473+LIBS=-lsocket -lnsl -lelf -lgen -lresolv -lm
3474+
3475+# Removed on the advice of Larry Rosenman
3476+# EXTRALIBS=-lwrap
3477+
3478+EXTRALIBS_EXIMON=-lICE -lSM
3479+
3480+RANLIB=@true
3481+ERRNO_QUOTA=0
3482+
3483+X11=/usr/lib/X11
3484+XINCLUDE=-I/usr/include/X11
3485+XLFLAGS=-L/usr/lib -L$(X11)/lib
3486+
3487+# End
3488diff --git a/OS/unsupported/Makefile-mips b/OS/unsupported/Makefile-mips
3489new file mode 100644
3490index 0000000..ff33139
3491--- /dev/null
3492+++ b/OS/unsupported/Makefile-mips
3493@@ -0,0 +1,16 @@
3494+# Exim: OS-specific make file for RiscOS4bsd
3495+
3496+HOSTNAME_COMMAND=/usr/ucb/hostname
3497+EXIT_FAILURE=1
3498+EXIT_SUCCESS=0
3499+LIBRESOLV=-lresolv
3500+LIBS=-liberty -lm
3501+XINCLUDE=-I/usr/X11R6/include
3502+
3503+CFLAGS=-O
3504+
3505+EXIWHAT_PS_ARG=-ax
3506+EXIWHAT_EGREP_ARG='/exim( |$$)'
3507+EXIWHAT_KILL_SIGNAL=-30
3508+
3509+# End
3510diff --git a/OS/unsupported/README b/OS/unsupported/README
3511new file mode 100644
3512index 0000000..73790ae
3513--- /dev/null
3514+++ b/OS/unsupported/README
3515@@ -0,0 +1,14 @@
3516+Files in this directory are historical. They may have worked once but the
3517+project has no assurance that they still do.
3518+
3519+If you need to use one for a build for your platform, copy it up one directory
3520+level first. We'll reinstate it given a current version and evidence of testing.
3521+For the latter please look into the project regression testsuite, and please
3522+consider operating a buildfarm animal in the long term (it runs the testsuite).
3523+
3524+The buildfarm status page is:
3525+ https://buildfarm.exim.org/cgi-bin/show_status.pl
3526+There's a "register" link there with a link to how-to instructions. Please do
3527+monitor the status of your animal on an ongoing basis. The exim-users or
3528+exim-dev mailinglist are good places to ask for help and to discuss any regressions
3529+seen in test runs. There is also the #exim IRC channel on Freenode.
3530diff --git a/OS/unsupported/os.c-BSDI b/OS/unsupported/os.c-BSDI
3531new file mode 100644
3532index 0000000..03a7a1c
3533--- /dev/null
3534+++ b/OS/unsupported/os.c-BSDI
3535@@ -0,0 +1,19 @@
3536+/*************************************************
3537+* Exim - an Internet mail transport agent *
3538+*************************************************/
3539+
3540+/* Copyright (c) 2016 Heiko Schlittermann <hs@schlittermann.de> */
3541+/* See the file NOTICE for conditions of use and distribution. */
3542+
3543+/* BSDI-specific code. This is concatenated onto the generic
3544+src/os.c file. */
3545+
3546+#ifndef OS_UNSETENV
3547+#define OS_UNSETENV
3548+
3549+int
3550+os_unsetenv(const uschar * name)
3551+{
3552+unsetenv(CS name);
3553+return 0;
3554+}
3555diff --git a/OS/unsupported/os.c-GNU b/OS/unsupported/os.c-GNU
3556new file mode 100644
3557index 0000000..e5d6ff6
3558--- /dev/null
3559+++ b/OS/unsupported/os.c-GNU
3560@@ -0,0 +1,55 @@
3561+/*************************************************
3562+* Exim - an Internet mail transport agent *
3563+*************************************************/
3564+
3565+/* See the file NOTICE for conditions of use and distribution. */
3566+
3567+/* GNU-specific code. This is concatenated onto the generic src/os.c file.
3568+GNU/Hurd has approximately the same way to determine the load average as NeXT,
3569+so a variant of this could also be in the generic os.c file. See the GNU EMacs
3570+getloadavg.c file, from which this snippet was derived. getloadavg.c from Emacs
3571+is copyrighted by the FSF under the terms of the GPLv2 or any later version.
3572+Changes are hereby placed under the same license, as requested by the GPL. */
3573+
3574+#ifndef OS_LOAD_AVERAGE
3575+#define OS_LOAD_AVERAGE
3576+
3577+#include <mach.h>
3578+
3579+static processor_set_t default_set;
3580+static int getloadavg_initialized;
3581+
3582+int
3583+os_getloadavg (void)
3584+{
3585+host_t host;
3586+struct processor_set_basic_info info;
3587+unsigned info_count;
3588+
3589+if (!getloadavg_initialized)
3590+ {
3591+ if (processor_set_default (mach_host_self(), &default_set) == KERN_SUCCESS)
3592+ getloadavg_initialized = 1;
3593+ }
3594+
3595+if (getloadavg_initialized)
3596+ {
3597+ info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
3598+ if (processor_set_info(default_set, PROCESSOR_SET_BASIC_INFO, &host,
3599+ (processor_set_info_t)&info, &info_count) != KERN_SUCCESS)
3600+ getloadavg_initialized = 0;
3601+ else
3602+ {
3603+ #if LOAD_SCALE == 1000
3604+ return info.load_average;
3605+ #else
3606+ return (int) (((double) info.load_average * 1000) / LOAD_SCALE));
3607+ #endif
3608+ }
3609+ }
3610+
3611+return -1;
3612+}
3613+#endif /* OS_LOAD_AVERAGE */
3614+
3615+/* End of os.c-GNU */
3616diff --git a/OS/unsupported/os.c-HI-OSF b/OS/unsupported/os.c-HI-OSF
3617new file mode 100644
3618index 0000000..5e3d336
3619--- /dev/null
3620+++ b/OS/unsupported/os.c-HI-OSF
3621@@ -0,0 +1,35 @@
3622+/*************************************************
3623+* Exim - an Internet mail transport agent *
3624+*************************************************/
3625+
3626+/* Copyright (c) University of Cambridge 2001 */
3627+/* See the file NOTICE for conditions of use and distribution. */
3628+
3629+/* HI-OSF-specific code. This is concatenated onto the generic
3630+src/os.c file. OSF has an apparently unique way of getting the
3631+load average, so we provide a unique function here, and define
3632+OS_LOAD_AVERAGE to stop src/os.c trying to provide the function. */
3633+
3634+#ifndef OS_LOAD_AVERAGE
3635+#define OS_LOAD_AVERAGE
3636+
3637+#include <sys/table.h>
3638+
3639+int
3640+os_getloadavg(void)
3641+{
3642+double avg;
3643+struct tbl_loadavg load_avg;
3644+
3645+table (TBL_LOADAVG, 0, &load_avg, 1, sizeof (load_avg));
3646+
3647+avg = (load_avg.tl_lscale == 0)?
3648+ load_avg.tl_avenrun.d[0] :
3649+ (load_avg.tl_avenrun.l[0] / (double)load_avg.tl_lscale);
3650+
3651+return (int)(avg * 1000.0);
3652+}
3653+
3654+#endif /* OS_LOAD_AVERAGE */
3655+
3656+/* End of os.c-HI-OSF */
3657diff --git a/OS/unsupported/os.c-HP-UX b/OS/unsupported/os.c-HP-UX
3658new file mode 100644
3659index 0000000..fdd8708
3660--- /dev/null
3661+++ b/OS/unsupported/os.c-HP-UX
3662@@ -0,0 +1,16 @@
3663+/*************************************************
3664+* Exim - an Internet mail transport agent *
3665+*************************************************/
3666+
3667+/* Copyright (c) University of Cambridge 2016 */
3668+/* Copyright (c) Jeremy Harris 2016 */
3669+/* See the file NOTICE for conditions of use and distribution. */
3670+
3671+/* HP-UX-specific code. This is concatenated onto the generic
3672+src/os.c file. */
3673+
3674+#ifndef COMPILE_UTILITY
3675+# include "setenv.c"
3676+#endif
3677+
3678+/* End of os.c-SunHP-UX */
3679diff --git a/OS/unsupported/os.c-IRIX b/OS/unsupported/os.c-IRIX
3680new file mode 100644
3681index 0000000..1f6b0e1
3682--- /dev/null
3683+++ b/OS/unsupported/os.c-IRIX
3684@@ -0,0 +1,118 @@
3685+/*************************************************
3686+* Exim - an Internet mail transport agent *
3687+*************************************************/
3688+
3689+/* Copyright (c) University of Cambridge 2001 */
3690+/* See the file NOTICE for conditions of use and distribution. */
3691+
3692+/* Irix-specific code. This is concatenated onto the generic src/os.c file.
3693+Irix has a unique way of finding all the network interfaces, so we provide a
3694+unique function here, and define FIND_RUNNING_INTERFACES to stop src/os.c
3695+trying to provide the function. The macro may be set initially anyway, when
3696+compiling os. for utilities that don't want this function. */
3697+
3698+#ifndef FIND_RUNNING_INTERFACES
3699+#define FIND_RUNNING_INTERFACES
3700+
3701+/* This is the special form of the function using sysctl() which is the only
3702+form that returns all the aliases on IRIX systems. This code has its origins
3703+in a sample program that came from within SGI. */
3704+
3705+#include <sys/sysctl.h>
3706+#include <net/if_dl.h>
3707+#include <net/if_types.h>
3708+#include <net/soioctl.h>
3709+#include <net/route.h>
3710+
3711+#define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) -1))) \
3712+ : sizeof(__uint64_t))
3713+#ifdef _HAVE_SA_LEN
3714+#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
3715+#else
3716+#define ADVANCE(x, n) (x += ROUNDUP(_FAKE_SA_LEN_DST(n)))
3717+#endif
3718+
3719+
3720+ip_address_item *
3721+os_find_running_interfaces(void)
3722+{
3723+ip_address_item *yield = NULL;
3724+ip_address_item *last = NULL;
3725+ip_address_item *next;
3726+
3727+size_t needed;
3728+int mib[6];
3729+char *buf, *nextaddr, *lim;
3730+register struct if_msghdr *ifm;
3731+
3732+mib[0] = CTL_NET;
3733+mib[1] = PF_ROUTE;
3734+mib[2] = 0;
3735+mib[3] = 0;
3736+mib[4] = NET_RT_IFLIST;
3737+mib[5] = 0;
3738+
3739+/* Get an estimate of the amount of store needed, then get the store and
3740+get the data into it. Any error causes a panic death. */
3741+
3742+if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
3743+ log_write(0, LOG_PANIC_DIE, "iflist-sysctl-estimate failed: %s",
3744+ strerror(errno));
3745+
3746+buf = store_get(needed);
3747+
3748+if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
3749+ log_write(0, LOG_PANIC_DIE, "sysctl of ifnet list failed: %s",
3750+ strerror(errno));
3751+
3752+/* Now fish out the data for each interface */
3753+
3754+lim = buf + needed;
3755+for (nextaddr = buf; nextaddr < lim; nextaddr += ifm->ifm_msglen)
3756+ {
3757+ ifm = (struct if_msghdr *)nextaddr;
3758+
3759+ if (ifm->ifm_type != RTM_IFINFO)
3760+ {
3761+ struct ifa_msghdr *ifam = (struct ifa_msghdr *)ifm;
3762+ struct sockaddr_in *mask = NULL, *addr = NULL;
3763+
3764+ if ((ifam->ifam_addrs & RTA_NETMASK) != 0)
3765+ mask = (struct sockaddr_in *)(ifam + 1);
3766+
3767+ if ((ifam->ifam_addrs & RTA_IFA) != 0)
3768+ {
3769+ char *cp = CS mask;
3770+ struct sockaddr *sa = (struct sockaddr *)mask;
3771+ ADVANCE(cp, sa);
3772+ addr = (struct sockaddr_in *)cp;
3773+ }
3774+
3775+ /* Create a data block for the address, fill in the data, and put it on
3776+ the chain. This data has to survive for ever, so use malloc. */
3777+
3778+ if (addr != NULL)
3779+ {
3780+ next = store_malloc(sizeof(ip_address_item));
3781+ next->next = NULL;
3782+ next->port = 0;
3783+ (void)host_ntoa(-1, addr, next->address, NULL);
3784+
3785+ if (yield == NULL) yield = last = next; else
3786+ {
3787+ last->next = next;
3788+ last = next;
3789+ }
3790+
3791+ DEBUG(D_interface) debug_printf("Actual local interface address is %s\n",
3792+ last->address);
3793+ }
3794+ }
3795+ }
3796+
3797+return yield;
3798+}
3799+
3800+#endif /* FIND_RUNNING_INTERFACES */
3801+
3802+/* End of os.c-IRIX */
3803diff --git a/OS/unsupported/os.c-IRIX6 b/OS/unsupported/os.c-IRIX6
3804new file mode 100644
3805index 0000000..1f6b0e1
3806--- /dev/null
3807+++ b/OS/unsupported/os.c-IRIX6
3808@@ -0,0 +1,118 @@
3809+/*************************************************
3810+* Exim - an Internet mail transport agent *
3811+*************************************************/
3812+
3813+/* Copyright (c) University of Cambridge 2001 */
3814+/* See the file NOTICE for conditions of use and distribution. */
3815+
3816+/* Irix-specific code. This is concatenated onto the generic src/os.c file.
3817+Irix has a unique way of finding all the network interfaces, so we provide a
3818+unique function here, and define FIND_RUNNING_INTERFACES to stop src/os.c
3819+trying to provide the function. The macro may be set initially anyway, when
3820+compiling os. for utilities that don't want this function. */
3821+
3822+#ifndef FIND_RUNNING_INTERFACES
3823+#define FIND_RUNNING_INTERFACES
3824+
3825+/* This is the special form of the function using sysctl() which is the only
3826+form that returns all the aliases on IRIX systems. This code has its origins
3827+in a sample program that came from within SGI. */
3828+
3829+#include <sys/sysctl.h>
3830+#include <net/if_dl.h>
3831+#include <net/if_types.h>
3832+#include <net/soioctl.h>
3833+#include <net/route.h>
3834+
3835+#define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) -1))) \
3836+ : sizeof(__uint64_t))
3837+#ifdef _HAVE_SA_LEN
3838+#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
3839+#else
3840+#define ADVANCE(x, n) (x += ROUNDUP(_FAKE_SA_LEN_DST(n)))
3841+#endif
3842+
3843+
3844+ip_address_item *
3845+os_find_running_interfaces(void)
3846+{
3847+ip_address_item *yield = NULL;
3848+ip_address_item *last = NULL;
3849+ip_address_item *next;
3850+
3851+size_t needed;
3852+int mib[6];
3853+char *buf, *nextaddr, *lim;
3854+register struct if_msghdr *ifm;
3855+
3856+mib[0] = CTL_NET;
3857+mib[1] = PF_ROUTE;
3858+mib[2] = 0;
3859+mib[3] = 0;
3860+mib[4] = NET_RT_IFLIST;
3861+mib[5] = 0;
3862+
3863+/* Get an estimate of the amount of store needed, then get the store and
3864+get the data into it. Any error causes a panic death. */
3865+
3866+if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
3867+ log_write(0, LOG_PANIC_DIE, "iflist-sysctl-estimate failed: %s",
3868+ strerror(errno));
3869+
3870+buf = store_get(needed);
3871+
3872+if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
3873+ log_write(0, LOG_PANIC_DIE, "sysctl of ifnet list failed: %s",
3874+ strerror(errno));
3875+
3876+/* Now fish out the data for each interface */
3877+
3878+lim = buf + needed;
3879+for (nextaddr = buf; nextaddr < lim; nextaddr += ifm->ifm_msglen)
3880+ {
3881+ ifm = (struct if_msghdr *)nextaddr;
3882+
3883+ if (ifm->ifm_type != RTM_IFINFO)
3884+ {
3885+ struct ifa_msghdr *ifam = (struct ifa_msghdr *)ifm;
3886+ struct sockaddr_in *mask = NULL, *addr = NULL;
3887+
3888+ if ((ifam->ifam_addrs & RTA_NETMASK) != 0)
3889+ mask = (struct sockaddr_in *)(ifam + 1);
3890+
3891+ if ((ifam->ifam_addrs & RTA_IFA) != 0)
3892+ {
3893+ char *cp = CS mask;
3894+ struct sockaddr *sa = (struct sockaddr *)mask;
3895+ ADVANCE(cp, sa);
3896+ addr = (struct sockaddr_in *)cp;
3897+ }
3898+
3899+ /* Create a data block for the address, fill in the data, and put it on
3900+ the chain. This data has to survive for ever, so use malloc. */
3901+
3902+ if (addr != NULL)
3903+ {
3904+ next = store_malloc(sizeof(ip_address_item));
3905+ next->next = NULL;
3906+ next->port = 0;
3907+ (void)host_ntoa(-1, addr, next->address, NULL);
3908+
3909+ if (yield == NULL) yield = last = next; else
3910+ {
3911+ last->next = next;
3912+ last = next;
3913+ }
3914+
3915+ DEBUG(D_interface) debug_printf("Actual local interface address is %s\n",
3916+ last->address);
3917+ }
3918+ }
3919+ }
3920+
3921+return yield;
3922+}
3923+
3924+#endif /* FIND_RUNNING_INTERFACES */
3925+
3926+/* End of os.c-IRIX */
3927diff --git a/OS/unsupported/os.c-IRIX632 b/OS/unsupported/os.c-IRIX632
3928new file mode 100644
3929index 0000000..1f6b0e1
3930--- /dev/null
3931+++ b/OS/unsupported/os.c-IRIX632
3932@@ -0,0 +1,118 @@
3933+/*************************************************
3934+* Exim - an Internet mail transport agent *
3935+*************************************************/
3936+
3937+/* Copyright (c) University of Cambridge 2001 */
3938+/* See the file NOTICE for conditions of use and distribution. */
3939+
3940+/* Irix-specific code. This is concatenated onto the generic src/os.c file.
3941+Irix has a unique way of finding all the network interfaces, so we provide a
3942+unique function here, and define FIND_RUNNING_INTERFACES to stop src/os.c
3943+trying to provide the function. The macro may be set initially anyway, when
3944+compiling os. for utilities that don't want this function. */
3945+
3946+#ifndef FIND_RUNNING_INTERFACES
3947+#define FIND_RUNNING_INTERFACES
3948+
3949+/* This is the special form of the function using sysctl() which is the only
3950+form that returns all the aliases on IRIX systems. This code has its origins
3951+in a sample program that came from within SGI. */
3952+
3953+#include <sys/sysctl.h>
3954+#include <net/if_dl.h>
3955+#include <net/if_types.h>
3956+#include <net/soioctl.h>
3957+#include <net/route.h>
3958+
3959+#define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) -1))) \
3960+ : sizeof(__uint64_t))
3961+#ifdef _HAVE_SA_LEN
3962+#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
3963+#else
3964+#define ADVANCE(x, n) (x += ROUNDUP(_FAKE_SA_LEN_DST(n)))
3965+#endif
3966+
3967+
3968+ip_address_item *
3969+os_find_running_interfaces(void)
3970+{
3971+ip_address_item *yield = NULL;
3972+ip_address_item *last = NULL;
3973+ip_address_item *next;
3974+
3975+size_t needed;
3976+int mib[6];
3977+char *buf, *nextaddr, *lim;
3978+register struct if_msghdr *ifm;
3979+
3980+mib[0] = CTL_NET;
3981+mib[1] = PF_ROUTE;
3982+mib[2] = 0;
3983+mib[3] = 0;
3984+mib[4] = NET_RT_IFLIST;
3985+mib[5] = 0;
3986+
3987+/* Get an estimate of the amount of store needed, then get the store and
3988+get the data into it. Any error causes a panic death. */
3989+
3990+if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
3991+ log_write(0, LOG_PANIC_DIE, "iflist-sysctl-estimate failed: %s",
3992+ strerror(errno));
3993+
3994+buf = store_get(needed);
3995+
3996+if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
3997+ log_write(0, LOG_PANIC_DIE, "sysctl of ifnet list failed: %s",
3998+ strerror(errno));
3999+
4000+/* Now fish out the data for each interface */
4001+
4002+lim = buf + needed;
4003+for (nextaddr = buf; nextaddr < lim; nextaddr += ifm->ifm_msglen)
4004+ {
4005+ ifm = (struct if_msghdr *)nextaddr;
4006+
4007+ if (ifm->ifm_type != RTM_IFINFO)
4008+ {
4009+ struct ifa_msghdr *ifam = (struct ifa_msghdr *)ifm;
4010+ struct sockaddr_in *mask = NULL, *addr = NULL;
4011+
4012+ if ((ifam->ifam_addrs & RTA_NETMASK) != 0)
4013+ mask = (struct sockaddr_in *)(ifam + 1);
4014+
4015+ if ((ifam->ifam_addrs & RTA_IFA) != 0)
4016+ {
4017+ char *cp = CS mask;
4018+ struct sockaddr *sa = (struct sockaddr *)mask;
4019+ ADVANCE(cp, sa);
4020+ addr = (struct sockaddr_in *)cp;
4021+ }
4022+
4023+ /* Create a data block for the address, fill in the data, and put it on
4024+ the chain. This data has to survive for ever, so use malloc. */
4025+
4026+ if (addr != NULL)
4027+ {
4028+ next = store_malloc(sizeof(ip_address_item));
4029+ next->next = NULL;
4030+ next->port = 0;
4031+ (void)host_ntoa(-1, addr, next->address, NULL);
4032+
4033+ if (yield == NULL) yield = last = next; else
4034+ {
4035+ last->next = next;
4036+ last = next;
4037+ }
4038+
4039+ DEBUG(D_interface) debug_printf("Actual local interface address is %s\n",
4040+ last->address);
4041+ }
4042+ }
4043+ }
4044+
4045+return yield;
4046+}
4047+
4048+#endif /* FIND_RUNNING_INTERFACES */
4049+
4050+/* End of os.c-IRIX */
4051diff --git a/OS/unsupported/os.c-IRIX65 b/OS/unsupported/os.c-IRIX65
4052new file mode 100644
4053index 0000000..1f6b0e1
4054--- /dev/null
4055+++ b/OS/unsupported/os.c-IRIX65
4056@@ -0,0 +1,118 @@
4057+/*************************************************
4058+* Exim - an Internet mail transport agent *
4059+*************************************************/
4060+
4061+/* Copyright (c) University of Cambridge 2001 */
4062+/* See the file NOTICE for conditions of use and distribution. */
4063+
4064+/* Irix-specific code. This is concatenated onto the generic src/os.c file.
4065+Irix has a unique way of finding all the network interfaces, so we provide a
4066+unique function here, and define FIND_RUNNING_INTERFACES to stop src/os.c
4067+trying to provide the function. The macro may be set initially anyway, when
4068+compiling os. for utilities that don't want this function. */
4069+
4070+#ifndef FIND_RUNNING_INTERFACES
4071+#define FIND_RUNNING_INTERFACES
4072+
4073+/* This is the special form of the function using sysctl() which is the only
4074+form that returns all the aliases on IRIX systems. This code has its origins
4075+in a sample program that came from within SGI. */
4076+
4077+#include <sys/sysctl.h>
4078+#include <net/if_dl.h>
4079+#include <net/if_types.h>
4080+#include <net/soioctl.h>
4081+#include <net/route.h>
4082+
4083+#define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) -1))) \
4084+ : sizeof(__uint64_t))
4085+#ifdef _HAVE_SA_LEN
4086+#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
4087+#else
4088+#define ADVANCE(x, n) (x += ROUNDUP(_FAKE_SA_LEN_DST(n)))
4089+#endif
4090+
4091+
4092+ip_address_item *
4093+os_find_running_interfaces(void)
4094+{
4095+ip_address_item *yield = NULL;
4096+ip_address_item *last = NULL;
4097+ip_address_item *next;
4098+
4099+size_t needed;
4100+int mib[6];
4101+char *buf, *nextaddr, *lim;
4102+register struct if_msghdr *ifm;
4103+
4104+mib[0] = CTL_NET;
4105+mib[1] = PF_ROUTE;
4106+mib[2] = 0;
4107+mib[3] = 0;
4108+mib[4] = NET_RT_IFLIST;
4109+mib[5] = 0;
4110+
4111+/* Get an estimate of the amount of store needed, then get the store and
4112+get the data into it. Any error causes a panic death. */
4113+
4114+if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
4115+ log_write(0, LOG_PANIC_DIE, "iflist-sysctl-estimate failed: %s",
4116+ strerror(errno));
4117+
4118+buf = store_get(needed);
4119+
4120+if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
4121+ log_write(0, LOG_PANIC_DIE, "sysctl of ifnet list failed: %s",
4122+ strerror(errno));
4123+
4124+/* Now fish out the data for each interface */
4125+
4126+lim = buf + needed;
4127+for (nextaddr = buf; nextaddr < lim; nextaddr += ifm->ifm_msglen)
4128+ {
4129+ ifm = (struct if_msghdr *)nextaddr;
4130+
4131+ if (ifm->ifm_type != RTM_IFINFO)
4132+ {
4133+ struct ifa_msghdr *ifam = (struct ifa_msghdr *)ifm;
4134+ struct sockaddr_in *mask = NULL, *addr = NULL;
4135+
4136+ if ((ifam->ifam_addrs & RTA_NETMASK) != 0)
4137+ mask = (struct sockaddr_in *)(ifam + 1);
4138+
4139+ if ((ifam->ifam_addrs & RTA_IFA) != 0)
4140+ {
4141+ char *cp = CS mask;
4142+ struct sockaddr *sa = (struct sockaddr *)mask;
4143+ ADVANCE(cp, sa);
4144+ addr = (struct sockaddr_in *)cp;
4145+ }
4146+
4147+ /* Create a data block for the address, fill in the data, and put it on
4148+ the chain. This data has to survive for ever, so use malloc. */
4149+
4150+ if (addr != NULL)
4151+ {
4152+ next = store_malloc(sizeof(ip_address_item));
4153+ next->next = NULL;
4154+ next->port = 0;
4155+ (void)host_ntoa(-1, addr, next->address, NULL);
4156+
4157+ if (yield == NULL) yield = last = next; else
4158+ {
4159+ last->next = next;
4160+ last = next;
4161+ }
4162+
4163+ DEBUG(D_interface) debug_printf("Actual local interface address is %s\n",
4164+ last->address);
4165+ }
4166+ }
4167+ }
4168+
4169+return yield;
4170+}
4171+
4172+#endif /* FIND_RUNNING_INTERFACES */
4173+
4174+/* End of os.c-IRIX */
4175diff --git a/OS/unsupported/os.c-OSF1 b/OS/unsupported/os.c-OSF1
4176new file mode 100644
4177index 0000000..ad91b63
4178--- /dev/null
4179+++ b/OS/unsupported/os.c-OSF1
4180@@ -0,0 +1,36 @@
4181+/*************************************************
4182+* Exim - an Internet mail transport agent *
4183+*************************************************/
4184+
4185+/* Copyright (c) University of Cambridge 2001 */
4186+/* See the file NOTICE for conditions of use and distribution. */
4187+
4188+/* OSF1-specific code. This is concatenated onto the generic src/os.c file.
4189+OSF1 has an apparently unique way of getting the load average, so we provide a
4190+unique function here, and define OS_LOAD_AVERAGE to stop src/os.c trying to
4191+provide the function. The macro may be set initially anyway, when compiling os.
4192+for utilities that don't want this function. */
4193+
4194+#ifndef OS_LOAD_AVERAGE
4195+#define OS_LOAD_AVERAGE
4196+
4197+#include <sys/table.h>
4198+
4199+int
4200+os_getloadavg(void)
4201+{
4202+double avg;
4203+struct tbl_loadavg load_avg;
4204+
4205+table (TBL_LOADAVG, 0, &load_avg, 1, sizeof (load_avg));
4206+
4207+avg = (load_avg.tl_lscale == 0)?
4208+ load_avg.tl_avenrun.d[0] :
4209+ (load_avg.tl_avenrun.l[0] / (double)load_avg.tl_lscale);
4210+
4211+return (int)(avg * 1000.0);
4212+}
4213+
4214+#endif /* OS_LOAD_AVERAGE */
4215+
4216+/* End of os.c-OSF1 */
4217diff --git a/OS/unsupported/os.c-cygwin b/OS/unsupported/os.c-cygwin
4218new file mode 100644
4219index 0000000..c9464aa
4220--- /dev/null
4221+++ b/OS/unsupported/os.c-cygwin
4222@@ -0,0 +1,531 @@
4223+/*************************************************
4224+* Exim - an Internet mail transport agent *
4225+*************************************************/
4226+
4227+/* Cygwin-specific code. December 2002. Updated Jan 2015.
4228+ This is prefixed to the src/os.c file.
4229+
4230+ This code was supplied by Pierre A. Humblet <Pierre.Humblet@ieee.org>
4231+*/
4232+
4233+/* We need a special mkdir that
4234+ allows names starting with // */
4235+#undef mkdir
4236+int cygwin_mkdir( const char *path, mode_t mode )
4237+{
4238+ const char * p = path;
4239+ if (*p == '/') while(*(p+1) == '/') p++;
4240+ return mkdir(p, mode);
4241+}
4242+
4243+#ifndef COMPILE_UTILITY /* Utilities don't need special code */
4244+
4245+#ifdef INCLUDE_PAM
4246+#include "../pam/pam.c"
4247+#endif
4248+#include <alloca.h>
4249+
4250+unsigned int cygwin_WinVersion;
4251+
4252+/* Conflict between Windows definitions and others */
4253+#ifdef NOERROR
4254+#undef NOERROR
4255+#endif
4256+#ifdef DELETE
4257+#undef DELETE
4258+#endif
4259+
4260+#include <windows.h>
4261+#include <ntstatus.h>
4262+#include <lmcons.h>
4263+
4264+#define EqualLuid(Luid1, Luid2) \
4265+ ((Luid1.LowPart == Luid2.LowPart) && (Luid1.HighPart == Luid2.HighPart))
4266+#include <sys/cygwin.h>
4267+
4268+/* Special static variables */
4269+static BOOL cygwin_debug = FALSE;
4270+static int fakesetugid = 1; /* when not privileged, setugid = noop */
4271+
4272+#undef setuid
4273+int cygwin_setuid(uid_t uid )
4274+{
4275+ int res = 0;
4276+ if (fakesetugid == 0) {
4277+ res = setuid(uid);
4278+ if (cygwin_debug)
4279+ fprintf(stderr, "setuid %u %u %d pid: %d\n",
4280+ uid, getuid(),res, getpid());
4281+ }
4282+ return res;
4283+}
4284+
4285+#undef setgid
4286+int cygwin_setgid(gid_t gid )
4287+{
4288+ int res = 0;
4289+ if (fakesetugid == 0) {
4290+ res = setgid(gid);
4291+ if (cygwin_debug)
4292+ fprintf(stderr, "setgid %u %u %d pid: %d\n",
4293+ gid, getgid(), res, getpid());
4294+ }
4295+ return res;
4296+}
4297+
4298+/* Background processes run at lower priority */
4299+static void cygwin_setpriority()
4300+{
4301+ if (!SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS))
4302+ SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
4303+ return;
4304+}
4305+
4306+
4307+/* GetVersion()
4308+ MSB: 1 for 95/98/ME; Next 7: build number, except for 95/98/ME
4309+ Next byte: 0
4310+ Next byte: minor version of OS
4311+ Low byte: major version of OS (3 or 4 for for NT, 5 for 2000 and XP) */
4312+//#define VERSION_IS_58M(x) (x & 0x80000000) /* 95, 98, Me */
4313+//#define VERSION_IS_NT(x) ((x & 0XFF) < 5) /* NT 4 or 3.51 */
4314+
4315+/*
4316+ Routine to find if process or thread is privileged
4317+*/
4318+
4319+enum {
4320+ CREATE_BIT = 1,
4321+};
4322+
4323+static DWORD get_privileges ()
4324+{
4325+ char buffer[1024];
4326+ DWORD i, length;
4327+ HANDLE hToken = NULL;
4328+ PTOKEN_PRIVILEGES privs;
4329+ LUID cluid, rluid;
4330+ DWORD ret = 0;
4331+
4332+ privs = (PTOKEN_PRIVILEGES) buffer;
4333+
4334+ if (OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hToken)
4335+ && LookupPrivilegeValue (NULL, SE_CREATE_TOKEN_NAME, &cluid)
4336+ && LookupPrivilegeValue(NULL, SE_RESTORE_NAME, &rluid)
4337+ && (GetTokenInformation( hToken, TokenPrivileges,
4338+ privs, sizeof (buffer), &length)
4339+ || (GetLastError () == ERROR_INSUFFICIENT_BUFFER
4340+ && (privs = (PTOKEN_PRIVILEGES) alloca (length))
4341+ && GetTokenInformation(hToken, TokenPrivileges,
4342+ privs, length, &length)))) {
4343+ for (i = 0; i < privs->PrivilegeCount; i++) {
4344+ if (EqualLuid(privs->Privileges[i].Luid, cluid))
4345+ ret |= CREATE_BIT;
4346+ if (ret == (CREATE_BIT))
4347+ break;
4348+ }
4349+ }
4350+ else
4351+ fprintf(stderr, "has_create_token_privilege %u\n", GetLastError());
4352+
4353+ if (hToken)
4354+ CloseHandle(hToken);
4355+
4356+ return ret;
4357+}
4358+
4359+/*
4360+ We use cygwin_premain to fake a few things
4361+ and to provide some debug info
4362+*/
4363+void cygwin_premain2(int argc, char ** argv, struct per_process * ptr)
4364+{
4365+ int i, res, is_daemon = 0, is_spoolwritable, is_privileged, is_eximuser;
4366+ uid_t myuid, systemuid;
4367+ gid_t mygid, adminsgid;
4368+ struct passwd * pwp = NULL;
4369+ struct stat buf;
4370+ char *cygenv;
4371+ SID(1, SystemSid, SECURITY_LOCAL_SYSTEM_RID);
4372+ SID(2, AdminsSid, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS);
4373+ DWORD priv_flags;
4374+
4375+ myuid = getuid();
4376+ mygid = getgid();
4377+ cygwin_WinVersion = GetVersion();
4378+ if ((cygenv = getenv("CYGWIN")) == NULL) cygenv = "";
4379+ /* Produce some debugging on stderr,
4380+ cannot yet use exim's debug functions.
4381+ Exim does not use -c and ignores -n.
4382+ Set lower priority for daemons */
4383+ for (i = 1; i < argc; i++) {
4384+ if (argv[i][0] == '-') {
4385+ if (argv[i][1] == 'c') {
4386+ ssize_t size;
4387+ wchar_t *win32_path;
4388+ argv[i][1] = 'n'; /* Replace -c by -n */
4389+ cygwin_debug = TRUE;
4390+ fprintf(stderr, "CYGWIN = \"%s\".\n", cygenv);
4391+ if (((size = cygwin_conv_path(CCP_POSIX_TO_WIN_W,"/", win32_path, 0)) > 0)
4392+ && ((win32_path = malloc(size)) != NULL)
4393+ && (cygwin_conv_path(CCP_POSIX_TO_WIN_W,"/", win32_path, size) == 0)) {
4394+ fprintf(stderr, " Root / mapped to %ls.\n", win32_path);
4395+ free(win32_path);
4396+ }
4397+ }
4398+ else if (argv[i][1] == 'b' && argv[i][2] == 'd') {
4399+ is_daemon = 1;
4400+ cygwin_setpriority();
4401+ }
4402+ }
4403+ }
4404+
4405+ /* Nt/2000/XP
4406+ We initially set the exim uid & gid to those of the "exim user",
4407+ or to the root uid (SYSTEM) and exim gid (ADMINS),
4408+ If privileged, we setuid to those.
4409+ We always set the configure uid to the system uid.
4410+ We always set the root uid to the real uid
4411+ to allow exim imposed restrictions (bypassable by recompiling)
4412+ and to avoid exec that cause loss of privilege
4413+ If not privileged and unable to chown,
4414+ we set the exim uid to our uid.
4415+ If unprivileged and /var/spool/exim is writable and not running as listening daemon,
4416+ we fake all subsequent setuid. */
4417+
4418+ /* Get the system and admins uid from their sids */
4419+ if ((systemuid = cygwin_internal(CW_GET_UID_FROM_SID, & SystemSid)) == -1) {
4420+ fprintf(stderr, "Cannot map System sid. Aborting\n");
4421+ exit(1);
4422+ }
4423+ if ((adminsgid = cygwin_internal(CW_GET_GID_FROM_SID, & AdminsSid)) == -1) {
4424+ fprintf(stderr, "Cannot map Admins sid. Aborting\n");
4425+ exit(1);
4426+ }
4427+
4428+ priv_flags = get_privileges ();
4429+ is_privileged = !!(priv_flags & CREATE_BIT);
4430+
4431+ /* Call getpwnam for account exim after getting the local exim name */
4432+ char exim_username[DNLEN + UNLEN + 2];
4433+ if (cygwin_internal(CW_CYGNAME_FROM_WINNAME, "exim", exim_username, sizeof exim_username) != 0)
4434+ pwp = getpwnam (exim_username);
4435+
4436+ /* If cannot setuid to exim or and is not the daemon (which is assumed to be
4437+ able to chown or to be the exim user) set the exim ugid to our ugid to avoid
4438+ chown failures after creating files and to be able to setuid to exim in
4439+ exim.c ( "privilege not needed" ). */
4440+ if ((is_privileged == 0) && (!is_daemon)) {
4441+ exim_uid = myuid;
4442+ exim_gid = mygid;
4443+ }
4444+ else if (pwp != NULL) {
4445+ exim_uid = pwp->pw_uid; /* Set it according to passwd */
4446+ exim_gid = pwp->pw_gid;
4447+ is_eximuser = 1;
4448+ }
4449+ else {
4450+ exim_uid = systemuid;
4451+ exim_gid = adminsgid;
4452+ is_eximuser = 0;
4453+ }
4454+
4455+ res = stat("/var/spool/exim", &buf);
4456+ /* Check if writable (and can be stat) */
4457+ is_spoolwritable = ((res == 0) && ((buf.st_mode & S_IWOTH) != 0));
4458+
4459+ fakesetugid = (is_privileged == 0) && (is_daemon == 0) && (is_spoolwritable == 1);
4460+
4461+ if (is_privileged) { /* Can setuid */
4462+ if (cygwin_setgid(exim_gid) /* Setuid to exim */
4463+ || cygwin_setuid(exim_uid)) {
4464+ fprintf(stderr, "Unable to setuid/gid to exim. priv_flags: %x\n", priv_flags);
4465+ exit(0); /* Problem... Perhaps not in 544 */
4466+ }
4467+ }
4468+
4469+ /* Set the configuration file uid and gid to the system uid and admins gid. */
4470+ config_uid = systemuid;
4471+ config_gid = adminsgid;
4472+
4473+ /* Pretend we are root to avoid useless exec
4474+ and avoid exim set limitations.
4475+ We are limited by file access rights */
4476+ root_uid = getuid ();
4477+
4478+ if (cygwin_debug) {
4479+ fprintf(stderr, "Starting uid %u, gid %u, priv_flags %x, is_privileged %d, is_daemon %d, is_spoolwritable %d.\n",
4480+ myuid, mygid, priv_flags, is_privileged, is_daemon, is_spoolwritable);
4481+ fprintf(stderr, "root_uid %u, exim_uid %u, exim_gid %u, config_uid %u, config_gid %u, is_eximuser %d.\n",
4482+ root_uid, exim_uid, exim_gid, config_uid, config_gid, is_eximuser);
4483+ }
4484+ return;
4485+}
4486+
4487+#ifndef OS_LOAD_AVERAGE /* Can be set on command line */
4488+#define OS_LOAD_AVERAGE /* src/os.c need not provide it */
4489+
4490+/*****************************************************************
4491+ Functions for average load measurements
4492+
4493+ Uses NtQuerySystemInformation.
4494+ This requires definitions that are not part of
4495+ standard include files.
4496+
4497+ This is discouraged starting with WinXP.
4498+
4499+*************************************************************/
4500+/* Structure to compute the load average efficiently */
4501+typedef struct {
4502+ DWORD Lock;
4503+ unsigned long long Time100ns; /* Last measurement time */
4504+ unsigned long long IdleCount; /* Latest cumulative idle time */
4505+ unsigned long long LastCounter; /* Last measurement counter */
4506+ unsigned long long PerfFreq; /* Perf counter frequency */
4507+ int LastLoad; /* Last reported load, or -1 */
4508+} cygwin_perf_t;
4509+
4510+static struct {
4511+ HANDLE handle;
4512+ pid_t pid;
4513+ cygwin_perf_t *perf;
4514+} cygwin_load = {NULL, 0, NULL};
4515+
4516+#include <ntdef.h>
4517+
4518+typedef enum _SYSTEM_INFORMATION_CLASS
4519+{
4520+ SystemBasicInformation = 0,
4521+ SystemPerformanceInformation = 2,
4522+ SystemTimeOfDayInformation = 3,
4523+ SystemProcessesAndThreadsInformation = 5,
4524+ SystemProcessorTimes = 8,
4525+ SystemPagefileInformation = 18,
4526+ /* There are a lot more of these... */
4527+} SYSTEM_INFORMATION_CLASS;
4528+
4529+typedef struct _SYSTEM_BASIC_INFORMATION
4530+{
4531+ ULONG Unknown;
4532+ ULONG MaximumIncrement;
4533+ ULONG PhysicalPageSize;
4534+ ULONG NumberOfPhysicalPages;
4535+ ULONG LowestPhysicalPage;
4536+ ULONG HighestPhysicalPage;
4537+ ULONG AllocationGranularity;
4538+ ULONG LowestUserAddress;
4539+ ULONG HighestUserAddress;
4540+ ULONG ActiveProcessors;
4541+ UCHAR NumberProcessors;
4542+} SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION;
4543+
4544+typedef struct __attribute__ ((aligned (8))) _SYSTEM_PROCESSOR_TIMES
4545+{
4546+ LARGE_INTEGER IdleTime;
4547+ LARGE_INTEGER KernelTime;
4548+ LARGE_INTEGER UserTime;
4549+ LARGE_INTEGER DpcTime;
4550+ LARGE_INTEGER InterruptTime;
4551+ ULONG InterruptCount;
4552+} SYSTEM_PROCESSOR_TIMES, *PSYSTEM_PROCESSOR_TIMES;
4553+
4554+typedef NTSTATUS NTAPI (*NtQuerySystemInformation_t) (SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
4555+typedef ULONG NTAPI (*RtlNtStatusToDosError_t) (NTSTATUS);
4556+
4557+static NtQuerySystemInformation_t NtQuerySystemInformation;
4558+static RtlNtStatusToDosError_t RtlNtStatusToDosError;
4559+
4560+/*****************************************************************
4561+ *
4562+ LoadNtdll()
4563+ Load special functions from the NTDLL
4564+ Return TRUE if success.
4565+
4566+ *****************************************************************/
4567+
4568+static BOOL LoadNtdll()
4569+{
4570+ HINSTANCE hinstLib;
4571+
4572+ if ((hinstLib = LoadLibrary("NTDLL.DLL"))
4573+ && (NtQuerySystemInformation =
4574+ (NtQuerySystemInformation_t) GetProcAddress(hinstLib,
4575+ "NtQuerySystemInformation"))
4576+ && (RtlNtStatusToDosError =
4577+ (RtlNtStatusToDosError_t) GetProcAddress(hinstLib,
4578+ "RtlNtStatusToDosError")))
4579+ return TRUE;
4580+
4581+ DEBUG(D_load)
4582+ debug_printf("perf: load: %u (Windows)\n", GetLastError());
4583+ return FALSE;
4584+}
4585+/*****************************************************************
4586+ *
4587+ ReadStat()
4588+ Measures current Time100ns and IdleCount
4589+ Return TRUE if success.
4590+
4591+ *****************************************************************/
4592+
4593+static BOOL ReadStat(unsigned long long int *Time100nsPtr,
4594+ unsigned long long int *IdleCountPtr)
4595+{
4596+ NTSTATUS ret;
4597+ SYSTEM_BASIC_INFORMATION sbi;
4598+ PSYSTEM_PROCESSOR_TIMES spt;
4599+
4600+ *Time100nsPtr = *IdleCountPtr = 0;
4601+
4602+ if ((ret = NtQuerySystemInformation(SystemBasicInformation,
4603+ (PVOID) &sbi, sizeof sbi, NULL))
4604+ != STATUS_SUCCESS) {
4605+ DEBUG(D_load)
4606+ debug_printf("Perf: NtQuerySystemInformation: %u (Windows)\n",
4607+ RtlNtStatusToDosError(ret));
4608+ }
4609+ else if (!(spt = (PSYSTEM_PROCESSOR_TIMES) alloca(sizeof(spt[0]) * sbi.NumberProcessors))) {
4610+ DEBUG(D_load)
4611+ debug_printf("Perf: alloca: errno %d (%s)\n", errno, strerror(errno));
4612+ }
4613+ else if ((ret = NtQuerySystemInformation(SystemProcessorTimes, (PVOID) spt,
4614+ sizeof spt[0] * sbi.NumberProcessors, NULL))
4615+ != STATUS_SUCCESS) {
4616+ DEBUG(D_load)
4617+ debug_printf("Perf: NtQuerySystemInformation: %u (Windows)\n",
4618+ RtlNtStatusToDosError(ret));
4619+ }
4620+ else {
4621+ int i;
4622+ for (i = 0; i < sbi.NumberProcessors; i++) {
4623+ *Time100nsPtr += spt[i].KernelTime.QuadPart;;
4624+ *Time100nsPtr += spt[i].UserTime.QuadPart;
4625+ *IdleCountPtr += spt[i].IdleTime.QuadPart;
4626+ }
4627+ return TRUE;
4628+ }
4629+ return FALSE;
4630+}
4631+
4632+/*****************************************************************
4633+ *
4634+ InitLoadAvg()
4635+ Initialize the cygwin_load.perf structure.
4636+ and set cygwin_load.perf->Flag to TRUE if successful.
4637+ This is called the first time os_getloadavg is called
4638+ *****************************************************************/
4639+static void InitLoadAvg(cygwin_perf_t *this)
4640+{
4641+ BOOL success = TRUE;
4642+
4643+ /* Get perf frequency and counter */
4644+ QueryPerformanceFrequency((LARGE_INTEGER *)& this->PerfFreq);
4645+ QueryPerformanceCounter((LARGE_INTEGER *)& this->LastCounter);
4646+
4647+ /* Get initial values for Time100ns and IdleCount */
4648+ success = success
4649+ && ReadStat( & this->Time100ns,
4650+ & this->IdleCount);
4651+ /* If success, set the Load to 0, else to -1 */
4652+ if (success) this->LastLoad = 0;
4653+ else {
4654+ log_write(0, LOG_MAIN, "Cannot obtain Load Average");
4655+ this->LastLoad = -1;
4656+ }
4657+}
4658+
4659+
4660+/*****************************************************************
4661+ *
4662+ os_getloadavg()
4663+
4664+ Return -1 if not available;
4665+ Return the previous value if less than AVERAGING sec old.
4666+ else return the processor load on a [0 - 1000] scale.
4667+
4668+ The first time we are called we initialize the counts
4669+ and return 0 or -1.
4670+ The initial load cannot be measured as we use the processor 100%
4671+*****************************************************************/
4672+static SECURITY_ATTRIBUTES sa = {sizeof (SECURITY_ATTRIBUTES), NULL, TRUE};
4673+#define AVERAGING 10
4674+
4675+int os_getloadavg()
4676+{
4677+ unsigned long long Time100ns, IdleCount, CurrCounter;
4678+ int value;
4679+ pid_t newpid;
4680+
4681+ /* New process.
4682+ Reload the dlls and the file mapping */
4683+ if ((newpid = getpid()) != cygwin_load.pid) {
4684+ BOOL new;
4685+ cygwin_load.pid = newpid;
4686+
4687+ if (!LoadNtdll()) {
4688+ log_write(0, LOG_MAIN, "Cannot obtain Load Average");
4689+ cygwin_load.perf = NULL;
4690+ return -1;
4691+ }
4692+
4693+ if ((new = !cygwin_load.handle)) {
4694+ cygwin_load.handle = CreateFileMapping (INVALID_HANDLE_VALUE, &sa, PAGE_READWRITE,
4695+ 0, sizeof(cygwin_perf_t), NULL);
4696+ DEBUG(D_load)
4697+ debug_printf("Perf: CreateFileMapping: handle %p\n", (void *) cygwin_load.handle);
4698+ }
4699+ cygwin_load.perf = (cygwin_perf_t *) MapViewOfFile (cygwin_load.handle,
4700+ FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
4701+ DEBUG(D_load)
4702+ debug_printf("Perf: MapViewOfFile: addr %p\n", (void *) cygwin_load.perf);
4703+ if (new && cygwin_load.perf)
4704+ InitLoadAvg(cygwin_load.perf);
4705+ }
4706+
4707+ /* Check if initialized OK */
4708+ if (!cygwin_load.perf || cygwin_load.perf->LastLoad < 0)
4709+ return -1;
4710+
4711+ /* If we cannot get the lock, we return 0.
4712+ This is to prevent any lock-up possibility.
4713+ Finding a lock busy is unlikely, and giving up only
4714+ results in an immediate delivery .*/
4715+
4716+ if (InterlockedCompareExchange(&cygwin_load.perf->Lock, 1, 0)) {
4717+ DEBUG(D_load)
4718+ debug_printf("Perf: Lock busy\n");
4719+ return 0;
4720+ }
4721+
4722+ /* Get the current time (PerfCounter) */
4723+ QueryPerformanceCounter((LARGE_INTEGER *)& CurrCounter);
4724+ /* Calls closer than AVERAGING sec apart use the previous value */
4725+ if (CurrCounter - cygwin_load.perf->LastCounter >
4726+ AVERAGING * cygwin_load.perf->PerfFreq) {
4727+ /* Get Time100ns and IdleCount */
4728+ if (ReadStat( & Time100ns, & IdleCount)) { /* Success */
4729+ /* Return processor load on 1000 scale */
4730+ value = 1000 - ((1000 * (IdleCount - cygwin_load.perf->IdleCount)) /
4731+ (Time100ns - cygwin_load.perf->Time100ns));
4732+ cygwin_load.perf->Time100ns = Time100ns;
4733+ cygwin_load.perf->IdleCount = IdleCount;
4734+ cygwin_load.perf->LastCounter = CurrCounter;
4735+ cygwin_load.perf->LastLoad = value;
4736+ DEBUG(D_load)
4737+ debug_printf("Perf: New load average %d\n", value);
4738+ }
4739+ else { /* Something bad happened.
4740+ Refuse to measure the load anymore
4741+ but don't bother releasing the buffer */
4742+ log_write(0, LOG_MAIN, "Cannot obtain Load Average");
4743+ cygwin_load.perf->LastLoad = -1;
4744+ }
4745+ }
4746+ else
4747+ DEBUG(D_load)
4748+ debug_printf("Perf: Old load average %d\n", cygwin_load.perf->LastLoad);
4749+ cygwin_load.perf->Lock = 0;
4750+ return cygwin_load.perf->LastLoad;
4751+}
4752+#endif /* OS_LOAD_AVERAGE */
4753+#endif /* COMPILE_UTILITY */
4754diff --git a/OS/unsupported/os.h-AIX b/OS/unsupported/os.h-AIX
4755new file mode 100644
4756index 0000000..5cd4501
4757--- /dev/null
4758+++ b/OS/unsupported/os.h-AIX
4759@@ -0,0 +1,27 @@
4760+/* Exim: OS-specific C header file for AIX */
4761+/* Written by Nick Waterman <nick@cimio.co.uk> */
4762+/* Modified by Philip Hazel with data from
4763+ Niels Provos <provos@wserver.physnet.uni-hamburg.de>
4764+ Juozas Simkevicius <juozas@omnitel.net> for load averages
4765+*/
4766+
4767+#define HAVE_DEV_KMEM
4768+#define LOAD_AVG_SYMBOL "avenrun"
4769+#define KERNEL_PATH "/unix"
4770+#define LOAD_AVG_TYPE int
4771+#define FSCALE 65536.0
4772+
4773+#define HAVE_SYS_VFS_H
4774+#define HAVE_SYS_STATFS_H
4775+
4776+/* Now tell AIX to emulate BSD as badly as it can. */
4777+
4778+#define _BSD 44
4779+
4780+typedef struct flock flock_t;
4781+
4782+/* default is non-const */
4783+#define ICONV_ARG2_TYPE const char **
4784+
4785+
4786+/* End */
4787diff --git a/OS/unsupported/os.h-BSDI b/OS/unsupported/os.h-BSDI
4788new file mode 100644
4789index 0000000..a1705ec
4790--- /dev/null
4791+++ b/OS/unsupported/os.h-BSDI
4792@@ -0,0 +1,15 @@
4793+/* Exim: OS-specific C header file for BSDI */
4794+
4795+#define HAVE_BSD_GETLOADAVG
4796+#define HAVE_SETCLASSRESOURCES
4797+#define HAVE_MMAP
4798+#define HAVE_SYS_MOUNT_H
4799+#define SIOCGIFCONF_GIVES_ADDR
4800+#define OS_UNSETENV
4801+
4802+typedef struct flock flock_t;
4803+
4804+/* default is non-const */
4805+#define ICONV_ARG2_TYPE const char **
4806+
4807+/* End */
4808diff --git a/OS/unsupported/os.h-DGUX b/OS/unsupported/os.h-DGUX
4809new file mode 100644
4810index 0000000..9040f0e
4811--- /dev/null
4812+++ b/OS/unsupported/os.h-DGUX
4813@@ -0,0 +1,28 @@
4814+/* Exim: OS-specific C header file for DGUX */
4815+
4816+/* Written by Ken Bailey (K.Bailey@rbgkew.org.uk) Feb 1998 */
4817+/* on dgux R4.11MU04 generic AViiON mc88100 */
4818+/* Modified Dec 1998 by PH after message from Ken. */
4819+
4820+#define HAVE_SYS_STATVFS_H
4821+#define F_FAVAIL f_favail
4822+
4823+#define NO_SYSEXITS /* DGUX doesn't ship sysexits.h */
4824+#define NO_IP_VAR_H /* DGUX has no netinet/ip_var.h */
4825+
4826+#define os_strsignal dg_strsignal
4827+#define OS_STRSIGNAL
4828+
4829+#define HAVE_MMAP
4830+
4831+/* The definition of ipoptions in netinet/in.h (masquerading as ip_opts) used
4832+in smtp_in.c is for Intel DG _IX86_ABI only. You may be able to get this to
4833+work on Intel DG but it's certainly easier to skip it on M88k. This means we
4834+forego the detection of some source-routing based IP attacks. */
4835+
4836+#define NO_IP_OPTIONS
4837+
4838+/* default is non-const */
4839+#define ICONV_ARG2_TYPE const char **
4840+
4841+/* End */
4842diff --git a/OS/unsupported/os.h-Darwin b/OS/unsupported/os.h-Darwin
4843new file mode 100644
4844index 0000000..f408740
4845--- /dev/null
4846+++ b/OS/unsupported/os.h-Darwin
4847@@ -0,0 +1,48 @@
4848+/* Exim: OS-specific C header file for Darwin (Mac OS X) */
4849+
4850+/* #define CRYPT_H */ /* Apparently this isn't needed */
4851+
4852+#define HAVE_MMAP
4853+#define HAVE_SYS_MOUNT_H
4854+#define PAM_H_IN_PAM
4855+#define SIOCGIFCONF_GIVES_ADDR
4856+
4857+/* OSX 10.2 does not have poll.h, 10.3 does emulate it badly. */
4858+#define NO_POLL_H
4859+
4860+#define F_FREESP O_TRUNC
4861+typedef struct flock flock_t;
4862+
4863+#define BASE_62 36 /* HFS+ aliases lower and upper cases in filenames.
4864+ Consider reducing MAX_LOCALHOST_NUMBER */
4865+
4866+#ifndef _BSD_SOCKLEN_T_
4867+#define _BSD_SOCKLEN_T_ int32_t /* socklen_t (duh) */
4868+#endif
4869+
4870+/* Settings for handling IP options. There's no netinet/ip_var.h. The IP
4871+option handling is in the style of the later GLIBCs but the GLIBC macros
4872+aren't set, so we invent a new one. */
4873+
4874+#define NO_IP_VAR_H
4875+#define DARWIN_IP_OPTIONS
4876+
4877+/* Need this for the DNS lookup code. Remember to remove if we get round to
4878+updating Exim to use the newer interface. */
4879+
4880+#define BIND_8_COMPAT
4881+
4882+/* It's not .so for dynamic libraries on Darwin. */
4883+#define DYNLIB_FN_EXT "dylib"
4884+
4885+/* We currently need some assistance getting OFF_T_FMT correct on MacOS */
4886+#ifdef OFF_T_FMT
4887+# undef OFF_T_FMT
4888+#endif
4889+#define OFF_T_FMT "%lld"
4890+#define LONGLONG_T long int
4891+
4892+/* default is non-const */
4893+#define ICONV_ARG2_TYPE const char **
4894+
4895+/* End */
4896diff --git a/OS/unsupported/os.h-DragonFly b/OS/unsupported/os.h-DragonFly
4897new file mode 100644
4898index 0000000..4c2f1d5
4899--- /dev/null
4900+++ b/OS/unsupported/os.h-DragonFly
4901@@ -0,0 +1,13 @@
4902+/* Exim: OS-specific C header file for DragonFly */
4903+
4904+#define HAVE_BSD_GETLOADAVG
4905+#define HAVE_MMAP
4906+#define HAVE_SYS_MOUNT_H
4907+#define SIOCGIFCONF_GIVES_ADDR
4908+
4909+typedef struct flock flock_t;
4910+
4911+/* default is non-const */
4912+#define ICONV_ARG2_TYPE const char **
4913+
4914+/* End */
4915diff --git a/OS/unsupported/os.h-GNU b/OS/unsupported/os.h-GNU
4916new file mode 100644
4917index 0000000..4499316
4918--- /dev/null
4919+++ b/OS/unsupported/os.h-GNU
4920@@ -0,0 +1,23 @@
4921+/* Exim: OS-specific C header file for GNU/Hurd */
4922+
4923+#define CRYPT_H
4924+#define GLIBC_IP_OPTIONS
4925+#define HAVE_BSD_GETLOADAVG
4926+#define HAVE_MMAP
4927+#define HAVE_SYS_VFS_H
4928+#define NO_IP_VAR_H
4929+#define SIG_IGN_WORKS
4930+#define SIOCGIFCONF_GIVES_ADDR
4931+
4932+#define F_FREESP O_TRUNC
4933+typedef struct flock flock_t;
4934+
4935+#define os_strsignal strsignal
4936+#define OS_STRSIGNAL
4937+
4938+/* Hurd-specific bits below */
4939+
4940+/* default is non-const */
4941+#define ICONV_ARG2_TYPE const char **
4942+
4943+/* End */
4944diff --git a/OS/unsupported/os.h-GNUkFreeBSD b/OS/unsupported/os.h-GNUkFreeBSD
4945new file mode 100644
4946index 0000000..ab35031
4947--- /dev/null
4948+++ b/OS/unsupported/os.h-GNUkFreeBSD
4949@@ -0,0 +1,25 @@
4950+/* Exim: OS-specific C header file for GNU/kFreeBSD */
4951+
4952+#define CRYPT_H
4953+#define GLIBC_IP_OPTIONS
4954+#define HAVE_MMAP
4955+#define HAVE_BSD_GETLOADAVG
4956+#define HAVE_SYS_VFS_H
4957+#define NO_IP_VAR_H
4958+#define SIG_IGN_WORKS
4959+
4960+#define F_FREESP O_TRUNC
4961+typedef struct flock flock_t;
4962+
4963+#define os_strsignal strsignal
4964+#define OS_STRSIGNAL
4965+
4966+/* kFreeBSD-specific bits below */
4967+
4968+#define HAVE_SYS_MOUNT_H
4969+#define SIOCGIFCONF_GIVES_ADDR
4970+
4971+/* default is non-const */
4972+#define ICONV_ARG2_TYPE const char **
4973+
4974+/* End */
4975diff --git a/OS/unsupported/os.h-GNUkNetBSD b/OS/unsupported/os.h-GNUkNetBSD
4976new file mode 100644
4977index 0000000..bc3bc25
4978--- /dev/null
4979+++ b/OS/unsupported/os.h-GNUkNetBSD
4980@@ -0,0 +1,25 @@
4981+/* Exim: OS-specific C header file for GNU/kNetBSD */
4982+
4983+#define CRYPT_H
4984+#define GLIBC_IP_OPTIONS
4985+#define HAVE_MMAP
4986+#define HAVE_BSD_GETLOADAVG
4987+#define HAVE_SYS_VFS_H
4988+#define NO_IP_VAR_H
4989+#define SIG_IGN_WORKS
4990+
4991+#define F_FREESP O_TRUNC
4992+typedef struct flock flock_t;
4993+
4994+#define os_strsignal strsignal
4995+#define OS_STRSIGNAL
4996+
4997+/* kNetBSD-specific bits below */
4998+
4999+#define HAVE_SYS_MOUNT_H
5000+#define SIOCGIFCONF_GIVES_ADDR
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches