treize has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks,
I come before you today seeking your wisdom and advice on using the Mail::IMAPClient module.
I have an email with the following subject:
test email "abc123" approved
When I search for this email as follows, I find the email:
my @uids = $imap->search("SUBJECT \"test email \"abc123\"\"")However, if I try to search for the full subject name, I cannot find the email:
my @uids = $imap->search("SUBJECT \"test email \"abc123\" approved\"")I've tried various other ways to search but to no avail. I only have this issue when double quotes are in the subject.
Has anyone experienced this before? Any help/advice would be great.
Thanks!
Update:
Here is the code I am using to search for a new email on my work's exchange server based on subject, to and from email addresses:
my $searchSubject = 'test email "abc123" approved'; sub search { my ($mailbox, $folder, $searchSubject, $searchFromAddress, $se +archToAddress) = @_; #Connecting to mailbox ... $imap->examine($folder); $imap->Uid(1); my @uids = $imap->search('UNSEEN', 'SUBJECT', $searchSubject, +'HEADER', 'FROM', $searchFromAddress, 'HEADER', 'TO', $searchToAddres +s);
If $searchSubject has double quotes in it, my code hangs at the $imap->search command.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mail::IMAPClient and searching email subjects with double quotes
by Corion (Patriarch) on May 14, 2014 at 09:11 UTC | |
by treize (Novice) on May 14, 2014 at 15:10 UTC | |
|
Re: Mail::IMAPClient and searching email subjects with double quotes
by jeffa (Bishop) on May 13, 2014 at 21:39 UTC | |
by treize (Novice) on May 13, 2014 at 21:53 UTC | |
by jeffa (Bishop) on May 13, 2014 at 22:13 UTC | |
by treize (Novice) on May 14, 2014 at 15:04 UTC |