[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Getting emails with IMAP generates BadResponseError

ruby

10/31/2006 3:37:00 PM

Hi,

I have a problem with getting emails from a special account when I will
try to get the emails via IMAP (no SSL).
Here is an example code:

imap = Net::IMAP.new('imaphost')
imap.login('user', 'pw')
imap.examine('INBOX')
imap.search("ALL").each do |message_id|
....
end
imap.logout
imap.disconnect

This works fine with other accounts!
The error occurred in line with imap.search:

/usr/local/lib/ruby/1.8/net/imap.rb:972:in `get_tagged_response':
Protocol error: command unknown or arguments invalid
(Net::IMAP::BadResponseError)

My Ruby version is: 1.8.2 (2004-12-25) [i686-linux]

A "puts imap.capability" on a "good" account shows me:
IMAP4
IMAP4REV1
IDLE
AUTH=LOGIN
AUTH=CRAM-MD5
UNSELECT
LITERAL+

For the account with the error I get only:
IMAP4REV1

I don't know if this could help, I am not an expert in IMAP.
I hope someone can help.

Thanks.

6 Answers

Ara.T.Howard

10/31/2006 3:57:00 PM

0

ruby

11/2/2006 8:07:00 AM

0

I try it and get following output:

S: * OK IMAP4rev1 DvISE Mail Access Server MA-8.10a (0126)
C: RUBY0001 LOGIN xxx xxx
S: RUBY0001 OK LOGIN completed
C: RUBY0002 CAPABILITY
S: * CAPABILITY IMAP4rev1
S: RUBY0002 OK CAPABILITY completed
IMAP4REV1
C: RUBY0003 EXAMINE InBOX
S: * 795 EXISTS
S: * 64 Recent
S: * FLAGS (\Deleted \Seen)
S: * OK [UIDVALIDITY 1154014055] UIDs valid
S: RUBY0003 OK [READ-WRITE] SELECT completed
C: RUBY0004 SEARCH ALL
S: RUBY0004 BAD Protocol error: command unknown or arguments invalid
/usr/local/lib/ruby/1.8/net/imap.rb:972:in `get_tagged_response':
Protocol error: command unknown or arguments invalid
(Net::IMAP::BadResponseError)
....

There are 795 mails, this looks good, but I have no idea what is wrong?



ara.t.howard@noaa.gov schrieb:

> On Wed, 1 Nov 2006 ruby@diekennichnicht.de wrote:
>
> > Hi,
> >
> > I have a problem with getting emails from a special account when I will
> > try to get the emails via IMAP (no SSL).
> > Here is an example code:
> >
> > imap = Net::IMAP.new('imaphost')
> > imap.login('user', 'pw')
> > imap.examine('INBOX')
> > imap.search("ALL").each do |message_id|
> > ...
> > end
> > imap.logout
> > imap.disconnect
> >
> > This works fine with other accounts!
> > The error occurred in line with imap.search:
> >
> > /usr/local/lib/ruby/1.8/net/imap.rb:972:in `get_tagged_response':
> > Protocol error: command unknown or arguments invalid
> > (Net::IMAP::BadResponseError)
> >
> > My Ruby version is: 1.8.2 (2004-12-25) [i686-linux]
> >
> > A "puts imap.capability" on a "good" account shows me:
> > IMAP4
> > IMAP4REV1
> > IDLE
> > AUTH=LOGIN
> > AUTH=CRAM-MD5
> > UNSELECT
> > LITERAL+
> >
> > For the account with the error I get only:
> > IMAP4REV1
>
> this is bascially telling you the server does nothing for this accnt... which
> seems odd.
>
> try adding this to the beginning of your script
>
> Net::IMAP::debug = true
>
> and seeing if it gives you more information.
>
>
> ps. http://www.ietf.org/rfc/r...
>
> -a
> --
> my religion is very simple. my religion is kindness. -- the dalai lama

HHW

11/7/2009 4:34:00 AM

0

On Nov 6, 4:49 am, Honest truth <Honest_tr...@Wisdom.net> wrote:
> On Thu, 5 Nov 2009 13:58:06 -0800 (PST), iconocl...@yahoo.com wrote:
> > Neither were the Palestinian Arabs responsible for what George
> > described nor are they today responsible for Hitler's crimes.
>
> And when did Lloyd George suggest they were.

If you use a ninety year old quote in the present context it's going
to be looked at very carefully. It doesn't fit.
>
> --
> “Of all the extreme fanaticism which plays havoc in man’s nature, there is
> not one as irrational as anti-Semitism. … If the Jews are rich [these
> fanatics] are victims of theft. If they are poor, they are victims of
> ridicule. If they take sides in a war, it is because they wish to take
> advantage from the spilling of non-Jewish blood. If they espouse peace, it
> is because they are scared by their natures or traitors. If the Jew dwells
> in a foreign land he is persecuted and expelled. If he wishes to return to
> his own land, he is prevented from doing so.”
>
> Lloyd George

HHW

11/9/2009 11:44:00 PM

0

On Nov 7, 4:47 am, Honest truth <Honest_tr...@Wisdom.net> wrote:
> On Fri, 6 Nov 2009 20:33:33 -0800 (PST), iconocl...@yahoo.com wrote:
> > On Nov 6, 4:49 am, Honest truth <Honest_tr...@Wisdom.net> wrote:
> >> On Thu, 5 Nov 2009 13:58:06 -0800 (PST), iconocl...@yahoo.com wrote:
> >>> Neither were the Palestinian Arabs responsible for what George
> >>> described nor are they today responsible for Hitler's crimes.
>
> >> And when did Lloyd George suggest they were.
>
> > If you use a ninety year old quote in the present context it's going
> > to be looked at very carefully. It doesn't fit.
>
> Do not continue to play the fool, its you that are trying not to make it
> fit.

Of course I am! That's my side of the argument. If I can get you to
sit still for a few moments I'll defeat you decisively.


> >> --
> >> “Of all the extreme fanaticism which plays havoc in man’s nature, there is
> >> not one as irrational as anti-Semitism. … If the Jews are rich [these
> >> fanatics] are victims of theft. If they are poor, they are victims of
> >> ridicule. If they take sides in a war, it is because they wish to take
> >> advantage from the spilling of non-Jewish blood. If they espouse peace, it
> >> is because they are scared by their natures or traitors. If the Jew dwells
> >> in a foreign land he is persecuted and expelled. If he wishes to return to
> >> his own land, he is prevented from doing so.”
>
> >> Lloyd George
>
> --
> “Of all the extreme fanaticism which plays havoc in man’s nature, there is
> not one as irrational as anti-Semitism. … If the Jews are rich [these
> fanatics] are victims of theft. If they are poor, they are victims of
> ridicule. If they take sides in a war, it is because they wish to take
> advantage from the spilling of non-Jewish blood. If they espouse peace, it
> is because they are scared by their natures or traitors. If the Jew dwells
> in a foreign land he is persecuted and expelled. If he wishes to return to
> his own land, he is prevented from doing so.”
>
> Lloyd George

HHW

11/9/2009 11:46:00 PM

0

On Nov 7, 9:51 am, "Fish Supper" <l...@sea.com> wrote:
> "iconocl...@yahoo.com" <coaster132...@yahoo.com> wrote in message
>
> news:e7e9249d-4026-4070-be6d-380e34d281fe@g10g2000pri.googlegroups.com...
> On Nov 6, 4:49 am, Honest truth <Honest_tr...@Wisdom.net> wrote:
>
> > On Thu, 5 Nov 2009 13:58:06 -0800 (PST), iconocl...@yahoo.com wrote:
> > > Neither were the Palestinian Arabs responsible for what George
> > > described nor are they today responsible for Hitler's crimes.
>
> > And when did Lloyd George suggest they were.
>
> If you use a ninety year old quote in the present context it's going
> to be looked at very carefully. It doesn't fit.
>
>
>
> > --
> > “Of all the extreme fanaticism which plays havoc in man’s nature, there is
> > not one as irrational as anti-Semitism. … If the Jews are rich [these
> > fanatics] are victims of theft. If they are poor, they are victims of
> > ridicule. If they take sides in a war, it is because they wish to take
> > advantage from the spilling of non-Jewish blood. If they espouse peace, it
> > is because they are scared by their natures or traitors. If the Jew dwells
> > in a foreign land he is persecuted and expelled. If he wishes to return to
> > his own land, he is prevented from doing so.”
>
> > Lloyd George
>
> This is the tiresome nonsense that the zionists spout continuously, that to
> be anti-Israel is to be anti-semitic. Absolute drivel and intended to
> deflect any criticism of that barbaric state.

It's certainly a state whose leadership has acted barbarically over
and over again and continues to do so.

HHW

11/9/2009 11:48:00 PM

0

On Nov 7, 4:30 pm, Gary Renzetti <lizg...@connection.com> wrote:
> Honest truth wrote:
> > On Fri, 6 Nov 2009 20:33:33 -0800 (PST), iconocl...@yahoo.com wrote:
>
> >> On Nov 6, 4:49 am, Honest truth <Honest_tr...@Wisdom.net> wrote:
> >>> On Thu, 5 Nov 2009 13:58:06 -0800 (PST), iconocl...@yahoo.com wrote:
> >>>> Neither were the Palestinian Arabs responsible for what George
> >>>> described nor are they today responsible for Hitler's crimes.
> >>> And when did Lloyd George suggest they were.
> >> If you use a ninety year old quote in the present context it's going
> >> to be looked at very carefully. It doesn't fit.
>
> > Do not continue to play the fool, its you that are trying not to make it
> > fit.
>
> I don't think that this turkey would recognize "honest truth" if it were
> to take a shit in his kippa.
>
>
>
>
>
> >>> --
> >>> “Of all the extreme fanaticism which plays havoc in man’s nature, there is
> >>> not one as irrational as anti-Semitism. … If the Jews are rich [these
> >>> fanatics] are victims of theft. If they are poor, they are victims of
> >>> ridicule. If they take sides in a war, it is because they wish to take
> >>> advantage from the spilling of non-Jewish blood. If they espouse peace, it
> >>> is because they are scared by their natures or traitors. If the Jew dwells
> >>> in a foreign land he is persecuted and expelled. If he wishes to return to
> >>> his own land, he is prevented from doing so.”
>
> >>> Lloyd George- Hide quoted text -
>
> - Show quoted text -

He's not willing even to debate the applicability of his own
postscript.