Subject: | UID question/bug |
Date: | Thu, 17 May 2018 02:23:16 -0400 |
To: | bug-Net-IMAP-Simple [...] rt.cpan.org |
From: | Kurt <kurt [...] otown.com> |
I modified the example as follows:
Show quoted text
> for(my $i = 1; $i <= $nm; $i++){
> if($imap->seen($i)){
> print "*";
> } else {
> print " ";
> }
> my $es = Email::Simple->new(join '', @{ $imap->top($i) } );
> print $es->header('Delivery-date');
> my $uid = $imap->uid("$i");
> print qq{\t$i:$uid\n};
> }
> $imap->quit;
Gives the output:
*Fri, 20 Oct 2017 23:12:49 -0400 1:1
*Sun, 05 Nov 2017 14:52:59 -0500 2:1
*Sun, 31 Dec 2017 17:28:18 -0500 3:1
*Sun, 31 Dec 2017 17:30:09 -0500 4:1
*Sat, 20 Jan 2018 19:42:42 -0500 5:1
*Sun, 21 Jan 2018 00:34:43 -0500 6:1
*Sun, 18 Feb 2018 00:17:27 -0500 7:1
*Sun, 18 Feb 2018 10:17:21 -0500 8:1
*Mon, 19 Mar 2018 06:00:12 -0400 9:1
*Mon, 26 Mar 2018 11:59:26 -0400 10:1
*Mon, 26 Mar 2018 11:59:32 -0400 11:1
*Thu, 05 Apr 2018 11:59:27 -0400 12:1
*Fri, 06 Apr 2018 11:59:41 -0400 13:1
Not clear why the UID is always 1?
Is the UID DERIVED from the message? Or simply assigned during a session?
Basically, I’m deleting emails based on age, but since I don’t know how the order of messages is determined (age? size? randomly?) does deleting one change the positions of others in the sequence?
It appears that deleting a message only marks a message for deletion, and that the actual deletion only takes place at the END of the session, and that the sequence of messages doesn’t change in between (unless “expunged”?) and that such automatically happens at the end of a session (and if that’s all true, then maybe I don’t even need the UID) - but I’m not sure.
Any help would be appreciated.
Thanks.
Kurt