Missing header in confirmation email

Discussion re sg development. You don't have to be a developer.

Missing header in confirmation email

Postby SysKoll » Thu Sep 18, 2003 3:48 am

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?
-- SysKoll
SysKoll
 
Posts: 889
Joined: Thu Aug 28, 2003 9:24 pm

Postby josh » Fri Sep 19, 2003 2:46 am

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...)
josh
 
Posts: 1371
Joined: Fri Aug 29, 2003 2:28 pm

And what happens?

Postby SysKoll » Fri Sep 19, 2003 4:26 am

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?
-- SysKoll
SysKoll
 
Posts: 889
Joined: Thu Aug 28, 2003 9:24 pm

Postby josh » Thu Oct 02, 2003 12:00 am

I'm not sure why it's not working. I'll look into it some more in the next couple of days.
josh
 
Posts: 1371
Joined: Fri Aug 29, 2003 2:28 pm

Debugging the confirmation message encoding problem

Postby SysKoll » Thu Oct 02, 2003 2:38 am

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.
-- SysKoll
SysKoll
 
Posts: 889
Joined: Thu Aug 28, 2003 9:24 pm

Postby josh » Thu Oct 02, 2003 4:27 pm

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.
josh
 
Posts: 1371
Joined: Fri Aug 29, 2003 2:28 pm

Tested, working

Postby SysKoll » Thu Oct 02, 2003 8:17 pm

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.
-- SysKoll
SysKoll
 
Posts: 889
Joined: Thu Aug 28, 2003 9:24 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 1 guest

cron