RE: [Zope] = replaced with == in sendmail!!!!!
-----Original Message----- From: Michel Pelletier [mailto:michel@digicool.com] Sent: Friday, 16 April 1999 00:31 To: Jay, Dylan; 'zope@zope.org' Subject: RE: [Zope] = replaced with == in sendmail!!!!!
I have the following inside a sendmail tag
<!--#var URL1-->/completeReg?MagicNumber=<!--#var MagicNumber-->
However in the mail that is sent this comes out as
http://blah.com/completeReg?MagicNumber==23423434
This is incredibly fustrating and I can find no way around this. Even
<!--#var URL1-->/completeReg?MagicNumber<!--#var "'='"--><!--#var MagicNumber-->
produces the same result. Whats going on?
I have no idea, but try:
<!--#var "_.string.join((URL1, '/completeReg?MagicNumber=', MagicNumber))" url_quote-->
just for the heck of it and tell us what happens.
I couldn't get it to work but I'm pretty sure it wouldn't anyway. I had a look at the MailHost code and found some quoting stuff that if I knew more about python I might be able to do work out the problem with. Down the bottom of MailHost.py in the MailHost product is the following ESCAPE = '=' MAXLINESIZE = 76 HEX = '0123456789ABCDEF' def needsquoting(c, quotetabs): if c == '\t': return not quotetabs return c == ESCAPE or not(' ' <= c <= '~') def quote(c): if c == ESCAPE: return ESCAPE * 2 else: i = ord(c) return ESCAPE + HEX[i/16] + HEX[i%16] def encode(input, quotetabs): """Encode a string to Quoted-Printable""" output = '' for line in string.split(input, '\n'): new = '' prev = '' for c in line: if needsquoting(c, quotetabs): c = quote(c) if len(new) + len(c) >= MAXLINESIZE: output = output + new + ESCAPE + '\n' new = '' new = new + c prev = c if prev in (' ', '\t'): output = output + new + ESCAPE + '\n\n' else: output = output + new + '\n' return output I presume some quoting needs to go on in order for the message to be sent to the smtp server. This seems to be buggy. Can anyone tell me how to fix this as it is quite urgent.
"Jay, Dylan" wrote:
I couldn't get it to work but I'm pretty sure it wouldn't anyway. I had a look at the MailHost code and found some quoting stuff that if I knew more about python I might be able to do work out the problem with.
I've just managed to send accend chars (iso8859-1) in an email. I had to add some headers to the message to make it work. Adding it made the mail client interpret correctly the email. Probably everything will be ok if you also use them. Here is: <!--#sendmail mailhost="mailhost"--> From: Myself <me@here.com> To: Somebody <she@somewhere.com> Subject: Hi! Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable 1+1=2 <!--#/sendmail--> Try it and see if it works. Maybe these headers (content-type and enconding) should be added by default. Should we add it to Collector? regards, -- Paulo Eduardo Neves PUC-Rio de Janeiro Pager: Central: 292-4499 cod. 213 99 64 ou use a URL: http://www.learn.fplf.org.br/neves/mensagempager.html
participants (2)
-
Jay, Dylan -
Paulo Eduardo Neves