:: Re: [DNG] quoted-printable emails f…
Top Page
Delete this message
Reply to this message
Author: Ralph Ronnquist
Date:  
To: dng
Subject: Re: [DNG] quoted-printable emails from cronjobs
Though it seems the "by default.." sentence is wrong. (Maybe that's
why the paragrah was removed). HOwever the environment settings do
apply, and perhaps you will want to use

    CONTENT_TYPE=text/plain; charset=ascii
    CONTENT_TRANSFER_ENCODING=7bit


Ralph.

On Thu, Jan 08, 2026 at 07:55:07PM +1100, Ralph Ronnquist via Dng wrote:
> It appears that debian's "man 5 crontab" has lost some useful details,
> such that:
>
>       "By default, cron sends a mail using the 'Content-Type:' header of
>        'text/plain' with the 'charset=' parameter set to the
>        'charmap/codeset' of the locale in which crond(8) is started up,
>        i.e., either the default system locale, if no LC_* environment
>        variables are set, or the locale specified by the LC_* environment
>        variables (see locale(7)).  Different character encodings can be
>        used for mailing cron job outputs by setting the CONTENT_TYPE and
>        CONTENT_TRANSFER_ENCODING variables in a crontab to the correct
>        values of the mail headers of those names."

>
> (I'm afraid I don't have a say in that matter; Prtobably seen as
> improvement by some)
>
> Ralph.
>
> On Thu, Jan 08, 2026 at 09:12:26AM +0100, Rene Kita wrote:
> > On my newly setup Excalibur box I receive cron mails as
> > Content-Transfer-Encoding: quoted-printable which makes reading them
> > with mail(1) unpleasant.
> >
> > Using mail(1) itself or just printf'ing to /usr/sbin/sendmail mails are
> > not send as quoted-printable.
> >
> > Here is an example bad mail:
> >
> > #v+
> > Message 1:
> > >From kt@??? Tue Jan 06 09:54:02 2026
> > Envelope-to: kt@???
> > Delivery-date: Tue, 06 Jan 2026 09:54:02 +0100
> > From: root@??? (Cron Daemon)
> > To: kt@???
> > Subject: Cron <kt@x280> backup mobile: -Lahv
> > MIME-Version: 1.0
> > Content-Type: text/plain; charset=UTF-8
> > Content-Transfer-Encoding: quoted-printable
> > X-Cron-Env: <HOME=/home/kt>
> > X-Cron-Env: <PATH=/home/kt/.local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin>
> > X-Cron-Env: <SHELL=/bin/sh>
> > X-Cron-Env: <LOGNAME=kt>
> > Date: Tue, 06 Jan 2026 09:54:02 +0100
> >
> > ssh: connect to host mobile port 22: Connection refused=0D
> > #v-
> >
> > How can I turn this off?
> >
> > #v+
> > root@x280:~# more /etc/default/cron
> > # Cron configuration options
> >
> > # Whether to read the system's default environment files (if present)
> > # If set to "yes", cron will set a proper mail charset from the
> > # locale information. If set to something other than 'yes', the default
> > # charset 'C' (canonical name: ANSI_X3.4-1968) will be used.
> > #
> > # This has no effect on tasks running under cron; their environment can
> > # only be changed via PAM or from within the crontab; see crontab(5).
> > READ_ENV="yes"
> >
> > # Extra options for cron, see cron(8)
> > #
> > # For example, to enable LSB name support in /etc/cron.d/, use
> > # EXTRA_OPTS='-l'
> > #
> > # Or, to log standard messages, plus jobs with exit status != 0:
> > # EXTRA_OPTS='-L 5'
> > #
> > # For quick reference, the currently available log levels are:
> > # 0 no logging (errors are logged regardless)
> > # 1 log start of jobs
> > # 2 log end of jobs
> > # 4 log jobs with exit status != 0
> > # 8 log the process identifier of child process (in all logs)
> > #
> > EXTRA_OPTS=""
> >
> > root@x280:~# more /etc/default/locale
> > # File generated by update-locale
> > LANG="C.UTF-8"
> >
> > t@x280:~# more /etc/environment
> > root@x280:~#
> > #v-
> > _______________________________________________
> > Dng mailing list
> > Dng@???
> > Manage your subscription: https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
> > Archive: https://lists.dyne.org/lurker/list/dng.en.html
> _______________________________________________
> Dng mailing list
> Dng@???
> Manage your subscription: https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
> Archive: https://lists.dyne.org/lurker/list/dng.en.html