Skip to content
  • brian m. carlson's avatar
    send-email: automatically determine transfer-encoding · e67a228c
    brian m. carlson authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    git send-email, when invoked without a --transfer-encoding option, sends
    8bit data without a MIME version or a transfer encoding.  This has
    several downsides.
    
    First, unless the transfer encoding is specified, it defaults to 7bit,
    meaning that non-ASCII data isn't allowed.  Second, if lines longer than
    998 bytes are used, we will send an message that is invalid according to
    RFC 5322.  The --validate option, which is the default, catches this
    issue, but it isn't clear to many people how to resolve this.
    
    To solve these issues, default the transfer encoding to "auto", so that
    we explicitly specify 8bit encoding when lines don't exceed 998 bytes
    and quoted-printable otherwise.  This means that we now always emit
    Content-Transfer-Encoding and MIME-Version headers, so remove the
    conditionals from this portion of the code.
    
    It is unlikely that the unconditional inclusion of these two headers
    will affect the deliverability of messages in anything but a positive
    way, since MIME is already widespread and well understood by most email
    programs.
    
    Signed-off-by: default avatarbrian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    e67a228c