Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert the body to uppercase before parsing #641

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/Connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ Connection.prototype.connect = function() {
// because 'HEADER.FIELDS (TO FROM)' really is equivalent to
// 'HEADER.FIELDS ("TO" "FROM")' and some servers will actually send the
// quoted form even if the client did not use quotes
var thisbody = parseExpr(info.which);
// It also converts the body to upper case, since the IMAP RFC
// states that flags should be matched in a case insensitive
// manner.
var thisbody = parseExpr(info.which.toUpperCase());
for (var i = 0, len = toget.length; i < len; ++i) {
if (_deepEqual(thisbody, toget[i])) {
toget.splice(i, 1);
Expand Down