Package: exim4-base
Version: 4.98.2-1+deb13u5
Severity: normal

Dear Maintainer,

The `eximstats` perl script blindly copies through exim log lines to the
output, e.g. in the section "Top 50 mail rejection reasons by message
count", when these can comprise lines too long for exim itself to accept
in an email.  This results in the daily report generated by
`/etc/cron.daily/exim4-base` being dropped with reason "message has
lines too long for transport".

  Either eximstats itself should (have an option to?) trim, or wrap,
overly long lines, or the cron job should perform this step before
handing the resulting output to `mail`.

  The inciting log lines in this case look to be a bad actor's scripting
attempting to stuff an entire email message into a header.  e.g. this
example, which I've allowed my text editor to wrap, and also truncated
after sufficient example text.

---------------------------------------------------------------------
1   Header syntax (malformed address: @KGBMytL1sesfQUQuCVaG.email.gmx.
may not follow "[ [email protected] ]@gmail.com
brkxsehyklxzlecuvqhujkihphttmnjqoabuoockmvvgqscsobilsvhniananaekefilfsrfendiyjwkletzvjbjujhvxluvxyleqkbmmxhyhryfnoxerwmnbpscfkomglhrcdryvoxoyjohdvfobtlribpfzwlbkphdkkjlfbeadd
<strong>Lo p\303\272blico y lo privado</strong><br/><em>Homenaje a la
obra del Dr. Alfredo Morles Hern\303\241ndez: De lo privado a lo
p\303\272blico en el Derecho Mercantil, en El Derecho P\303\272blico a
los 100 n\303\272meros de la Revista de Derecho P\303\272blico
1980-2005. []Caracas, Editorial Jur\303\255dica Venezolana,
---------------------------------------------------------------------

The full line is 8031 characters, and ends:

        **** log string overflowed log buffer ****

-- Package-specific info:
Exim version 4.98.2 #2 built 25-Sep-2026 09:25:38
Copyright (c) University of Cambridge, 1995 - 2018
(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 - 2024
Hints DB:
 Berkeley DB: Berkeley DB 5.3.28: (September  9, 2013)
Support for: Content_Scanning crypteq Expand_dlfunc iconv() IPv6 PAM Perl 
GnuTLS move_frozen_messages TLS_resume DANE DKIM DNSSEC ESMTP_Limits 
ESMTP_Wellknown Event I18N OCSP PIPECONNECT PRDR PROXY Queue_Ramp SOCKS SPF SRS 
TCP_Fast_Open
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz 
dbmnz dnsdb dsearch ldap ldapdn ldapm mysql nis nis0 passwd pgsql sqlite
Authenticators: cram_md5 cyrus_sasl dovecot external plaintext spa tls
Routers: accept dnslookup ipliteral iplookup manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore/mbx autoreply lmtp pipe smtp
Malware: f-protd f-prot6d drweb fsecure sophie clamd avast sock cmdline
Fixed never_users: 0
Configure owner: 0:0
Size of off_t: 8
Configuration file search path is 
/etc/exim4/exim4.conf:/var/lib/exim4/config.autogenerated
Configuration file is /etc/exim4/exim4.conf
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file

dc_eximconfig_configtype='none'
dc_other_hostnames='"fysh.org:dbm;/etc/exim/domains.db"'
dc_local_interfaces=''
dc_readhost=''
dc_relay_domains='"dbm;/etc/exim/relays.db"'
dc_minimaldns='false'
dc_relay_nets='"dbm;/etc/exim/relayfrom.db"'
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
mailname:fysh.org
# /etc/default/exim4
EX4DEF_VERSION=''

# how often should we run the queue
# `EXIMSERVICE` is the systemd way since 13/trixie
EXIMSERVICE='-bdf -q5m'
# `EXIMDAEMONOPTS` would be the initscript way

-- System Information:
Debian Release: 13.7
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.18.62-fysh-kvmguest (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages exim4-base depends on:
ii  adduser                        3.152
ii  cron [cron-daemon]             3.0pl1-197
ii  debconf [debconf-2.0]          1.5.91
ii  exim4-config [exim4-config-2]  4.98.2-1+deb13u5
ii  libc6                          2.41-12+deb13u4
ii  libdb5.3t64                    5.3.28+dfsg2-9
ii  libfile-fcntllock-perl         0.22-4+b4
ii  netbase                        6.5
ii  perl                           5.40.1-6+deb13u1
ii  systemd-sysv                   257.13-1~deb13u1

Versions of packages exim4-base recommends:
ii  bsd-mailx [mailx]  8.1.2-0.20220412cvs-1.1
ii  psmisc             23.7-2

Versions of packages exim4-base suggests:
ii  bsd-mailx [mail-reader]          8.1.2-0.20220412cvs-1.1
ii  emacs-gtk [mail-reader]          1:30.1+1-6+deb13u1
pn  exim4-doc-html | exim4-doc-info  <none>
pn  eximon4                          <none>
ii  file                             1:5.46-5
ii  gnutls-bin                       3.8.9-3+deb13u4
ii  jed [mail-reader]                1:0.99.20~pre.189+dfsg-1
ii  mutt [mail-reader]               2.2.13-1+deb13u2
ii  neomutt [mail-reader]            20250510+dfsg-2
ii  nmh [mail-reader]                1.8-3
ii  openssl                          3.5.7-1~deb13u3
ii  spf-tools-perl                   3.20250505-1
ii  swaks                            20240103.0-2
ii  wl [mail-reader]                 2.15.9+0.20210131-2

-- Configuration Files:
/etc/cron.daily/exim4-base changed:
EX4SYSTEMDTIMER=$1
if [ -d /run/systemd/system ] && [ "$EX4SYSTEMDTIMER" != "systemd-timer" ]; then
            exit 0
fi
if [ -n "$EX4DEBUG" ]; then
  echo "now debugging $0 $@"
  set -x
fi
E4BCD_DAILY_REPORT_TO="[email protected]"
E4BCD_DAILY_REPORT_OPTIONS=""
E4BCD_WATCH_PANICLOG="yes"
E4BCD_PANICLOG_LINES="10"
E4BCD_PANICLOG_NOISE=""
E4BCD_PANICLOG_REPORT_TO=root
if [ ! -x /usr/lib/exim4/exim4 ]; then
  exit 0
fi
[ -f /etc/default/exim4 ] && . /etc/default/exim4
SPOOLDIR="$(exim4 -bP spool_directory | sed 's/.*=[[:space:]]\(.*\)/\1/')"
if [ -n "$E4BCD_DAILY_REPORT_TO" ] || [ "$E4BCD_WATCH_PANICLOG" != "no" ] ; then
        # Only needed for mail subject.
        if ! HOSTNAME=$(/usr/sbin/exim4 -be '${primary_hostname}'); then
                HOSTNAME="$(hostname)"
        fi
fi
E4BCD_MAINLOG_NOISE="^[[:digit:][:space:]:-]\{20\}\(\(Start\|End\) queue run: 
pid=[[:digit:]]\+\|exim [[:digit:]\.]\+ daemon started: pid=[[:digit:]]\+, 
.*\)$"
if [ -n "$E4BCD_DAILY_REPORT_TO" ]; then
  if [ -x "$(command -v eximstats)" ] && [ -x "$(command -v mail)" ]; then
    if [ "$(< /var/log/exim4/mainlog grep -v "$E4BCD_MAINLOG_NOISE" | wc -l)" 
-gt "0" ]; then
      < /var/log/exim4/mainlog grep -v "$E4BCD_MAINLOG_NOISE" \
                | eximstats $E4BCD_DAILY_REPORT_OPTIONS \
                | mail -s"${HOSTNAME} Daily e-mail activity report" \
                    $E4BCD_DAILY_REPORT_TO
    else
      echo "no mail activity in this interval" \
                | mail -s"${HOSTNAME} Daily e-mail activity report" \
                    $E4BCD_DAILY_REPORT_TO
    fi
  else
    echo "The exim4 cron job is configured to send a daily report, but 
eximstats"
    echo "and/or mail cannot be found. Please check and make sure that these 
two"
    echo "binaries are available"
  fi
fi
log_this() {
  TEXT="$@"
  if ! logger -t exim4 -p mail.alert $TEXT; then
    RET="$?"
    echo >&2 "ALERT: could not syslog $TEXT, logger return value $RET"
  fi
}
if [ "$E4BCD_WATCH_PANICLOG" != "no" ]; then
  if [ -s "/var/log/exim4/paniclog" ]; then
    if [ -x "/usr/local/lib/exim4/nonzero_paniclog_hook" ]; then
      /usr/local/lib/exim4/nonzero_paniclog_hook
    fi
    if [ -z "$E4BCD_PANICLOG_NOISE" ] || grep -vq "$E4BCD_PANICLOG_NOISE" 
/var/log/exim4/paniclog; then
      log_this "ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, 
mail system possibly broken"
      if ! printf "Subject: exim paniclog on %s has non-zero size\nTo: 
%s\n\nexim paniclog /var/log/exim4/paniclog on %s has non-zero size, mail 
system might be broken. Up to ${E4BCD_PANICLOG_LINES} lines are quoted 
below.\n\n%s\n" \
      "${HOSTNAME}" "${E4BCD_PANICLOG_REPORT_TO}" "${HOSTNAME}" \
      "$(if [ -z "$E4BCD_PANICLOG_NOISE" ] ; then tail -n 
"${E4BCD_PANICLOG_LINES}" /var/log/exim4/paniclog ; else grep -v 
"$E4BCD_PANICLOG_NOISE" /var/log/exim4/paniclog | tail -n 
"${E4BCD_PANICLOG_LINES}" ; fi)" \
      | exim4 "${E4BCD_PANICLOG_REPORT_TO}"; then
        log_this "PANIC: sending out e-mail warning has failed, exim has 
non-zero return code"
      fi
      if [ "$E4BCD_WATCH_PANICLOG" = "once" ]; then
        logrotate -f /etc/logrotate.d/exim4-paniclog
      fi
    fi
  fi
fi
if [ -x /usr/sbin/exim_tidydb ]; then
  cd $SPOOLDIR/db || exit 1
  if ! find $SPOOLDIR/db -maxdepth 1 -name '*.lockfile' -or -name 'log.*' \
    -or -type f -printf '%f\0' | \
      xargs -0r -n 1 \
      start-stop-daemon --start --exec /usr/sbin/exim_tidydb \
      --chuid Debian-exim:Debian-exim -- $SPOOLDIR > /dev/null; then
    # if we reach this, invoking exim_tidydb from start-stop-daemon has
    # failed, most probably because of libpam-tmpdir being in use
    # (see #373786 and #376165)
    find $SPOOLDIR/db -maxdepth 1 -name '*.lockfile' -or -name 'log.*' \
    -or -type f -printf '%f\0' | \
    runuser --shell=/bin/bash \
         --command="xargs -0r -n 1 /usr/sbin/exim_tidydb $SPOOLDIR > /dev/null" 
\
         Debian-exim
  fi
fi

/etc/init.d/exim4 [Errno 13] Permission denied: '/etc/init.d/exim4'
/etc/logrotate.d/exim4-base changed:
/var/log/exim4/mainlog /var/log/exim4/rejectlog {
        daily
        missingok
        rotate 31
        compress
        delaycompress
        notifempty
        nocreate
        sharedscripts
        postrotate
                /etc/scripts/exim-report-outbound-rejects 
/var/log/exim4/mainlog.1
        endscript
}

/etc/logrotate.d/exim4-paniclog changed:
/var/log/exim4/paniclog {
        size 10M
        missingok
        rotate 31
        compress
        delaycompress
        notifempty
        nocreate
}


-- debconf-show failed

Reply via email to