Code Monkey home page Code Monkey logo

Comments (2)

smiley22 avatar smiley22 commented on July 20, 2024

Hello and thanks for reporting!

I don't know of the top of my head if IMAP dictates that the search string
be quoted...I'm rather busy at the moment but will look into it as soon as
I can.

smiley22

On Mon, May 6, 2013 at 9:59 AM, brad0000 [email protected] wrote:

Hi, I'm a first time user of this lib, so forgive me if I'm missing
something (and it might be something specific to my imap server?), but as
far as I can see there's a bug when searching by header value. e.g:

var uids = imapClient.Search(SearchCondition.Header("Message-ID", "whatever"));

throws BadServerResponseException - "xml003 BAD Missing required argument
to Search header"

The actual imap command being sent to the server in this case is:

xm003 UID SEARCH HEADER "Message-ID "whatever""

I had a look at the imap spec and that outer set of quotes looked
unnecessary, so I changed the SearchCondition.Header(string, string) method
to return a condition object with Quote=false, instead of the default
Quote=true. That resulted in a command like this:

xm003 UID SEARCH HEADER Message-ID "whatever"

Which resolved the problem. Is that a bug? Or am I missing something?

Change made to SearchCondition.cs:

public static SearchCondition Header(string name, string text) {
return new SearchCondition() {
Field = Fields.Header,
Value = name + " " + text.QuoteString(),
Quote = false, // inserted this line
};
}


Reply to this email directly or view it on GitHubhttps://github.com//issues/52
.

from s22.imap.

smiley22 avatar smiley22 commented on July 20, 2024

fixed, see #66

from s22.imap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.