On 4/2/07, Roland Levillain roland@lrde.epita.fr wrote:
Roland Levillain roland@lrde.epita.fr writes:
Roland Levillain roland@lrde.epita.fr writes:
"Nicolas Pouillard" nicolas.pouillard@gmail.com writes:
On 2/10/07, Nicolas Pouillard nicolas.pouillard@gmail.com wrote:
On 2/10/07, Roland Levillain roland@lrde.epita.fr wrote:
Roland Levillain roland@lrde.epita.fr writes:
> Hello, > > Voici deux propositions de patches pour Vcs et RubyEx qui permettent > d'indiquer le jeu de caractères et l'encodage choisi pour poster des > mail avec Vcs. Les deux sont par faits rapport à Vcs 0.5 beta 10
En fait, ça ne semble pas avoir résolu le problème de Tsuna avec slrn. Je regarderai à nouveau un peu plus tard.
Dis... Ça en est où cette histoire d'encoding ?
Je n'ai pas eu le temps d'y toucher depuis. La proposition de patch que j'avais faite est incomplète, donc ne pas la prendre en compte pour le moment.
J'ai refait un essai, et apparemment ça marche.
Voici un patch contre vcs-0.5_beta10 (peut-être qu'il peut s'appliquer directement sur vcs-0.5_beta13).
J'ai fait une petite erreur : je voulais que l'encodage se fasse en 8-bit (il me semble que la majorité des serveurs de messagerie le supporte maintenant), et j'ai malheureusement laissé « quoted-printable » dans mon précedent diff.
Le patch devient donc:
--- lib/vcs/mail.rb.orig 2007-02-09 11:18:32.000000000 +0100 +++ lib/vcs/mail.rb 2007-04-02 15:38:40.000000000 +0200 @@ -12,6 +12,9 @@ @@mailer ||= Sendmail.new @@default_options ||= { :mime => true,
- # Use Latin-1 by default.
- :charset => 'iso-8859-1',
- :encoding => '8bit', :header => { 'X-Mailer' => "Vcs.mail (#{Vcs::Version})" } } cattr_accessor :mail_options
--- vendor/ruby_ex/lib/sendmail.rb.orig 2007-02-09 11:18:12.000000000 +0100 +++ vendor/ruby_ex/lib/sendmail.rb 2007-03-08 11:09:15.000000000 +0100 @@ -20,7 +20,9 @@ :to => [], :server => ENV['SMTPSERVER'] || 'localhost:25', :header => {},
:body => STDIN
:body => STDIN,
:charset => 'us-ascii',
) string_args, hash_args = args.partition { |x| x.is_a?(String) } hash_args.each do |hash|:encoding => '7bit'
@@ -75,9 +77,17 @@ opts.on('--header STRING', 'Add some header fields (Yaml syntax)') do |s| options.header.merge! YAML.load(s) end
opts.on('-m', '--[no-]mime', 'Choose the mime protocole') do |mime|
opts.on('-m', '--[no-]mime', 'Choose the MIME protocol') do |mime| options.mime = mime end
opts.on('--charset STRING',
'Choose a charset for the encoding') do |aCharset|
options.charset = aCharset
end
opts.on('--encoding STRING',
'Choose an encoding') do |anEncoding|
options.encoding = anEncoding
end opts.on_tail('-h', '--help', 'Show this message') do puts opts exit
@@ -156,11 +166,11 @@ TempPath.new do |mail_body| mail_body.open('w') do |out| if opts.mime
out.puts '
|Content-Type: text/plain; charset="us-ascii"
|Content-Transfer-Encoding: 7bit
out.puts "
|Content-Type: text/plain; charset=\"#{opts.charset}\"
|Content-Transfer-Encoding: #{opts.encoding} |
|'.head_cut!
|".head_cut! end out.print body end
@@ -191,8 +201,8 @@ |Content-Type: multipart/signed; micalg=pgp-sha1; | protocol="application/pgp-signature"; | boundary="#{id}";
| charset="us-ascii"
|Content-Transfer-Encoding: 7bit
| charset="#{opts.charset}"
|Content-Transfer-Encoding: #{opts.encoding} | |This is an OpenPGP/MIME signed message (RFC 2440 and 3156) |--#{id}
(La seule modification par rapport au précédent patch est la ligne du fichier `lib/vcs/mail.rb.orig' qui passe de
:encoding => 'quoted-printable'
à
:encoding => '8bit'
C'est fait (beta16)
BTW je n'ai plus acces au depot svn du labo (lrdetools), Djo pourrais tu... ?