Exim original port

This commit is contained in:
2025-12-18 02:01:07 +01:00
parent 1d39ae8491
commit 8544126ef2
23 changed files with 1890 additions and 0 deletions

View File

@ -0,0 +1,49 @@
#!/bin/sh
#
# Exim hints database maintenance
#
# contributed by: Oliver Eikemeier <eikemeier@fillmore-labs.com>
#
# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]; then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
: ${exim_tidydb_enable="YES"}
: ${exim_tidydb="%%PREFIX%%/sbin/exim_tidydb"}
# Set this to arbitrary shell command to filter
# the output from this periodic script, for example,
# exim_tidydb_filter="| tail -100".
: ${exim_tidydb_filter=""}
: ${exim_dbdir="/var/spool/exim"}
tidy () {
for db in "$exim_dbdir"/db/*.lockfile; do
[ "$db" = "$exim_dbdir/db/*.lockfile" ] && continue
echo
db_name=`basename "$db" .lockfile`
if [ -e "${exim_dbdir}/db/${db_name}.db" ]; then
"$exim_tidydb" "$exim_dbdir" "$db_name"
fi
done
}
case "$exim_tidydb_enable" in
[Yy][Ee][Ss])
echo ""
echo "Tidying Exim hints databases:"
eval tidy "$exim_tidydb_filter"
if [ $? = 0 ]; then
rc=0
else
rc=1
fi
;;
*) rc=0;;
esac
exit $rc

View File

@ -0,0 +1,66 @@
#!/bin/sh
#
# Check for rejected mail
# Log lines that end with ' : IGNORE' will not be reported
#
# contributed by: Oliver Eikemeier <eikemeier@fillmore-labs.com>
#
# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
. /etc/defaults/periodic.conf
source_periodic_confs
fi
: ${exim_status_mail_rejects_enable="YES"}
: ${exim_status_mail_rejects_logs=2}
: ${exim_rejectlog="%%LOGDIR%%/rejectlog"}
case "$exim_status_mail_rejects_enable" in
[Yy][Ee][Ss])
if [ ! -d `dirname "$exim_rejectlog"` ]
then
echo '$exim_status_mail_rejects_enable is set but' \
"`dirname "$exim_rejectlog"` doesn't exist"
rc=2
elif [ "$exim_status_mail_rejects_logs" -le 0 ]
then
echo '$exim_status_mail_rejects_enable is set but' \
'$exim_status_mail_rejects_logs is not greater than zero'
rc=2
else
echo
echo "Checking for rejected mail:"
start=`date -v-1d '+%Y-%m-%d'`
n=$(($exim_status_mail_rejects_logs - 2))
rc=$({
while [ $n -ge 0 ]
do
if [ -f "$exim_rejectlog.$n" ]
then
cat "$exim_rejectlog.$n"
elif [ -f "$exim_rejectlog.$n.gz" ]
then
zcat -fc "$exim_rejectlog.$n.gz"
elif [ -f "$exim_rejectlog.$n.bz2" ]
then
bzcat -fc "$exim_rejectlog.$n.bz2"
fi
n=$(($n - 1))
done
if [ -f "$exim_rejectlog" ]
then
cat "$exim_rejectlog"
fi
} |
grep -e "^$start" | grep -v ' : IGNORE$' | tee /dev/stderr | wc -l)
[ $rc -gt 0 ] && rc=1
fi;;
*) rc=0;;
esac
exit $rc

View File

@ -0,0 +1,48 @@
[
{ type: install
message: <<EOM
The following documentation has been installed:
man exim -> Exim options (command line)
%%DOCSDIR%%/spec.txt -> Exim Specification (User Guide)
%%DOCSDIR%%/filter.txt -> Exim Filter Specification (for end-users)
Postscript, PDF, HTML and texinfo versions of these documents can be
installed via one of the mail/exim-doc-* ports.
An online version as well as a comprehensive FAQ and a mailing list
archive is available at:
http://www.exim.org/
Descriptions of new features not available it the manual, and a listing
of all changes, including bug fixes are documented in:
%%DOCSDIR%%/NewStuff
%%DOCSDIR%%/ChangeLog
To use Exim instead of sendmail on startup:
*) Clear the sendmail queue and stop the sendmail daemon.
*) Adjust mailer.conf(5) as appropriate.
*) Set the 'sendmail_enable' rc.conf(5) variable to 'NONE'.
*) Set the 'daily_status_include_submit_mailq' and
'daily_clean_hoststat_enable' periodic.conf(5)
variables to 'NO'.
*) Consider setting 'daily_queuerun_enable' and
'daily_submit_queuerun' to "NO" in periodic.conf(5),
if you intend to manage queue runners / deliveries closely.
*) Set the 'exim_enable' rc.conf(5) variable to 'YES'.
*) Start exim with '%%PREFIX%%/etc/rc.d/exim start'.
You may also want to configure newsyslog(8) to rotate Exim log files:
%%LOGDIR%%/mainlog mailnull:mail 640 7 * @T00 ZN
%%LOGDIR%%/rejectlog mailnull:mail 640 7 * @T00 ZN
Additional scripts to help upgrading are installed in:
%%EXAMPLESDIR%%
EOM
}
]

View File

@ -0,0 +1,52 @@
[
{ type: install
message: <<EOM
The following steps will enable clamd malware scanning using exiscan ACLs.
It is important to follow them in sequence.
* Install security/clamav from the ports tree.
* Confirm that user clamav was added to the mail group in /etc/group.
* Confirm that /var/log/clamav and /var/run/clamav exist and are owned
by clamav:clamav.
* In Exim's configure file, set av_scanner=clamd:/var/run/clamav/clamd
* Adjust the exiscan ACLs in Exim's configure file. Make sure you use
the demime option with the malware check, e.g.:
deny message = This message contains malware ($malware_name)
demime = *
malware = *
* Edit clamav.conf as follows:
LogFile /var/log/clamav/clamd.log
PidFile /var/run/clamav/clamd.pid
LocalSocket /var/run/clamav/clamd
User clamav
AllowSupplementaryGroups
ScanArchive
ScanMail
You may wish to make other changes as well.
* Make sure clamd_enable="YES" has been added to /etc/rc.conf; this is
required by the clamav port's startup script,
%%RC_DIR%%/clamd%%RC_SUFX%% .
* Run freshclam.
* Add a cron job that runs freshclam --daemon-notify --quiet at least
once a day.
* Start clamd with %%RC_DIR%%/clamd%%RC_SUFX%% start .
* Start Exim with %%RC_DIR%%/exim%%RC_SUFX%% start .
Sheldon Hearn <sheldonh@FreeBSD.org>
EOM
}
]

60
mail/exim/files/exim.in Normal file
View File

@ -0,0 +1,60 @@
#!/bin/sh
# PROVIDE: mail
# REQUIRE: LOGIN
# KEYWORD: shutdown
# we make mail start late, so that things like .forward's are not
# processed until the system is fully operational
#
# Add the following lines to /etc/rc.conf to enable exim:
#
#exim_enable="YES"
#
# See exim(8) for flags
#
. /etc/rc.subr
name=exim
rcvar=exim_enable
command=%%PREFIX%%/sbin/exim
pidfile=/var/run/exim.pid
required_dirs=%%LOGDIR%%
required_files=%%PREFIX%%/etc/exim/configure
start_precmd=start_precmd
stop_postcmd=stop_postcmd
extra_commands="reload"
start_precmd()
{
case $sendmail_enable in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
warn "sendmail_enable should be set to NONE"
;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
case $sendmail_submit_enable in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
warn "sendmail_submit_enable should be set to NO"
;;
esac
;;
[Nn][Oo][Nn][Ee])
;;
esac
}
stop_postcmd()
{
rm -f $pidfile
}
# read settings, set default values
load_rc_config $name
: ${exim_enable="NO"}
: ${exim_flags="-bd -q30m"}
run_rc_command "$1"

View File

@ -0,0 +1,200 @@
--- Local/sa-exim.c.orig 2020-02-19 03:04:43 UTC
+++ Local/sa-exim.c
@@ -29,10 +29,7 @@ http://lists.merlins.org/lists/listinfo/sa-exim
#include "sa-exim.h"
/* Exim includes */
-#include "local_scan.h"
-extern FILE *smtp_out; /* Exim's incoming SMTP output file */
-extern int body_linecount; /* Line count in body */
-extern uschar *primary_hostname;
+#include <local_scan.h>
#ifdef DLOPEN_LOCAL_SCAN
@@ -409,6 +406,11 @@ int parsemlheader(char *buffer, FILE *readfh, char *he
if (buffer[strlen(buffer)-1] == '\n')
{
buffer[strlen(buffer)-1]=0;
+ /* and any carriage return */
+ if (buffer[strlen(buffer)-1] == '\r')
+ {
+ buffer[strlen(buffer)-1]=0;
+ }
}
if (SAEximDebug > 5)
{
@@ -515,6 +517,7 @@ int local_scan(volatile int fd, uschar **return_text)
int pid;
int writefd[2];
int readfd[2];
+ char *spamc_argv[10];
int i;
/* These are the only values that we want working after the longjmp
* The automatic ones can be clobbered, but we don't really care */
@@ -550,8 +553,9 @@ int local_scan(volatile int fd, uschar **return_text)
static char *SAspamcpath=SPAMC_LOCATION;
static char *SAsafemesgidchars=SAFEMESGIDCHARS
static char *SAspamcSockPath=NULL;
- static char *SAspamcPort="783";
- static char *SAspamcHost="127.0.0.1";
+ static char *SAspamcPort=NULL;
+ static char *SAspamcHost=NULL;
+ static char *SAspamcUser=NULL;
static char *SAEximRunCond="0";
static char *SAEximRejCond="1";
static int SAmaxbody=250*1024;
@@ -602,6 +606,10 @@ int local_scan(volatile int fd, uschar **return_text)
/* Do not put a %s in there, or you'll segfault */
static char *SAmsgerror="Temporary local error while processing message, please contact postmaster";
+ /* This needs to be retrieved through expand_string in order
+ not to violate the API. */
+ uschar *primary_hostname=expand_string("$primary_hostname");
+
/* New values we read from spamassassin */
char *xspamstatus=NULL;
char *xspamflag=NULL;
@@ -712,6 +720,7 @@ int local_scan(volatile int fd, uschar **return_text)
M_CHECKFORSTR(SAspamcSockPath);
M_CHECKFORSTR(SAspamcPort);
M_CHECKFORSTR(SAspamcHost);
+ M_CHECKFORSTR(SAspamcUser);
M_CHECKFORSTR(SAEximRunCond);
M_CHECKFORSTR(SAEximRejCond);
M_CHECKFORVAR(SAmaxbody, "%d");
@@ -914,6 +923,22 @@ int local_scan(volatile int fd, uschar **return_text)
ret=dup2(readfd[1],2);
CHECKERR(ret,"dup2 stderr",__LINE__);
+ i = 0;
+ spamc_argv[i++] = "spamc";
+ if (SAspamcUser && SAspamcUser[0])
+ {
+ expand=expand_string(SAspamcUser);
+ if (expand == NULL)
+ {
+ log_write(0, LOG_MAIN | LOG_PANIC, "SA: SAspamcUser expansion failure on %s, will run as Exim user instead.", SAspamcUser);
+ }
+ else if (expand[0] != '\0')
+ {
+ spamc_argv[i++] = "-u";
+ spamc_argv[i++] = expand;
+ }
+ }
+
/*
* I could implement the spamc protocol and talk to spamd directly
* instead of forking spamc, but considering the overhead spent
@@ -924,17 +949,30 @@ int local_scan(volatile int fd, uschar **return_text)
/* Ok, we cheat, spamc cares about how big the whole message is and
* we only know about the body size, so I'll give an extra 16K
* to account for any headers that can accompany the message */
+
+ spamc_argv[i++] = "-s";
+ spamc_argv[i++] = string_sprintf("%d", SAmaxbody+16384);
+
if(SAspamcSockPath)
{
- ret=execl(SAspamcpath, "spamc", "-s", string_sprintf("%d", SAmaxbody+16384), "-U", SAspamcSockPath, NULL);
- CHECKERR(ret,string_sprintf("exec %s", SAspamcpath),__LINE__);
+ spamc_argv[i++] = "-U";
+ spamc_argv[i++] = SAspamcSockPath;
}
else
{
- ret=execl(SAspamcpath, "spamc", "-s", string_sprintf("%d", SAmaxbody+16384), "-d", SAspamcHost, "-p", SAspamcPort, NULL);
- CHECKERR(ret,string_sprintf("exec %s", SAspamcpath),__LINE__);
+ if (SAspamcHost) {
+ spamc_argv[i++] = "-d";
+ spamc_argv[i++] = SAspamcHost;
+ }
+ if (SAspamcPort) {
+ spamc_argv[i++] = "-p";
+ spamc_argv[i++] = SAspamcPort;
+ }
}
-
+ spamc_argv[i++] = NULL;
+
+ ret=execv(SAspamcpath, spamc_argv);
+ CHECKERR(ret,string_sprintf("exec %s", SAspamcpath),__LINE__);
}
if (SAEximDebug > 8)
@@ -1045,6 +1083,11 @@ int local_scan(volatile int fd, uschar **return_text)
if (buffer[strlen(buffer)-1] == '\n')
{
buffer[strlen(buffer)-1]=0;
+ /* and any carriage return */
+ if (buffer[strlen(buffer)-1] == '\r')
+ {
+ buffer[strlen(buffer)-1]=0;
+ }
}
restart:
if (SAEximDebug > 5)
@@ -1218,7 +1261,7 @@ restart:
}
stret=write(fd, buffer, strlen(buffer));
- CHECKERR(stret,string_sprintf("SA body write to msg"),__LINE__);
+ CHECKERR(stret,string_sprintf("%s", "SA body write to msg"),__LINE__);
if (SAEximDebug > 8)
{
log_write(0, LOG_MAIN, "SA: Debug9: Wrote to msg; line %d (wrote %d)", line, ret);
@@ -1229,18 +1272,20 @@ restart:
}
}
+
if (SAEximDebug > 1)
{
log_write(0, LOG_MAIN, "SA: Debug2: body_linecount before SA: %d", body_linecount);
}
/* update global variable $body_linecount to reflect the new body size*/
- body_linecount = (line - 1);
+ if (body_linecount > 0) body_linecount = (line - 1); // Not updating if zero, indicating spool_wireformat
if (SAEximDebug > 1)
{
log_write(0, LOG_MAIN, "SA: Debug2: body_linecount after SA: %d", body_linecount);
}
+
}
fclose((FILE *)readfh);
@@ -1331,6 +1376,9 @@ restart:
if (dorej && doteergrube)
{
+ char *teergrubewaitstr;
+ teergrubewaitstr=string_sprintf(SAmsgteergrubewait, spamstatus);
+
/* By default, we'll only save temp bounces by message ID so
* that when the same message is submitted several times, we
* overwrite the same file on disk and not create a brand new
@@ -1353,20 +1401,8 @@ restart:
for (i=0;i<SAteergrubetime/10;i++)
{
- char *str;
-
- /* Unfortunately, we can't use exim's smtp_printf because it
- * doesn't return an error code if the write gets an EPIPE.
- * So, we write ourselves, but this won't work if you have a
- * TLS connection opened (that said, if you are teergrubing
- * a TLS connection, it's probably a relay host, not a
- * spammer, and in this case you should not teergrube a
- * friendly relay, so basically we should be ok).
- * If you do teergrube an SSL connection with the current
- * code, you will break it, but that's acceptable */
- str=string_sprintf(string_sprintf("451- %s\r\n",SAmsgteergrubewait), spamstatus);
- fprintf(smtp_out, str);
- ret=fflush(smtp_out);
+ smtp_printf("451-%s\r\n", FALSE, teergrubewaitstr);
+ ret=smtp_fflush();
if (ret != 0)
{
log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: teergrubed sender for %d secs until it closed the connection: %s (scanned in %d/%d secs | Message-Id: %s). %s", i*10, spamstatus, scantime, fulltime, safemesgid, mailinfo);

View File

@ -0,0 +1,24 @@
--- Local/sa-exim.conf.orig 2005-03-08 20:35:43 UTC
+++ Local/sa-exim.conf
@@ -49,11 +49,17 @@ SAspamcpath: /usr/bin/spamc
# you set it, it will override the two TCP connect options below
#SAspamcSockPath: /var/run/spamd.sock
-# SAspamcHost / SAspamcPort: TCP socket where your spamd is listening
-# Shown below are the defaults:
-SAspamcHost: 127.0.0.1
-SAspamcPort: 783
+# SAspamcHost / SAspamcPort: TCP socket where your spamd is listening.
+# Default is to let spamc use any settings in spamc.conf.
+#SAspamcHost: 127.0.0.1
+#SAspamcPort: 783
+# SAspamcUser: The username passed to spamc. Some tricks are needed to
+# decide on one user when there are many recipients. This string is of
+# course expanded. If unset or empty, spamc will use the user Exim
+# runs as. We suggest that you decide what username to use in the ACLs
+# and set an ACL variable.
+#SAspamcUser: $acl_m2
# Exim configuration string to run before running SA against the message
# This decides whether SA gets run against the message or not. This

View File

@ -0,0 +1,11 @@
--- Makefile.orig 2014-07-05 18:05:16.180788015 +0100
+++ Makefile 2014-07-05 18:05:40.464360574 +0100
@@ -53,7 +53,7 @@
# Configure-Makefile script. This does its own dependency checking because of
# the optional files.
-configure: checks build-directory
+configure: build-directory
@cd build-$(buildname); \
build=$(build) $(SHELL) ../scripts/Configure-Makefile

View File

@ -0,0 +1,13 @@
--- OS/Makefile-FreeBSD.orig 2023-04-09 09:45:04.226201000 +0200
+++ OS/Makefile-FreeBSD 2023-04-09 09:48:01.819463000 +0200
@@ -18,8 +18,8 @@
# Dynamically loaded modules need to be built with -fPIC
CFLAGS_DYNAMIC=-shared -rdynamic -fPIC
-# FreeBSD always ships with Berkeley DB
-USE_DB=yes
+# FreeBSD ships with Berkeley DB until 13.1, but ndbm is always included
+USE_NDBM=yes
# This code for building outside ports suggested by Richard Clayton
.ifdef X11BASE

View File

@ -0,0 +1,11 @@
--- exim_monitor/em_hdr.h.orig 2019-12-08 12:53:48 UTC
+++ exim_monitor/em_hdr.h
@@ -95,6 +95,8 @@ this interface so that this kind of kludge isn't neede
#endif
typedef void hctx;
+typedef unsigned long ulong;
+
#include "local_scan.h"
#include "macros.h"
#include "structs.h"

View File

@ -0,0 +1,32 @@
--- src/smtp_in.c.orig 2017-03-08 16:31:57.587957000 +0000
+++ src/smtp_in.c 2017-03-08 16:43:44.934346000 +0000
@@ -2246,6 +2246,9 @@
#ifdef USE_TCP_WRAPPERS
struct request_info tcpwrap_ri;
#endif
+#ifdef USE_TCP_WRAPPERS
+struct request_info tcpwrap_ri;
+#endif
smtp_connection_start = time(NULL);
for (smtp_ch_index = 0; smtp_ch_index < SMTP_HBUFF_SIZE; smtp_ch_index++)
@@ -2602,11 +2605,14 @@
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Expansion of \"%s\" "
"(tcp_wrappers_name) failed: %s", string_printing(tcp_wrappers_name),
expand_string_message);
-
- if (!hosts_ctl(tcp_wrappers_name,
- sender_host_name ? CS sender_host_name : STRING_UNKNOWN,
- sender_host_address ? CS sender_host_address : STRING_UNKNOWN,
- sender_ident ? CS sender_ident : STRING_UNKNOWN))
+ request_init(&tcpwrap_ri,
+ RQ_DAEMON, tcp_wrappers_name,
+ RQ_FILE, fileno(smtp_out),
+ RQ_CLIENT_NAME, (sender_host_name == NULL)? STRING_UNKNOWN : CS sender_host_name,
+ RQ_CLIENT_ADDR, (sender_host_address == NULL)? STRING_UNKNOWN : CS sender_host_address,
+ RQ_USER, (sender_ident == NULL)? STRING_UNKNOWN : CS sender_ident,
+ 0);
+ if (!hosts_access(&tcpwrap_ri))
{
if (errno == 0 || errno == ENOENT)
{

View File

@ -0,0 +1,111 @@
--- scripts/exim_install.orig 2016-12-18 14:02:28.000000000 +0000
+++ scripts/exim_install 2017-01-02 11:48:46.939703000 +0000
@@ -29,6 +29,7 @@
do_chown=yes
do_symlink=yes
+do_info=yes
while [ $# -gt 0 ] ; do
case "$1" in
@@ -51,6 +52,10 @@
do_symlink=no
;;
+ -no_info)
+ do_info=no
+ ;;
+
*)
break
;;
@@ -117,9 +122,7 @@
CONFIGURE_FILE=${DESTDIR}${CONFIGURE_FILE}
SYSTEM_ALIASES_FILE=${DESTDIR}${SYSTEM_ALIASES_FILE}
-if [ "${INFO_DIRECTORY}" != "" ] ; then
- INFO_DIRECTORY=${DESTDIR}${INFO_DIRECTORY}
-fi
+INFO_DIRECTORY=${DESTDIR}${INFO_DIRECTORY}
# Overrides of other things
case "$inst_uid" in ?*) INST_UID="$inst_uid";; esac
@@ -218,8 +221,7 @@
if [ $name = exim${EXE} ]; then
exim="./exim -bV -C /dev/null"
- version=exim-`$exim 2>/dev/null | \
- awk '/Exim version/ { OFS=""; print $3,"-",substr($4,2,length($4)-1) }'`${EXE}
+ version=exim
if [ "${version}" = "exim-${EXE}" ]; then
echo $com ""
@@ -384,9 +386,8 @@
echo $com ' ' ${CONFIGURE_FILE}
echo $com Therefore, skipping automatic installation.
-elif [ ! -f ${CONFIGURE_FILE} ]; then
- echo $com Installing default configuration in ${CONFIGURE_FILE}
- echo $com because there is no existing configuration file.
+else
+ echo $com Installing default configuration in ${CONFIGURE_FILE}.sample
if [ "${SYSTEM_ALIASES_FILE}" = "" ] ; then
SYSTEM_ALIASES_FILE=/etc/aliases
echo $com This configuration has system aliases in ${SYSTEM_ALIASES_FILE}.
@@ -396,8 +397,8 @@
${real} ${MKDIR} -p `${DIRNAME} ${CONFIGURE_FILE}`
echo sed -e '\\'
- echo " \"/SYSTEM_ALIASES_FILE/ s'SYSTEM_ALIASES_FILE'${ACTUAL_SYSTEM_ALIASES_FILE}'\"" '\\'
- echo " ../src/configure.default > \${CONFIGURE_FILE}"
+ echo " \"/SYSTEM_ALIASES_FILE/ s'SYSTEM_ALIASES_FILE'/etc/aliases'\"" '\\'
+ echo " ../src/configure.default > \${CONFIGURE_FILE}.sample"
# I can't find a way of writing this using the ${real} feature because
# it seems that the output redirection always happens, even when -n was
@@ -405,8 +406,8 @@
if [ "$real" = "" ] ; then
sed -e \
- "/SYSTEM_ALIASES_FILE/ s'SYSTEM_ALIASES_FILE'${ACTUAL_SYSTEM_ALIASES_FILE}'" \
- ../src/configure.default > ${CONFIGURE_FILE}
+ "/SYSTEM_ALIASES_FILE/ s'SYSTEM_ALIASES_FILE'/etc/aliases'" \
+ ../src/configure.default > ${CONFIGURE_FILE}.sample
else
true
fi
@@ -416,24 +417,22 @@
echo $com "*** Exim installation ${ver}failed ***"
exit 1
fi
- if [ ! -f ${SYSTEM_ALIASES_FILE} ]; then
- echo $com '****'
- echo $com Installing a dummy ${SYSTEM_ALIASES_FILE} file because you do not have
- echo $com one, and the default configuration requires it. You should
- echo $com edit ${SYSTEM_ALIASES_FILE} and at least create an alias for postmaster.
- echo $com '***'
- echo ${CP} ../src/aliases.default ${SYSTEM_ALIASES_FILE}
- ${real} ${CP} ../src/aliases.default ${SYSTEM_ALIASES_FILE}
- fi
+# if [ ! -f ${SYSTEM_ALIASES_FILE} ]; then
+# echo $com '****'
+# echo $com Installing a dummy ${SYSTEM_ALIASES_FILE} file because you do not have
+# echo $com one, and the default configuration requires it. You should
+# echo $com edit ${SYSTEM_ALIASES_FILE} and at least create an alias for postmaster.
+# echo $com '***'
+# echo ${CP} ../src/aliases.default ${SYSTEM_ALIASES_FILE}
+# ${real} ${CP} ../src/aliases.default ${SYSTEM_ALIASES_FILE}
+# fi
-else
- echo $com Configuration file ${CONFIGURE_FILE} already exists
fi
# Install info files if the directory is defined and the Texinfo
# source documentation is present.
-if [ "${INFO_DIRECTORY}" != "" -a -f ../doc/spec.texinfo ] ; then
+if [ "$do_info" != "no" -a -f ../doc/spec.texinfo ] ; then
echo $com ""
if [ ! -d "${INFO_DIRECTORY}" ] ; then
echo mkdir -p ${INFO_DIRECTORY}

View File

@ -0,0 +1,92 @@
--- src/auths/call_radius.c.orig 2020-05-30 22:35:38.000000000 +0200
+++ src/auths/call_radius.c 2020-06-01 19:54:14.402105000 +0200
@@ -113,37 +113,37 @@
#ifdef RADIUS_LIB_RADIUSCLIENT
if (rc_read_config(RADIUS_CONFIG_FILE) != 0)
- *errptr = string_sprintf("RADIUS: can't open %s", RADIUS_CONFIG_FILE);
+ *errptr = string_sprintf("%s", "RADIUS: can't open %s", RADIUS_CONFIG_FILE);
else if (rc_read_dictionary(rc_conf_str("dictionary")) != 0)
- *errptr = US"RADIUS: can't read dictionary";
+ *errptr = string_sprintf("%s", "RADIUS: can't read dictionary");
else if (!rc_avpair_add(&send, PW_USER_NAME, user, 0))
- *errptr = US"RADIUS: add user name failed";
+ *errptr = string_sprintf("%s", "RADIUS: add user name failed\n");
else if (!rc_avpair_add(&send, PW_USER_PASSWORD, CS radius_args, 0))
- *errptr = US"RADIUS: add password failed");
+ *errptr = string_sprintf("%s", "RADIUS: add password failed\n");
else if (!rc_avpair_add(&send, PW_SERVICE_TYPE, &service, 0))
- *errptr = US"RADIUS: add service type failed";
+ *errptr = string_sprintf("%s", "RADIUS: add service type failed\n");
#else /* RADIUS_LIB_RADIUSCLIENT unset => RADIUS_LIB_RADIUSCLIENT2 */
if (!(h = rc_read_config(RADIUS_CONFIG_FILE)))
- *errptr = string_sprintf("RADIUS: can't open %s", RADIUS_CONFIG_FILE);
+ *errptr = string_sprintf("%s", "RADIUS: can't open %s", RADIUS_CONFIG_FILE);
else if (rc_read_dictionary(h, rc_conf_str(h, "dictionary")) != 0)
- *errptr = US"RADIUS: can't read dictionary";
+ *errptr = string_sprintf("%s", "RADIUS: can't read dictionary");
else if (!rc_avpair_add(h, &send, PW_USER_NAME, user, Ustrlen(user), 0))
- *errptr = US"RADIUS: add user name failed";
+ *errptr = string_sprintf("%s", "RADIUS: add user name failed\n");
else if (!rc_avpair_add(h, &send, PW_USER_PASSWORD, CS radius_args,
Ustrlen(radius_args), 0))
- *errptr = US"RADIUS: add password failed";
+ *errptr = string_sprintf("%s", "RADIUS: add password failed\n");
else if (!rc_avpair_add(h, &send, PW_SERVICE_TYPE, &service, 0, 0))
- *errptr = US"RADIUS: add service type failed";
+ *errptr = string_sprintf("%s", "RADIUS: add service type failed\n");
#endif /* RADIUS_LIB_RADIUSCLIENT */
@@ -176,7 +176,7 @@
case BADRESP_RC:
default:
- *errptr = string_sprintf("RADIUS: unexpected response (%d)", result);
+ *errptr = string_sprintf("%s", "RADIUS: unexpected response (%d)", result);
return ERROR;
}
@@ -186,7 +186,7 @@
if (!(h = rad_auth_open()))
{
- *errptr = string_sprintf("RADIUS: can't initialise libradius");
+ *errptr = string_sprintf("%s", "RADIUS: can't initialise libradius");
return ERROR;
}
if (rad_config(h, RADIUS_CONFIG_FILE) != 0 ||
@@ -196,7 +196,7 @@
rad_put_int(h, RAD_SERVICE_TYPE, RAD_AUTHENTICATE_ONLY) != 0 ||
rad_put_string(h, RAD_NAS_IDENTIFIER, CS primary_hostname) != 0)
{
- *errptr = string_sprintf("RADIUS: %s", rad_strerror(h));
+ *errptr = string_sprintf("%s", "RADIUS: %s", rad_strerror(h));
result = ERROR;
}
else
@@ -211,12 +211,12 @@
break;
case -1:
- *errptr = string_sprintf("RADIUS: %s", rad_strerror(h));
+ *errptr = string_sprintf("%s", "RADIUS: %s", rad_strerror(h));
result = ERROR;
break;
default:
- *errptr = string_sprintf("RADIUS: unexpected response (%d)", result);
+ *errptr = string_sprintf("%s", "RADIUS: unexpected response (%d)", result);
result= ERROR;
break;
}

View File

@ -0,0 +1,10 @@
--- src/lookups/mysql.c.orig 2017-03-05 00:21:35.000000000 +0300
+++ src/lookups/mysql.c 2017-08-15 01:12:26.508519000 +0300
@@ -13,6 +13,7 @@
#include "lf_functions.h"
#include <mysql.h> /* The system header */
+#include <mysql_version.h>
/* Structure and anchor for caching connections. */

View File

@ -0,0 +1,146 @@
--- src/EDITME.orig 2021-09-28 10:24:46.000000000 +0200
+++ src/EDITME 2021-09-29 19:38:22.776161000 +0200
@@ -99,7 +99,7 @@
# /usr/local/sbin. The installation script will try to create this directory,
# and any superior directories, if they do not exist.
-BIN_DIRECTORY=/usr/exim/bin
+BIN_DIRECTORY=XX_PREFIX_XX/sbin
#------------------------------------------------------------------------------
@@ -115,7 +115,7 @@
# don't exist. It will also install a default runtime configuration if this
# file does not exist.
-CONFIGURE_FILE=/usr/exim/configure
+CONFIGURE_FILE=XX_CONFIG_FILE_PATH_XX
# It is possible to specify a colon-separated list of files for CONFIGURE_FILE.
# In this case, Exim will use the first of them that exists when it is run.
@@ -132,7 +132,7 @@
# deliveries. (Local deliveries run as various non-root users, typically as the
# owner of a local mailbox.) Specifying these values as root is not supported.
-EXIM_USER=
+EXIM_USER=ref:XX_EXIM_USER_XX
# If you specify EXIM_USER as a name, this is looked up at build time, and the
# uid number is built into the binary. However, you can specify that this
@@ -153,7 +153,7 @@
# for EXIM_USER (e.g. EXIM_USER=exim), you don't need to set EXIM_GROUP unless
# you want to use a group other than the default group for the given user.
-# EXIM_GROUP=
+EXIM_GROUP=ref:XX_EXIM_GROUP_XX
# Many sites define a user called "exim", with an appropriate default group,
# and use
@@ -451,6 +451,7 @@
# LDAP_LIB_TYPE=OPENLDAP2
# LDAP_LIB_TYPE=NETSCAPE
# LDAP_LIB_TYPE=SOLARIS
+LDAP_LIB_TYPE=XX_LDAP_TYPE_XX
# If you don't set any of these, Exim assumes the original University of
# Michigan (OpenLDAP 1) library.
@@ -491,9 +492,10 @@
#
# You do not need to use this for any lookup information added via pkg-config.
-# LOOKUP_INCLUDE=-I /usr/local/ldap/include -I /usr/local/mysql/include -I /usr/local/pgsql/include
-# LOOKUP_INCLUDE +=-I /usr/local/include
-# LOOKUP_LIBS=-L/usr/local/lib -lldap -llber -lmysqlclient -lpq -lgds -lsqlite3 -llmdb
+INCLUDE=-IXX_LOCALBASE_XX/include XX_DB_INCLUDES_XX XX_LMDB_INCLUDES_XX
+LOOKUP_INCLUDE=XX_MYSQL_INCLUDE_XX XX_PGSQL_INCLUDE_XX XX_LDAP_INCLUDE_XX
+LOOKUP_LIBS=XX_MYSQL_LIBS_XX XX_PGSQL_LIBS_XX XX_LDAP_LIBS_XX XX_LMDB_LIBS_XX
+DBMLIB=XX_DB_LIBS_XX
#------------------------------------------------------------------------------
@@ -633,6 +635,7 @@
# Uncomment the following line to add queuefile transport support
# EXPERIMENTAL_QUEUEFILE=yes
+# EXPERIMENTAL_DCC=yes
###############################################################################
# THESE ARE THINGS YOU MIGHT WANT TO SPECIFY #
###############################################################################
@@ -700,6 +703,7 @@
# ALT_CONFIG_PREFIX=/some/directory/
# ALT_CONFIG_PREFIX=/some/directory/exim.conf-
+ALT_CONFIG_PREFIX=XX_ALT_CONFIG_PREFIX_XX
#------------------------------------------------------------------------------
@@ -802,7 +806,7 @@
# one that is set in the headers_charset option. The default setting is
# defined by this setting:
-HEADERS_CHARSET="ISO-8859-1"
+HEADERS_CHARSET="XX_DEFAULT_CHARSET_XX"
# If you are going to make use of $header_xxx expansions in your configuration
# file, or if your users are going to use them in filter files, and the normal
@@ -898,7 +902,7 @@
# Once you have done this, "make install" will build the info files and
# install them in the directory you have defined.
-# INFO_DIRECTORY=/usr/share/info
+INFO_DIRECTORY=XX_PREFIX_XX/share/info
#------------------------------------------------------------------------------
@@ -911,7 +915,7 @@
# %s. This will be replaced by one of the strings "main", "panic", or "reject"
# to form the final file names. Some installations may want something like this:
-# LOG_FILE_PATH=/var/log/exim_%slog
+LOG_FILE_PATH=XX_LOG_FILE_PATH_XX
# which results in files with names /var/log/exim_mainlog, etc. The directory
# in which the log files are placed must exist; Exim does not try to create
@@ -993,7 +997,7 @@
# that the local_scan API is made available by the linker. You may also need
# to add -ldl to EXTRALIBS so that dlopen() is available to Exim.
-# EXPAND_DLFUNC=yes
+EXPAND_DLFUNC=yes
#------------------------------------------------------------------------------
@@ -1130,6 +1134,8 @@
#
# but of course there may need to be other things in CFLAGS and EXTRALIBS_EXIM
# as well.
+CFLAGS=XX_CFLAGS_XX XX_SPF_FLAGS_XX XX_SRS_FLAGS_XX XX_SQLITE_FLAGS_XX
+EXTRALIBS=XX_TCP_WRAPPERS_LIBS_XX XX_PAM_LIBS_XX XX_ICONV_LIBS_XX XX_SPF_LIBS_XX XX_SRS_LIBS_XX XX_RADIUS_LIBS_XX XX_SQLITE_LIBS_XX XX_DMARC_LIBS_XX XX_REDIS_LIBS_XX XX_DYNAMIC_LDFLAGS_XX XX_IDN_LIBS_XX
#
# To use a name other than exim in the tcpwrappers config file,
# e.g. if you're running multiple daemons with different access lists,
@@ -1138,7 +1144,15 @@
#
# TCP_WRAPPERS_DAEMON_NAME="exim"
+# IPv6 is coming. Exim has experimental support that has been tried out on
+# one or two OS. See the file README.IPV6 for the current status of this
+# support. Do not set this option unless you are working on IPv6 and know
+# what you are doing.
+# HAVE_IPV6=YES
+
+
+
#------------------------------------------------------------------------------
# The default action of the exim_install script (which is run by "make
# install") is to install the Exim binary with a unique name such as
@@ -1424,7 +1438,7 @@
# (process id) to a file so that it can easily be identified. The path of the
# file can be specified here. Some installations may want something like this:
-# PID_FILE_PATH=/var/lock/exim.pid
+PID_FILE_PATH=/var/run/exim.pid
# If PID_FILE_PATH is not defined, Exim writes a file in its spool directory
# using the name "exim-daemon.pid".

View File

@ -0,0 +1,42 @@
--- src/configure.default.orig Wed May 5 12:08:35 2004
+++ src/configure.default Wed May 5 15:09:40 2004
@@ -153,6 +153,8 @@
# as if it were a normal user. This isn't usually a problem, as most sites have
# an alias for root that redirects such mail to a human administrator.
+exim_user = XX_EXIM_USER_XX
+exim_group = XX_EXIM_GROUP_XX
never_users = root
@@ -412,7 +414,8 @@
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{SYSTEM_ALIASES_FILE}}
-# user = exim
+ user = XX_EXIM_USER_XX
+ group = XX_EXIM_GROUP_XX
file_transport = address_file
pipe_transport = address_pipe
@@ -454,6 +457,7 @@
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
+ condition = ${if exists{$home/.forward} {yes} {no} }
# This router matches local user mailboxes. If the router fails, the error
@@ -506,8 +510,10 @@
delivery_date_add
envelope_to_add
return_path_add
-# group = mail
-# mode = 0660
+ group = XX_EXIM_GROUP_XX
+ user = $local_part
+ mode = 0660
+ no_mode_fail_narrower
# This transport is used for handling pipe deliveries generated by alias or

View File

@ -0,0 +1,20 @@
--- src/exim.h.orig 2017-02-14 19:13:41.381402389 +0200
+++ src/exim.h 2017-02-14 19:13:53.330916377 +0200
@@ -129,7 +129,6 @@
#endif
#include <sys/types.h>
-#include <sys/file.h>
#include <dirent.h>
#include <netdb.h>
#ifndef NO_POLL_H
--- src/exim_lock.c.orig 2017-02-14 19:21:09.709389008 +0200
+++ src/exim_lock.c 2017-02-14 19:21:23.994407794 +0200
@@ -27,7 +27,6 @@
#include <utime.h>
#include <sys/utsname.h>
#include <sys/stat.h>
-#include <sys/file.h>
#include <pwd.h>
/* Not all systems have flock() available. Those that do must define LOCK_SH