| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2006-11-09 01:28 UTC] loikiolki at yahoo dot ca
 Description:
------------
None of the existing IMAP functions built into PHP support fetching custom IMAP flags. Existing functions imap_setflag_full and imap_clearflag_full allow one to set custom flags, but there is no method available to fetch them back.
Reproduce code:
---------------
<?
    // clear custom flag
    imap_setflag_full($mbox, $msg_id, '$Label2');
    // set custom flag
    imap_setflag_full($mbox, $msg_id, '$Label1');
    // fetch the flag - we need this!
    if (imap_fetchflag_full($mbox, $msg_id, '$Label1'))
        echo "Flag \$Label1 is set\n";
    else
        echo "Flag \$Label1 is not set\n";
    // also, maybe include custom flags in functions
    // such as imap_headerinfo() to fetch all set flags
    // (not sure if this is possible with IMAP protocol)
Expected result:
----------------
Flag $Label1 is set
Actual result:
--------------
Fatal error: Call to undefined function imap_fetchflag_full() in Command line code on line 1
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 09:00:01 2025 UTC | 
Just look at perl: my $imap = Net::IMAP::Simple->new('imap.example.com', SSL_version => 'SSLv3 SSLv2 TLSv1', use_ssl => 0) || die "Unable to connect to IMAP: $Net::IMAP::Simple::errstr\n"; if(!$imap->login('user@example.com','passw0rd')){ print STDERR "Login failed: " . $imap->errstr . "\n"; exit(64); } print "Available server flags: " . join(", ", $imap->flags) . "\n"; my @ids = $imap->search("SUBJECT \"V14gr4\" "); my $count = scalar @ids; print "Emails found: $count\n"; foreach (@ids) { my $flags = $imap->msg_flags($_); print "Flags on message $_: $flags\n"; } ----------- This results in an output like this showing all the flags, including the ones set with RoudCube using PHP: Emails found: 1 Flags on message 30: \Seen JUNK