[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby and Mozilla?

Hal E. Fulton

11/10/2004 12:35:00 AM

Is there any Ruby code out there that can interact with Mozilla
(email, I mean)?

I'm interested in both browsing and email, but right now I am
looking at email primarily.

For example, I'd like to write Ruby code of my own to filter spam.
So I'd like to connect to the remote POP server (pretty easy) and
grab the messages and analyze them.

But then, how do I get the filtered data to Moz? I *could* set up
my own local POP server and forward all messages there... that
seems like overkill.

Thanks for any insight...


Hal



9 Answers

James Britt

11/10/2004 1:23:00 AM

0

Hal Fulton wrote:

> Is there any Ruby code out there that can interact with Mozilla
> (email, I mean)?
>
> I'm interested in both browsing and email, but right now I am
> looking at email primarily.
>
> For example, I'd like to write Ruby code of my own to filter spam.
> So I'd like to connect to the remote POP server (pretty easy) and
> grab the messages and analyze them.

I'm doing something like that myself, with qmail, spamassasin, and Ruby.

I have a cron job on the mail server that checks mail and deletes items
that meet obvious spam criteria. I have another Ruby script that gets
passed mail after spamassasin has rendered judgment. That would be the
better place to delete obvious crap, but I don't know how to do this
without annoying qmail, which expects to be passed something once Ruby
is done with it.

I believe there are ways to do some conditional stuff in .qmail files,
but I haven't had the time to figure it out.

I'm reluctant to experiment too much to soon, for fear of losing mail.

>
> But then, how do I get the filtered data to Moz? I *could* set up
> my own local POP server and forward all messages there... that
> seems like overkill.

Is this for a machine that does not currently have a mail server
running? Or are you looking to pull mail down to your local machine,
processes it, and then pass it to Mozilla?

I wonder if you can just write the mail to the mail files directly?

Or run a local "mail" proxy so that Mozilla thinks it is fetching mail,
but is really just getting passed files from disk.

James


Jan Krüger

11/10/2004 1:42:00 AM

0

Hal Fulton wrote:
> Is there any Ruby code out there that can interact with Mozilla
> (email, I mean)?
>
> I'm interested in both browsing and email, but right now I am
> looking at email primarily.
>
> For example, I'd like to write Ruby code of my own to filter spam.
> So I'd like to connect to the remote POP server (pretty easy) and
> grab the messages and analyze them.
>
> But then, how do I get the filtered data to Moz? I *could* set up
> my own local POP server and forward all messages there... that
> seems like overkill.
>
> Thanks for any insight...
>
>
> Hal

Hi Hal,

http://rbxpcom.m... will get you deeply involved with Mozillas
intestines. However, once you got it running you will be awarded with
a Mozilla that really loves ruby or a ruby taht really loves Mozilla,
i hope.

I just hope, i never got it going, i didn't even try so far ...
Thats because of:

"2001-08-12 Version 0.0.4 is released."

as news entry.

For your convenience:
http://rbxpcom.m...no_wrap/doc/index.html
http://rbxpcom.m...download/rbXPCOM-0-0-4.tar.gz

GruÃ?
Jan


Daun Jaun

11/10/2004 3:30:00 AM

0

Hi Guys,

I want to know how headers are to be formatted so that I can
request pages from the webserver that expect cookies..,

## I also dont know whether cookies are to be stored in the
## header itself or there is something else but all that post
## takes it path,query and header so ...?

My basic requirement is to do something like this

h=Net::HTTP.new(url,port)

resp,data=h.post(path,query_string,header)

Now I want to send cookies to the url..path so as to get the proper response;

Not knowing how to do this I have been stuck for more than a week not
proceeding further in my project

I am under tremendous pressure and I need help!

Please help me with this problem.

Thanx
Daun Jaun


Hal E. Fulton

11/10/2004 7:15:00 AM

0

James Britt wrote:
>
> I'm reluctant to experiment too much to soon, for fear of losing mail.
>

As am I.

> Is this for a machine that does not currently have a mail server
> running? Or are you looking to pull mail down to your local machine,
> processes it, and then pass it to Mozilla?

Right, my local box doesn't have a mail server (at least not that I use).
My pop server is on my web provider's box.

> I wonder if you can just write the mail to the mail files directly?
>
> Or run a local "mail" proxy so that Mozilla thinks it is fetching mail,
> but is really just getting passed files from disk.

Whatever's easier.

If you have further thoughts, let me know...


Thanks,
Hal




Hal E. Fulton

11/10/2004 7:18:00 AM

0

Jan Krüger wrote:
> http://rbxpcom.m... will get you deeply involved with Mozillas
> intestines. However, once you got it running you will be awarded with a
> Mozilla that really loves ruby or a ruby taht really loves Mozilla, i hope.

Thanks for this very interesting link.

> I just hope, i never got it going, i didn't even try so far ...
> Thats because of:
>
> "2001-08-12 Version 0.0.4 is released."

Yes, that makes me hesitate also. That is nearly four years old.


Hal



Frederick Ros

11/10/2004 1:18:00 PM

0

Hal Fulton wrote:

> For example, I'd like to write Ruby code of my own to filter spam.
> So I'd like to connect to the remote POP server (pretty easy) and
> grab the messages and analyze them.

Hi Hal,

On the same point you can also perhaps experiment with Gurgitate-mail :

http://www.dagbrown.com/software/gurgi...

a Ruby mail filter, that allow to write rules as ruby code ....

Hope this helps.

Best Regards.
Fred.

Gavin Kistner

11/10/2004 2:49:00 PM

0

On Nov 10, 2004, at 12:17 AM, Hal Fulton wrote:
>> "2001-08-12 Version 0.0.4 is released."
> Yes, that makes me hesitate also. That is nearly four years old.

Insofar as 3 ~= 4 ? :)



James Britt

11/10/2004 3:05:00 PM

0

Hal Fulton wrote:

> James Britt wrote:
>
>>
>> I'm reluctant to experiment too much to soon, for fear of losing mail.
>>
>
> As am I.
>
>> Is this for a machine that does not currently have a mail server
>> running? Or are you looking to pull mail down to your local machine,
>> processes it, and then pass it to Mozilla?
>
>
> Right, my local box doesn't have a mail server (at least not that I use).
> My pop server is on my web provider's box.
>
>> I wonder if you can just write the mail to the mail files directly?
>>
>> Or run a local "mail" proxy so that Mozilla thinks it is fetching
>> mail, but is really just getting passed files from disk.
>
>
> Whatever's easier.
>
> If you have further thoughts, let me know...

I have full access to my mail server, and had two motivations o try to
address spam n the server, rather than on the client. One was to reduce
the amount of mail that gets downloaded, so that the good mail arrives
faster, and Thunderbird (and hence my poor laptop) spends less time
processing crap. This is more valuable when I am traveling and have a
dubious Internet connection.

The other reason was that Thunderbird, nice as it is, has a stupid bug
where it simply stops fetching mail for a given account if it finds a
mail item with screwed up headers. And it may stop fetching mail and
not even give a warning. :(

So I set about getting SpamAsasin to play nice with QMail, which was not
so hard, and wrote some scripts to inspect mail. The cron job script
could likely be useful either on the server or on the client. It takes
a set of mail names and passwords, and a set of spam words and phrases,
and checks the mail for each account. If a mail item contains any of
the spam phrases, I write the message to a side folder on the server and
delete it from the mail spool. It never reaches my home machine. I
periodically check that folder to see what is going in there, and delete
the obvious crap (so far, all of it has been crap. No one I know is
trying to give me a Rolex and Viagra and take me to a casino).

This is something you could just as easily do on the client. As for
actually filtering spam, I run SpamAssassin on the client. I hope to
move that to the server at some point though. Client-side Spamassasin
(on Win2k at least) runs as a local mail proxy; you tell the mail client
to log into SpamAssassin, and SA in turn goes and fetches the mail,
examines it, and passes it through; the bad mail gets munged so that the
client can better deal with it.

Offhand, I don't see this as being hard to emulate with Ruby (someone
may have already done this). I *think* all the proxy needs to do is
pass back a series of mail messages. I don't know if they should come
back as one big string, or if there is some protocol for passing back a
series single messages while indicating if there are more to come.
Worth a look perhaps. RCF time.

I may try this myself, or first see what Gurgitate-mail does (thanks, Fred!)

James


Hal E. Fulton

11/10/2004 4:28:00 PM

0

Gavin Kistner wrote:
> On Nov 10, 2004, at 12:17 AM, Hal Fulton wrote:
>
>>> "2001-08-12 Version 0.0.4 is released."
>>
>> Yes, that makes me hesitate also. That is nearly four years old.
>
> Insofar as 3 ~= 4 ? :)
>

For sufficiently large values of 3, yes. :)

Hal