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.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |