Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   net/imap - imap.search "TO" can't find email (http://www.velocityreviews.com/forums/t849712-net-imap-imap-search-to-cant-find-email.html)

jasonnaylor 04-16-2008 03:46 AM

net/imap - imap.search "TO" can't find email
 
I'm having trouble with the "search" feature of Net::IMAP. I'm
attempting to search for a message "TO" a particular recipient.

The email recipient is something like:

080416w_test@this.dom.ain

A search function of:

imap.search(["TO", "080416w_test@this.dom.ain"])

.... simply returns nothing. By removing the mailbox details and only
searching for the domain:

imap.search(["TO", "@this.dom.ain"])

.... I return results. In fact, I can build the "TO" string as long
as:

imap.search(["TO", "_test@this.dom.ain"])

.... and results are returned.

What don't I understand? Is it my limited knowledge of Ruby, or the
imap.search I'm not understanding???

Note: Here's the fetch "ENVELOPE" of the mail I'm after:

irb(main):073:0* imap.fetch(1179, "ENVELOPE")
<... snip...>
, to=[#<struct Net::IMAP::Address name="080416w_test@this.dom.ain",
route=nil, mailbox="080416w_test", host="this.dom.ain">]
<... snip...>

jasonnaylor 04-16-2008 04:05 AM

Re: net/imap - imap.search "TO" can't find email
 
Interestingly, I can find the following (another entirely different
message):

irb(main):107:0> imap.search(["TO", "080416z@this.dom.ain"])
=> [1174]

So it appears something about the "_" character in the mailbox of the
previous search might be the culprit:

`080416w_test@this.dom.ain`


All times are GMT. The time now is 01:17 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57