Hi there, If someone could have a quick look at this I would really appreciate it! I cannot for the life of me understand this... I have a DTML method taking in parameters for use with sendmail, which when I *display* appear correct but when I *send* are altered slightly. I know where the problem lies (it's obvious) but I can't see what the problem is. Here's my DTML method: <dtml-var standard_html_header> <dtml-call "REQUEST.set('recipients',[])"> <dtml-in "REQUEST.form.items()"> <dtml-if expr="_['sequence-key'] in ('message','sender','senderEmail','subject')"> <input type="hidden" name="<dtml-var sequence-key>" value="<dtml-var sequence-item>"> <dtml-else> <dtml-call "recipients.append(_['sequence-key'])"> </dtml-if> </dtml-in> <dtml-sendmail mailhost="MailHost"> To: <dtml-var "_.string.join(recipients,'@cs.strath.ac.uk, ')">@cs.strath.ac.uk From: <dtml-var sender> Reply-To: <dtml-var senderEmail> Subject: <dtml-var subject> X-Mailer: ZAPHOD Mail Client V1.0 <dtml-var message> </dtml-sendmail> <h2>Cheers, <dtml-var sender>!</h2> <p>Your message has been sent.</p> ^ My problem lies with the To/From parts in the <sendmail>. When the message has been sent... -=-==--=-= I should see: Subject: Hello Date: Thu, 25 Jan 2001 08:30:11 +0000 From: Lee Reply-To: lee.reilly@ntlworld.com To: ltyler@cs.strath.ac.uk, lreilly@cs.strath.ac.uk -=-==--=-= but I see: Subject: Hello Date: Thu, 25 Jan 2001 08:30:11 +0000 From: Lee@cs.strath.ac.uk <---- why is the @cs.strath.ac.uk still appended? Reply-To: lee.reilly@ntlworld.com To: ltyler@cs.strath.ac.uk, lreilly@cs.strath.ac.uk <dtml-var sender> gives me 'Lee' Clearly, there is a problem with : To: <dtml-var "_.string.join(recipients,'@cs.strath.ac.uk, ')">@cs.strath.ac.uk From: <dtml-var sender> i.e the @cs.strath.ac.uk is still lingering... but why? without the '@cs.strath.ac.uk' at the end of the var the last email address would not be complete i.e. it be "lreilly". even when i put another tag in place of from, e.g. 'X-Mailer:' is still renders From='Lee@cs.strath.ac.uk'. I know it's asking a lot but can anyone tell me what the problem is? I'm confused and the coffee isn't helping anymore! - Thanks, Lee -- Lee Reilly mailto:lee.reilly@ntlworld.com ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,, HAVE SKILLS; WILL TRAVEL. I'm currently looking for an internship in the USA in the field of web development. Ideally, I'm looking for a placement for 3 to 18 months. Can you help? More details, my resume, etc. @ http://homepages.strath.ac.uk/~aeu97172/ </shameless plug>
Lee, This is more than likely your mailer doing this, not Zope. try: <dtml-sendmail mailhost="MailHost"> To: <dtml-var "_.string.join(recipients,'@cs.strath.ac.uk, ')">@cs.strath.ac.uk From: "<dtml-var sender>" Reply-To: <dtml-var senderEmail> Subject: <dtml-var subject> X-Mailer: ZAPHOD Mail Client V1.0 <dtml-var message> </dtml-sendmail> Notice the quotes around the <dtml-var sender> On 25 Jan 2001 08:52:07 +0000, Lee wrote:
i.e the @cs.strath.ac.uk is still lingering... but why? without the '@cs.strath.ac.uk' at the end of the var the last email address would not be complete i.e. it be "lreilly".
Hi, Thanks for your response. "<dtml-var sender>" gives me... From: "Lee"@cs.strath.ac.uk ... in the received message. A previous version I had of this script gave me the correct results (From: God, Reply-To: God@hell.com) so I'm pretty-sure that's it's a problem with '@cs.strath.ac.uk' being appended. As far as I can tell, the new version is doing exactly the same thing only using a collection of recipients and python's string_join. Hmmmm... The virtual buck is still here! Thanks, Lee "M. Adam Kendall" wrote:
Lee, This is more than likely your mailer doing this, not Zope. try: From: "<dtml-var sender>"
Notice the quotes around the <dtml-var sender>
-- Lee Reilly mailto:lee.reilly@ntlworld.com ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,, HAVE SKILLS; WILL TRAVEL. I'm currently looking for an internship in the USA in the field of web development. Ideally, I'm looking for a placement for 3 to 18 months. Can you help? More details, my resume, etc. @ http://homepages.strath.ac.uk/~aeu97172/ </shameless plug>
[lee.reilly@ntlworld.com] | ... in the received message. A previous version I had of this script gave | me the correct results (From: God, Reply-To: God@hell.com) so I'm | pretty-sure that's it's a problem with '@cs.strath.ac.uk' being appended. And you are running with the same mailserver, on the same host?
Lee, Before you move on to your DTML stuff about email address and stuff, you should always make sure that you DON'T HAVE ANY WHITESPACE BEFORE THE MAIL HEADERS. (sorry for the shouting, but it's a classic misstake) Does it work "DTMLless". I.e. does it work with statically typed in email addresses and such? When your sendmail things works, try to work with the DTML stuff in a method until that works. _Then_ merge the DTML and the sendmail. Good luck! ----- Original Message ----- From: "Lee" <lee.reilly@ntlworld.com> To: <zope@zope.org> Sent: Thursday, January 25, 2001 8:52 AM Subject: [Zope] a little problem - $1 reward!
Hi there,
If someone could have a quick look at this I would really appreciate it! I cannot for the life of me understand this... I have a DTML method taking in parameters for use with sendmail, which when I *display* appear correct but when I *send* are altered slightly. I know where the problem lies (it's obvious) but I can't see what the problem is.
Here's my DTML method:
<dtml-var standard_html_header> <dtml-call "REQUEST.set('recipients',[])"> <dtml-in "REQUEST.form.items()"> <dtml-if expr="_['sequence-key'] in ('message','sender','senderEmail','subject')"> <input type="hidden" name="<dtml-var sequence-key>" value="<dtml-var sequence-item>"> <dtml-else> <dtml-call "recipients.append(_['sequence-key'])"> </dtml-if> </dtml-in>
<dtml-sendmail mailhost="MailHost"> To: <dtml-var "_.string.join(recipients,'@cs.strath.ac.uk, ')">@cs.strath.ac.uk From: <dtml-var sender> Reply-To: <dtml-var senderEmail> Subject: <dtml-var subject> X-Mailer: ZAPHOD Mail Client V1.0
<dtml-var message>
</dtml-sendmail>
<h2>Cheers, <dtml-var sender>!</h2> <p>Your message has been sent.</p>
^ My problem lies with the To/From parts in the <sendmail>. When the message has been sent...
-=-==--=-= I should see:
Subject: Hello Date: Thu, 25 Jan 2001 08:30:11 +0000 From: Lee Reply-To: lee.reilly@ntlworld.com To: ltyler@cs.strath.ac.uk, lreilly@cs.strath.ac.uk
-=-==--=-= but I see:
Subject: Hello Date: Thu, 25 Jan 2001 08:30:11 +0000 From: Lee@cs.strath.ac.uk <---- why is the @cs.strath.ac.uk still appended? Reply-To: lee.reilly@ntlworld.com To: ltyler@cs.strath.ac.uk, lreilly@cs.strath.ac.uk
<dtml-var sender> gives me 'Lee'
Clearly, there is a problem with : To: <dtml-var "_.string.join(recipients,'@cs.strath.ac.uk, ')">@cs.strath.ac.uk From: <dtml-var sender>
i.e the @cs.strath.ac.uk is still lingering... but why? without the '@cs.strath.ac.uk' at the end of the var the last email address would not be complete i.e. it be "lreilly".
even when i put another tag in place of from, e.g. 'X-Mailer:' is still renders From='Lee@cs.strath.ac.uk'. I know it's asking a lot but can anyone tell me what the problem is? I'm confused and the coffee isn't helping anymore!
- Thanks,
Lee
-- Lee Reilly mailto:lee.reilly@ntlworld.com
ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,
HAVE SKILLS; WILL TRAVEL.
I'm currently looking for an internship in the USA in the field of web development. Ideally, I'm looking for a placement for 3 to 18 months. Can you help?
More details, my resume, etc. @ http://homepages.strath.ac.uk/~aeu97172/
</shameless plug>
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
DON'T HAVE ANY WHITESPACE BEFORE THE MAIL HEADERS. (sorry for the shouting, but it's a classic misstake)
I didn't realise that. Thanks.
Does it work "DTMLless". I.e. does it work with statically typed in email addresses and such?
Nope, 'From:Lee' still gives me Lee@cs.strath.ac.uk in the received message.
And you are running with the same mailserver, on the same host?
Yup. Here's a little example of a mail program (some might call it an email spammer perhaps) to help me apply for some jobs. This is also why I wanted to know if sendmail could be used for usenet postings... <dtml-var standard_html_header> <dtml-sendmail mailhost="MailHost"> To: <dtml-var email> From: Lee Reilly Reply-To: lee.reilly@ntlworld.com X-Mailer: Job Spammer Subject: <dtml-var position> practical training/internship position Content-Type: multipart/mixed; boundary="------------138879291FA1FC8B06755CEE" This is a multi-part message in MIME format. --------------138879291FA1FC8B06755CEE Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit --------------138879291FA1FC8B06755CEE Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Base: "http://homepages.strath.ac.uk/~aeu9717 2/" Content-Location: "http://homepages.strath.ac.uk/~aeu9717 2/" <html> <head> <title>Lee Reilly</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="description" content="seeking employment in the US for a period of 3 months starting in June 2001"> <meta name="keywords" content="lee, reilly, internship, web site, website, BUNAC, summer, work, employment, Scottish, Lee Reilly"> </head> <body bgcolor="#FFFFFF" text="#CCFFCC" link="#FFFFCC" vlink="#FFFFCC" alink="#FFFFCC"> <p><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">Dear <dtml-var name>, </font></p> <p><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">Further to you advertisement on <dtml-var advertisement> I am writing to enquire as to whether you have any summer internship / practical training opportunities available for Computer Science graduates this summer. I am due to graduate with a BSc Hons degree in Computer Science in June 2001 from the University of Strathclyde, Glasgow, and from there ... blah blah blah </body> </html> --------------138879291FA1FC8B06755CEE-- </dtml-sendmail> <h2>Cheers big yin!</h2> <p>You'll get the job ;-)</p> <dtml-var standard_html_footer> This gives me the *correct* results so I can't imagine that's a problem with the mailserver: Subject: web developer practical training/internship position Date: Thu, 25 Jan 2001 14:08:55 +0000 From: Lee Reilly <----- perfect! Reply-To: lee.reilly@ntlworld.com To: Lee.reilly@ntlworld.com So I think it's a problem with To: dtml-var "_.string.join(recipients,'@cs.strath.ac.uk,')">@cs.strath.ac.uk It's now more trouble than it's worth so I'll just implement it differently. It's quite annoying though! Thanks for your help anyway :) - Best regards, Lee
participants (4)
-
Erik Enge -
Lee -
M. Adam Kendall -
peter bengtson