From 2d732b9a73d9d2a912a14846e8368197830b8451 Mon Sep 17 00:00:00 2001 From: Oskar Eichler <62393985+OskarEichler@users.noreply.github.com> Date: Sun, 30 Aug 2026 15:15:59 +0700 Subject: [PATCH] Cache missing POP message unique IDs --- lib/net/pop.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/net/pop.rb b/lib/net/pop.rb index af4948c..4260769 100644 --- a/lib/net/pop.rb +++ b/lib/net/pop.rb @@ -699,6 +699,7 @@ def reset mails().each do |m| m.instance_eval { @deleted = false + @uid_fetched = false if @uid.nil? } end end @@ -747,6 +748,7 @@ def initialize(num, len, pop, cmd) #:nodoc: @command = cmd @deleted = false @uid = nil + @uid_fetched = false end # The sequence number of the message on the server. @@ -872,7 +874,7 @@ def deleted? # # This method raises a POPError if an error occurs. def unique_id - return @uid if @uid + return @uid if @uid_fetched @pop.set_all_uids @uid end @@ -881,6 +883,7 @@ def unique_id def uid=(uid) #:nodoc: internal use only @uid = uid + @uid_fetched = true end end # class POPMail