[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: smtpmail and ~/.authinfo

From: Stefan Monnier
Subject: Re: smtpmail and ~/.authinfo
Date: Tue, 27 Sep 2011 08:55:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Here's my take on it:
.authinfo contains various things and is used in different ways, and
there isn't a single answer that covers all cases:
- each kind of field (hostname, username, password) may require
  a different encoding/decoding.
- when reading a password from the file, it should be read using
  raw-text (i.e. as a "unibyte string").
  In other words, the password should not be decoded into chars but left
  as a sequence of bytes that will be sent as-is to whoever needs it.
- when a password is typed by the user it'll be a sequence of chars, so
  we'll have to convert it into a sequence of bytes.  The best coding
  system to use for that purpose is probably going to be
  locale-coding-system.  That sequence of bytes is then send to whoever
  needs it and saved as-is (using raw-text) into the .authinfo file.
- i.e. authinfo should be read as a unibyte file.
- i.e. when reading other fields than passwords, we'll have to
  explicitly decode them using the coding system we want to use for
  those fields.
- similarly, we'll have to encode those other fields manually when
  writing them into .authinfo.

Of course, another option is to just read&write authinfo without
thinking about it, so Emacs will usually pick locale-coding-system for
it and it'll work just fine in 99.9% of the cases.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]