Bug#811126: cron: MIME-Version header not set thus Content-Type and other MIME headers may be ignored

2023-08-24 Thread Georges Khaznadar
Hello,

considering that the bug was considered as fixed, and tagged moreinfo,
without new information received for seven years, I shall close it now.
Please feel free to reopen it.

Best regards,   Georges.

Christian Kastner a écrit :
> Control: tag -1 moreinfo
> 
> Hi,
> 
> On 2016-01-15 22:18, Vincent Caron wrote:
> > Package: cron
> > Version: 3.0pl1-127+deb8u1
>^^^
> 
> This version already contains this fix; it first included in
> 3.0pl1-125.
> 
> Is it possible that you got your versions mixed up?
> 
> > when sending command outputs via email, cron will use at least one MIME
> > header(Content-Type, wether the user configured CONTENT_TYPE or not),
> > but will not set the "MIME-Version" header as required by the MIME RFC.
> 
> > The patch is pretty trivial: always add a "MIME-Version: 1.0" header.
> > 
> > --- do_command.c.orig   2016-01-15 13:24:09.486709632 +0100
> > +++ do_command.c2016-01-15 13:07:26.594685734 +0100
> > @@ -567,6 +567,7 @@
> > fprintf(mail, "Date: %s\n",
> > arpadate(&StartTime));
> >  # endif /* MAIL_DATE */
> > +   fprintf(mail, "MIME-Version: 1.0\n");
> > if ( content_type == 0L ) {
> > fprintf(mail, "Content-Type: text/plain; charset=%s\n",
> > cron_default_mail_charset
> 
> Regards,
> Christian
> 
> 



-- 
Georges KHAZNADAR et Jocelyne FOURNIER
22 rue des mouettes, 59240 Dunkerque France.
Téléphone +33 (0)3 28 29 17 70



signature.asc
Description: PGP signature


Bug#811126: cron: MIME-Version header not set thus Content-Type and other MIME headers may be ignored

2016-05-01 Thread Christian Kastner
Control: tag -1 moreinfo

Hi,

On 2016-01-15 22:18, Vincent Caron wrote:
> Package: cron
> Version: 3.0pl1-127+deb8u1
   ^^^

This version already contains this fix; it first included in
3.0pl1-125.

Is it possible that you got your versions mixed up?

> when sending command outputs via email, cron will use at least one MIME
> header(Content-Type, wether the user configured CONTENT_TYPE or not),
> but will not set the "MIME-Version" header as required by the MIME RFC.

> The patch is pretty trivial: always add a "MIME-Version: 1.0" header.
> 
> --- do_command.c.orig   2016-01-15 13:24:09.486709632 +0100
> +++ do_command.c2016-01-15 13:07:26.594685734 +0100
> @@ -567,6 +567,7 @@
> fprintf(mail, "Date: %s\n",
> arpadate(&StartTime));
>  # endif /* MAIL_DATE */
> +   fprintf(mail, "MIME-Version: 1.0\n");
> if ( content_type == 0L ) {
> fprintf(mail, "Content-Type: text/plain; charset=%s\n",
> cron_default_mail_charset

Regards,
Christian




signature.asc
Description: OpenPGP digital signature


Bug#811126: cron: MIME-Version header not set thus Content-Type and other MIME headers may be ignored

2016-01-15 Thread Vincent Caron
Package: cron
Version: 3.0pl1-127+deb8u1
Severity: normal
Tags: patch

Dear Maintainer,

when sending command outputs via email, cron will use at least one MIME
header(Content-Type, wether the user configured CONTENT_TYPE or not),
but will not set the "MIME-Version" header as required by the MIME RFC.

The bug might occur when strict email systems will refuse to interpret
the Content-Type header when MIME-Version is not set, as I juste
encountered when the target email is a Mailman list. For instance a
source utf-8 text with proper Content-Type (text/plain; charset= utf8)
is mangled when run through Mailman (considered as ASCII and rendered as
garbage).

The patch is pretty trivial: always add a "MIME-Version: 1.0" header.

--- do_command.c.orig   2016-01-15 13:24:09.486709632 +0100
+++ do_command.c2016-01-15 13:07:26.594685734 +0100
@@ -567,6 +567,7 @@
fprintf(mail, "Date: %s\n",
arpadate(&StartTime));
 # endif /* MAIL_DATE */
+   fprintf(mail, "MIME-Version: 1.0\n");
if ( content_type == 0L ) {
fprintf(mail, "Content-Type: text/plain; charset=%s\n",
cron_default_mail_charset


I've tested it and it fixes the problem.



-- Package-specific info:
--- EDITOR:
not set

--- /usr/bin/editor:
/bin/nano

--- /usr/bin/crontab:
-rwxr-sr-x 1 root crontab 36008 Jun 11  2015 /usr/bin/crontab

--- /var/spool/cron:
drwxr-xr-x 5 root root 4096 Sep 23  2014 /var/spool/cron

--- /var/spool/cron/crontabs:
drwx-wx--T 2 root crontab 4096 Aug  9  2014 /var/spool/cron/crontabs

--- /etc/cron.d:
drwxr-xr-x 2 root root 4096 Dec  7 10:18 /etc/cron.d

--- /etc/cron.daily:
drwxr-xr-x 2 root root 4096 Dec  7 10:16 /etc/cron.daily

--- /etc/cron.hourly:
drwxr-xr-x 2 root root 4096 Sep  5 15:55 /etc/cron.hourly

--- /etc/cron.monthly:
drwxr-xr-x 2 root root 4096 Sep 11 15:49 /etc/cron.monthly

--- /etc/cron.weekly:
drwxr-xr-x 2 root root 4096 Sep  5 15:55 /etc/cron.weekly


-- System Information:
Debian Release: 8.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages cron depends on:
ii  adduser  3.113+nmu3
ii  debianutils  4.4+b1
ii  dpkg 1.17.26
ii  init-system-helpers  1.22
ii  libc62.19-18+deb8u1
ii  libpam-runtime   1.1.8-3.1
ii  libpam0g 1.1.8-3.1
ii  libselinux1  2.3-2
ii  lsb-base 4.1+Debian13+nmu1

Versions of packages cron recommends:
ii  postfix [mail-transport-agent]  2.11.3-1

Versions of packages cron suggests:
ii  anacron2.3-23
pn  checksecurity  
ii  logrotate  3.8.7-1+b1

Versions of packages cron is related to:
pn  libnss-ldap   
pn  libnss-ldapd  
pn  libpam-ldap   
pn  libpam-mount  
pn  nis   
pn  nscd  

-- no debconf information