[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

E-mail library for Ruby?

Just Another Victim of the Ambient Morality

3/21/2007 4:23:00 AM

Okay, I'll detail my problem and, hopefully, people can suggest a
solution to me.
I have an account on a Linux machine that I use as my e-mail address. I
use Pine as my mail client. I have let my inbox accumulate e-mail for years
and there is now too much e-mail queued up for my tastes. Now, I don't want
to delete my e-mail. Instead, I want archive it to various e-mail folders
like how I would have if I used Pine. I could do this by hand, using Pine,
except that there is simply too much e-mail for me to do this in any
reasonable time.
So, I think my solution is to automate this sorting using something like
Ruby and an appropriate library. Does anyone know what Ruby library I'm
looking for?
Thank you...


14 Answers

Damjan Rems

3/21/2007 6:47:00 AM

0

Just Another Victim of the Am Morality wrote:
> Okay, I'll detail my problem and, hopefully, people can suggest a
> solution to me.
> I have an account on a Linux machine that I use as my e-mail
> address. I
> use Pine as my mail client. I have let my inbox accumulate e-mail for
> years
> and there is now too much e-mail queued up for my tastes. Now, I don't
> want
> to delete my e-mail. Instead, I want archive it to various e-mail
> folders
> like how I would have if I used Pine. I could do this by hand, using
> Pine,
> except that there is simply too much e-mail for me to do this in any
> reasonable time.
> So, I think my solution is to automate this sorting using something
> like
> Ruby and an appropriate library. Does anyone know what Ruby library I'm
> looking for?
> Thank you...

If You have imap access you can do this. This is excerpt from my program
which is cleaning postmaster box.

aDelete=Array.new
aMove=Array.new
imap = Net::IMAP.new('mail.domain.com')
imap.login('user', 'pwd')
imap.select('Inbox')
n = imap.search(["SINCE", "1-Jan-1969"])
listInbox = imap.fetch(n, ["ENVELOPE","UID"] )
listInbox.each do | a |
if (a.attr["ENVELOPE"].subject[0..14] == "Discarded Mail:" or
a.attr["ENVELOPE"].subject[0..16] == "Quarantined Mail:") then
aMove.push(a.attr["UID"]) # either move
aDelete.push(a.attr["UID"]) # or delete
end
end
# Move to other folder
if aMove.length > 0
imap.uid_copy(aMove,"FolderToMove")
imap.uid_store(aMove, "+FLAGS", [:Deleted])
end
# Delete msgs
imap.uid_store(aDelete, "+FLAGS", [:Deleted]) if aDelete.length > 0
# Expunge msgs marked for deletion
imap.expunge
imap.close

by

TheR

--
Posted via http://www.ruby-....

Damjan Rems

3/21/2007 6:49:00 AM

0

I forgot. You must also add
require 'net/imap'
at the top.


by

TheR


--
Posted via http://www.ruby-....

Richard Conroy

3/21/2007 10:56:00 AM

0

On 3/21/07, Just Another Victim of the Ambient Morality
<i_hate_spam@hotmail.com> wrote:
> So, I think my solution is to automate this sorting using something like
> Ruby and an appropriate library. Does anyone know what Ruby library I'm
> looking for?

Well there's POP3 libraries too, in addition to IMAP. And they ship
with with Ruby.
You can probably find 3rd party libraries too that are effective in
more niche mail
formats.

I would presume that you might end up using some kind of subject line pattern
matching to sort the email (especially useful for mailing lists)

Ara.T.Howard

3/21/2007 2:19:00 PM

0

Alex LeDonne

3/21/2007 8:31:00 PM

0

On 3/21/07, Just Another Victim of the Ambient Morality
<i_hate_spam@hotmail.com> wrote:
> Okay, I'll detail my problem and, hopefully, people can suggest a
> solution to me.
> I have an account on a Linux machine that I use as my e-mail address. I
> use Pine as my mail client. I have let my inbox accumulate e-mail for years
> and there is now too much e-mail queued up for my tastes. Now, I don't want
> to delete my e-mail. Instead, I want archive it to various e-mail folders
> like how I would have if I used Pine. I could do this by hand, using Pine,
> except that there is simply too much e-mail for me to do this in any
> reasonable time.

For the record: In Pine, you can enable aggregate commands, select
messages by criteria, then move them in bulk.

For step-by-step instructions to get started:
http://kb.iu.edu/data... (In Pine, how do I enable aggregate commands?)
http://kb.iu.edu/data... (In Pine, how do I perform an action
(like saving or printing) on a large number of messages at once?)

For further adventures:
http://www.google.com/search?&q=pine+enable+aggregate+c...

You can then do things like select all the messages with "ruby-talk"
in the to field, and apply the save command to save them all to a
folder.

Since you're already familiar with Pine, then using the aggregate
command set, I think you could, in fact, do this in a reasonable
amount of time by hand. :)

-Alex

Just Another Victim of the Ambient Morality

3/21/2007 10:34:00 PM

0


"Alex LeDonne" <aledonne.listmail@gmail.com> wrote in message
news:1d065ed40703211330q1346880et2aee38acb5d4e811@mail.gmail.com...
> On 3/21/07, Just Another Victim of the Ambient Morality
> <i_hate_spam@hotmail.com> wrote:
>> Okay, I'll detail my problem and, hopefully, people can suggest a
>> solution to me.
>> I have an account on a Linux machine that I use as my e-mail address.
>> I
>> use Pine as my mail client. I have let my inbox accumulate e-mail for
>> years
>> and there is now too much e-mail queued up for my tastes. Now, I don't
>> want
>> to delete my e-mail. Instead, I want archive it to various e-mail
>> folders
>> like how I would have if I used Pine. I could do this by hand, using
>> Pine,
>> except that there is simply too much e-mail for me to do this in any
>> reasonable time.
>
> For the record: In Pine, you can enable aggregate commands, select
> messages by criteria, then move them in bulk.
>
> For step-by-step instructions to get started:
> http://kb.iu.edu/data... (In Pine, how do I enable aggregate
> commands?)
> http://kb.iu.edu/data... (In Pine, how do I perform an action
> (like saving or printing) on a large number of messages at once?)
>
> For further adventures:
> http://www.google.com/search?&q=pine+enable+aggregate+c...
>
> You can then do things like select all the messages with "ruby-talk"
> in the to field, and apply the save command to save them all to a
> folder.
>
> Since you're already familiar with Pine, then using the aggregate
> command set, I think you could, in fact, do this in a reasonable
> amount of time by hand. :)

This looks very promising, thank you.
I'm a little embarrassed using a non-Ruby solution solicited from a Ruby
newsgroup...


Dimitri Aivaliotis

3/22/2007 4:17:00 PM

0

On 3/21/07, Just Another Victim of the Ambient Morality
> So, I think my solution is to automate this sorting using something like
> Ruby and an appropriate library. Does anyone know what Ruby library I'm
> looking for?

You could keep your inbox as-is, and use sup[1] to label, sort, and
search. It's Gmail for the command-line, written in Ruby.

- Dimitri

[1]: http://sup.ruby...

Dave Heil

3/18/2011 3:18:00 AM

0

On 3/17/2011 06 55, Ray Fischer wrote:
> Dave Heil<k8mn@frontiernet.net> wrote:
>> On 3/15/2011 18 24, China Blue Jay Way wrote:
>>> In article<aa736047-aec2-4963-8547-94e1cd0b2cf1@a21g2000prj.googlegroups.com>,
>>> The PHANTOM<hoofhearted07@yahoo.com> wrote:
>>>
>>>> On Mar 15, 11:41 am, China Blue Jay Way<chine.b...@yahoo.com> wrote:
>>>>> In article<2ba7$4d7f7607$4107e27c$23...@news.flashnewsgroups.com>,
>>>>>
>>>>> "Bob"<dalnet...@att.net> wrote:
>>>>>> Confidence in the U.S. system of government has dropped to a new low in
>>>>>> more
>>>>>> than 35 years, with public attitudes burdened by continued economic
>>>>>> discontent, soaring gasoline prices, record opposition to the war in
>>>>>> Afghanistan -- and a letdown in hopes for political progress after a bout
>>>>>> of
>>>>>> bipartisanship last fall.
>>>>>
>>>>> But Republicans promised they would fix everything!
>>>>>
>>>>
>>>> Only after booting the last of the progressives from leadership in
>>>> any form or fashion. If even ONE progressive is left holding a gubmint
>>>
>>> And if people don't vote the way you demand they do--then what? Free clue:
>>> voters aren't go to wait. If Boehner doesn't deliver, Republicans get voted out.
>>
>> Thus spake the voice of the anonymous foreign socialist.
>
> Ad hominem.
>
>> If The People
>> see that Republicans are making efforts and being thwarted by Dems and the
>> President, more Dems and the President may well be voted out.

> They're not.

Yeah, Wrong Ray, they are. Dems in the Senate are in the hot seat.
They must produce. Republicans ARE making efforts at real cuts in order
to put the nation's finances in order.

In fact the GOP does the opposite of what it claims in
> almost every regard.

Now you just look silly, Wrong Ray.


China Blue Veins

3/18/2011 4:20:00 AM

0

In article <w9Agp.8910$yb7.1512@newsfe11.iad>, Dave Heil <k8mn@frontiernet.net>
wrote:

> Yeah, Wrong Ray, they are. Dems in the Senate are in the hot seat.
> They must produce. Republicans ARE making efforts at real cuts in order
> to put the nation's finances in order.

Wrong, Dave. People are more worried about jobs than anything else, and they
voted Republican in desperation to increase employment. If employment increases
in the next two years, Obama is reelected and Democrats keep their seats. If
Republicans are seen as just farting around and not helping with jobs, they lose
seats. However people feel about deficits--especially if Republicans accomplish
nothing to reduce them--it's employment that will determine the elections.

The proposed cuts so far, Republican and Democrat, are trivial. The government
spends the money it does because people lobbied hard to get that money, and they
are lobbying hard to keep it. Nothing is going change until legislators have a
frank and honest discussion with voters about what has to be cut and what it
will cost: a discussion sure to piss off voters. Republicans had the opportunity
to discuss it last fall, but everytime they refused to get into specifics,
preferring to get elected on lies than to risk an election by being honest.

There are no easy cuts: Republicans have to stop lying. Until then the only
alternatives are to increase taxes to match spending or increase borrowing;
whining about that reality won't change it.

--
Damn the living - It's a lovely life. I'm whoever you want me to be.
Silver silverware - Where is the love? At least I can stay in character.
Oval swimming pool - Where is the love? Annoying Usenet one post at a time.
Damn the living - It's a lovely life. Alameda County Sheriff.

Dave Heil

3/18/2011 11:25:00 AM

0

On 3/18/2011 04 19, China Blue Meanies wrote:
> In article<w9Agp.8910$yb7.1512@newsfe11.iad>, Dave Heil<k8mn@frontiernet.net>
> wrote:
>
>> Yeah, Wrong Ray, they are. Dems in the Senate are in the hot seat.
>> They must produce. Republicans ARE making efforts at real cuts in order
>> to put the nation's finances in order.
>
> Wrong, Dave. People are more worried about jobs than anything else, and they
> voted Republican in desperation to increase employment. If employment increases

That's a nice guess on your part. It isn't just jobs; it is the entire
economy. The economy will not sustain Obamacare. The People know that
our entire future as a nation is in jeopardy over *spending*. They want
it cut. AND they want jobs. A stable economy generates jobs.

> in the next two years, Obama is reelected and Democrats keep their seats.

Now you're talking Fantasy Land. The President isn't leading in the
budget debate; he isn't demonstrating leadership over the crisis in
Japan and he hasn't led over what is taking place in Libya.

> The proposed cuts so far, Republican and Democrat, are trivial.

$6 billion of cuts, offered by Dems, is trivial. $100 billion or more,
as proposed by Republicans is real money. Chuck Shumer's statement and
Harry Reid's statements make them look sillier than they are. Their
position is untenable and they certainly are in the hot seat.