Email/SMTP::NET Problems

I no longer have access to the logs so I can’t reproduce the error, but
my administrator told me he thinks there may be an error in the mysql
regarding varchar of some sort. Hes looking into it for me as well. But
I attempted the

em = “#{ em }”

with no luck at all, same Internal Error problem. Thanks again

brantley

On Apr 24, 2008, at 8:58 AM, Brantley Shields wrote:

brantley

you’ve got to post some errors if you want some insight - otherwise
we’re just gropping in the dark. you might want to mention, to your
boss, that developing web apps without log access is a giant waste of
money - yours and ours.

btw Internal Error is generally a syntax error or permissions issue.

get your code running correctly from the command line and them move to
your cgi environment. you aren’t running in se-linux by any chance
are you? also, none of the code you’ve shown us has had anything to
do with mysql?

regards.

a @ http://codeforpeople.com/

From: “ara.t.howard” [email protected]

On Apr 24, 2008, at 8:58 AM, Brantley Shields wrote:

I no longer have access to the logs so I can’t reproduce the error,

you might want to mention, to your
boss, that developing web apps without log access is a giant waste of
money - yours and ours.

Agreed. However, if you really don’t have access to the log files,
it may help to put a line like this at the top of your script:

orig_stderr = $stderr; $stderr = File.open(“mylog.log”, “a”);
$stderr.sync = true

This won’t help if your code contains a syntax error such that
Ruby can’t compile your code at all. However, it will redirect
runtime error output to “mylog.log”. (Obviously you may
need to specify a full path to somewhere on the system you have
permission to create files. Like “/home/brantley/mylog.log” or
something…)

Hope this helps,

Bill

On Apr 24, 2008, at 8:18 AM, Brantley Shields wrote:

So, what is the difference between " and ’ to ruby? I checked the
error
logs on my server (got ahold of the administrator) and the logs show a
tainted to_address. I know the email itself is not tainted and that it
will send an email address to the one being put into to_address. I’ve
tried multiple simple email addresses such as “[email protected]” which
would not be tainted. So I think its confusing the string or whatever
to_address is being referred to as, its interpretting it as something
else. how can I convert to_address to ‘somelikethis’ ?

show us the error. to untaint you can do something like

em = “#{ em }”

a @ http://codeforpeople.com/

Solution:

to_address = cgi[‘email’].strip

I don’t know why, but between strip and untaint my problem is solved.
Thank you all

Brantley

Greetings everyone,

I’ve been browsing more and more all day to find a solution to this
problem and this guy at:

http://www.ruby-forum.com/topic/100888#new

Had the exact same problem I’m having. His error was the email address
was tainted because it was a user submitted via a form. I tried the
solution of adding the following:

to_address = cgi[‘email’]

Net::SMTP.start(‘lsdfus.hisdfint.edu’) do |smtp|
smtp.open_message_stream(‘[email protected]’,to_address.untaint) do
|f|
f.puts “From: [email protected]
f.puts “To: Brantley Shields”
f.puts “Subject: Test Message”
f.puts
f.puts “This is a test email!”
end
end

This still produces the same error, does this help enlighten anyone?

brantley

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs