Page 1 of 1

Missing header in confirmation email

PostPosted: Thu Sep 18, 2003 3:48 am
by SysKoll
I tested the French version of the forwarding address confirmation message by registering a new user. I did get the message contained in the confirmationmessage.txt template in an email that has the addressconfirmation dialog as the subject.

However, this message has a problem: the French accented chars are garbled. They look like they have been incorrectly transcoded. I believe other languages have the same problems, although I'd need a confirmation.

I believe the reason is that the header of the confirmation email does not include any of the standard SMTP provisions for 8-bit messages. This could be solved in two ways:

Method 1: we transcode into ISO-8859-1 hex the confimation.txt template and the addressconfirmation dialog . Painful to edit for future revisions.

Method 2: In the SMTP headers of the confirmation message, we add the following headers:
--- cut here ---
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
--- cut here ---

That will keep the dialogs and templates in an easily editable form.

Josh, is this feasible?

PostPosted: Fri Sep 19, 2003 2:46 am
by josh
I'm trying -- we may be doomed for the subject line, though, because I don't think it participates in the mime type. I'm saving the template and the related dialogs as utf-8, BTW. I can probably change them over to iso-8859-1 if need be.

I'm using command-line sendmail to send those messages, and so far I can't get those header to actually get into the message.
Code: Select all
  $mailprogram = '/usr/sbin/sendmail';

  open (MAIL, "|$mailprogram -t >> /dev/null");
  print MAIL "To: $newaddress\n";
  print MAIL "From: info\@spamgourmet.com\n";
  print MAIL "Subject: $subject\n";
  print MAIL "MIME-Version: 1.0\n";
  print MAIL "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
  print MAIL "Content-Transfer-Encoding: 8bit\n";
  print MAIL $body->getContent();
  close MAIL;


I'll look a little closer -- there's probably a way to do it without "refactoring" the code that sends the mail. I do have some socket code we can use to go straight to port 25, if we need it (that would be good to use in the bare spameater, too...)

And what happens?

PostPosted: Fri Sep 19, 2003 4:26 am
by SysKoll
The perl code seems correct. So what happens when you execute that code? Don't the
print MAIL statements put these strings into the header of the message?

PostPosted: Thu Oct 02, 2003 12:00 am
by josh
I'm not sure why it's not working. I'll look into it some more in the next couple of days.

Debugging the confirmation message encoding problem

PostPosted: Thu Oct 02, 2003 2:38 am
by SysKoll
Josh,

I'd really like to see the raw email copied somewhere, including the header. I suggest the following debugging technique:

* temporary modify the code so that the forwarding email confirmation message is also written to a temp file (we need the whole message including the headers)

* create a bogus user, choose the French language and get the confirmation message

* forward the temp file to me, as an attachment (to avoid further email transcoding) so I can look at it.

If you want me to perform all or part of these operations, just let me know (provided I have the proper permissions of course).

Thanks.

PostPosted: Thu Oct 02, 2003 4:27 pm
by josh
My bad (I think) - I tried the same thing with the utf-8 character set (the one we're using to store the stuff), and it seems to have worked.

I have an account that uses French (one of 159 such accounts - way up from about 20 a couple of months ago....) and sent a confirm message for it to a fasmail account.

The subject line looked messed up in the mailbox listing, but when I went to the message view, everything looked correct, including the subject, curiously.

I've seen it happen before that various MUAs and MTAs can't handle non-ascii headers, and the Subject is in the headers. Maybe that had something to do with it.

Anyway, give it a shot when you get a chance.

Tested, working

PostPosted: Thu Oct 02, 2003 8:17 pm
by SysKoll
Josh,

I tested it again with your UTF-8 modification and it appears all right in my mail client. The only trouble is the subject line, where the accented character is not showing up normally. I solved the problem by changing the accented character in the french addressconfirmation dialog into its non-accented equivalent. It looks like a typo but it's better than garbled chars.

I am posting a new topic with my suggested improvements for the English version of the nobrainercontent.html and the confirmationmessage.txt templates.