Bug #73640 [NEW]: imap_search can't search HEADER
| From: | sistemisti-posta at csi dot it | Date: | Fri, 02 Dec 2016 08:51:30 +0000 |
| Subject: | Bug #73640 [NEW]: imap_search can't search HEADER | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-205731@lists.php.net to get a copy of this message | ||
From: sistemisti-posta at csi dot it
Operating system:
PHP version: 7.0.13
Package: IMAP related
Bug Type: Bug
Bug description:imap_search can't search HEADER
Description:
------------
imap_search can't search all headers released by IMAP protocol (RFC
3501).
See at https://tools.ietf.org/html/rfc3501#section-6.4.4
You can perform the following command:
HEADER <field-name> <string>
But this option is not allowed from PHP imap_search.
Expected result:
----------------
Something like:
$string = sprintf('HEADER "%s" "%s"','Message-ID',
'dskljflsdjfskl@example.org');
imap_search($imapconn, $string, SE_UID);
This should return the uid of message with the Message-ID found.
Actual result:
--------------
At the moment, to search an header I can use this workaround:
$string = sprintf('%s "Message-ID: <%s>"','TEXT',
'dskljflsdjfskl@example.org');
imap_search($imapconn, $string, SE_UID);
But it's not safe, because with TEXT I find all occurrences of string
"Message-ID: <dskljflsdjfskl@example.org>"
in headers or body too.
--
Edit bug report at https://bugs.php.net/bug.php?id=73640&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73640&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73640&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73640&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73640&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73640&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73640&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73640&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73640&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73640&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73640&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73640&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73640&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73640&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73640&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73640&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73640&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73640&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73640&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73640&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73640&r=mysqlcfg