r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Graham
11-Dec-2009
[15149x8]
Looks like Sterling's detach.r script in the library to detach attachments 
from emails has a bug.
See http://www.mail-archive.com/[list-:-rebol-:-com]/msg07169.html
Looks like Sterling's fix in that thread is also incorrect.  The 
problem is here

 boundary: headers/content-type
   if boundary: find/tail boundary {boundary="} [
        remove back tail boundary
        print ["Boundary string:" boundary]
   ]


where it looks for boundary="  but fails to take into account where 
there is not "
the first line is redundant, and the second line can be changed to 
a parse ...


   if parse headers/content-type  [ thru "boundary=" opt {"} [ copy 
   boundary to {"} to end | copy boundary to end ]][
        ;remove back tail boundary
        print ["Boundary string:" boundary]
   ]

which I think fixes it.
I discovered this when trying to detach files from gmail where there 
is not quote used, whereas hotmail uses the quote in the boundary 
string.
Hmm. Boundary won't have a value if the parse fails ... so

either parse ...  [

][
	 boundary: none
]
headers: import-email email

   either parse headers/content-type  [ thru "boundary=" opt {"} [ copy 
   boundary to {"} to end | copy boundary to end ]][
        print ["Boundary string:" boundary]
   ][ boundary: none ]
Just testing my script that logs into hotmail with gmail instead 
.. to download new email, and detach any attachments.  Seems to be 
working now.
Henrik
11-Dec-2009
[15157]
I'm debugging some code here and found that the ARRAY mezzanine has 
at some point been rewritten during R2 versions. Does anyone know 
when this happened?
Henrik
12-Dec-2009
[15158]
looks like the change was made between 2.7.5 and 2.7.6.
Von
12-Dec-2009
[15159x4]
Hello! I'm receiving the following error when processing a cgi form 
to send an e-mail of the response.  I correctly can send from my 
laptop, Rebol/Core -- command line, with my set-net settings in user.r 
but when I do the same thing on my hosting account I get the following 
error:
** User Error: Server error: tcp connection failed
** Near: smtp-port: open [scheme: 'esmtp] 
either only
Hello!  I'm having trouble with my hosting account to send via e-mail 
a cgi form response.  I can get rebol to post the data to the page, 
I just can't get it to send the data to me via e-mail.   I'm able 
to send e-mails from my laptop but when I use the same set-net settings 
on my host account I get the following error: ** User Error: Server 
error: tcp connection failed
** Near: smtp-port: open [scheme: 'esmtp] 
either only
Hello!  I'm having trouble with my hosting account to send via e-mail 
a cgi form response.  I can get rebol to post the data to the page, 
I just can't get it to send the data to me via e-mail.   I'm able 
to send e-mails from my laptop but when I use the same set-net settings 
on my host account I get the following error: ** User Error: Server 
error: tcp connection failed
** Near: smtp-port: open [scheme: 'esmtp] 
either only
Maxim
12-Dec-2009
[15163]
most smtp servers do ip filtering on the input.  this allows them 
to know who is sending the email to them and will only allow ips 
they serve to connect.


since your hosting account is probably on a remote server, it won't 
be allowed to send data via your home smtp server account.
Von
12-Dec-2009
[15164]
Sorry for the redundant posts.  Altme was updating and msg board 
wasn't being updated at the time. I thought I was losing the info.
Maxim
12-Dec-2009
[15165x2]
you'd have to setup an smtp server on the hosting account.
that is ... if I understand your setup correctly.
Von
12-Dec-2009
[15167]
Even though I'm able to send e-mails from my home computer via rebol 
console using my host's SMTP Relay?
Maxim
12-Dec-2009
[15168]
when you say hosting account, you mean a server on the net with its 
own dns/ip which is different than the ip being served to you by 
your access provider... yes?
Von
12-Dec-2009
[15169]
Yes, it's a shared hosting account; my provider is GoDaddy.
Maxim
12-Dec-2009
[15170]
its possible GoDaddy has an smtp relay you can connect to, which 
will accept connections from the hosted machine.

your internet provider will not allow anyone else than its own allocated 
ips to make an smtp connect... for sure.
Von
12-Dec-2009
[15171x2]
SMTP Relay lets you send email messages through your email account 
using your existing email service. For example, you can continue 
to use Microsoft Outlook to compose, receive, and send email messages, 
but the actual email messages are processed through our SMTP relaying 
services. This lets you bypass ISP restrictions on your outbound 
email messages and allows you to use your professional looking "[sales-:-coolexample-:-com]" 
email address rather than a general “[sales-:-ispname]” address.
Does this mean, I'll need to use perl: sendmail?
Graham
12-Dec-2009
[15173]
godaddy has it's own smtp server
Maxim
12-Dec-2009
[15174x2]
so, von, if you have a godaddy mail account setup, you can connect 
to its smtp server directly. 


is your hosted machine's set-net function setup to connect to something 
like [smtp-:-godaddy] ?
set-net is the rebol networking setup function. it is usually run 
on install and is stored in your user.r
Von
12-Dec-2009
[15176x2]
I have the following smtp in my set-net:  smtpout.secureserver.net
It works when I send an e-mail from my home laptop but not on my 
hosting account.
Graham
12-Dec-2009
[15178x4]
well, doesn't it ask you for a password??
esmtp requires a password
so you need to encode the password somewhere if you're going to use 
a script
and if you're not on your ISP ... it probably won't even let you 
send the email
Von
12-Dec-2009
[15182]
I've supplied all necessary info in set-net, which includes username 
and password.
Graham
12-Dec-2009
[15183]
well, then you need to a trace/net to see where the issue is
Von
12-Dec-2009
[15184]
In the past I've always used /usr/sbin/sendmail to send e-mails via 
cgi but I'm lost on how to do it via Rebol.
Graham
12-Dec-2009
[15185x2]
do you have a shell account?
from godaddy?
Von
12-Dec-2009
[15187]
I have to create one but the GoDaddy system says that I'll have to 
update my database name due to the conversion.
Graham
12-Dec-2009
[15188x4]
if sendmail works .. maybe you can use

set-net [ localhost [sales-:-coolexample-:-com] [
try this

rebol []
echo %log.txt
set-net [ [sales-:-coolexample-:-com] smtpout.secureserver.net ]
trace/net on
send [self-:-somewhere-:-com] "test"
make it a cgi script and see what is written to %log.txt
I get this

>> set-net [ [sales-:-coolexample-:-com] smtpout.secureserver.net ]
>> send [someone-:-gmail-:-com] "testing"
Net-log: ["Opening" "tcp" "for" "esmtp"]
connecting to: smtpout.secureserver.net
Net-log: [none "220"]
Net-log: {220 p3plsmtpa01-02.prod.phx3.secureserver.net ESMTP}
Net-log: [["EHLO" system/network/host] "250"]
Net-log: "250-p3plsmtpa01-02.prod.phx3.secureserver.net"
Net-log: "250-AUTH LOGIN PLAIN"
Net-log: "250-8BITMIME"
Net-log: "250 PIPELINING"
Net-log: ["Supported auth methods:" [login plain]]
Net-log: ["MAIL FROM: <[sales-:-coolexample-:-com]>" "250"]
Net-log: "250 Sender accepted."
Net-log: ["RCPT TO: <[someone-:-gmail-:-com]>" "250"]

** User Error: Server error: tcp 553 Sorry, that domain isn't in 
my list of allowed rcpthosts.
Von
12-Dec-2009
[15192]
log.txt:  Content-Type: text/plain

Net-log: ["Opening" "tcp" "for" "esmtp"]
Net-log: [none "220"]
** User Error: Server error: tcp connection failed
** Near: smtp-port: open [scheme: 'esmtp] 
either only
Maxim
12-Dec-2009
[15193]
that looks like an outgoing firewall issue.
Graham
12-Dec-2009
[15194x4]
yeah ..port 25 is being blocked
you have to use this .... http://help.godaddy.com/article/1073
this is the correct smtp server relay-hosting.secureserver.net
limit of 1000 email per day
Von
12-Dec-2009
[15198]
Wow, that's it! :-)  I've spent almost 10 hours trying to resolve 
this and I had the wrong smtp relay, duh me!  I really appreciate 
your help!