@@ -35,6 +35,7 @@ public function __construct(private readonly rcube_imap_generic $imap)
3535 {
3636 }
3737
38+ #[\Override]
3839 public function connect (string $ host , int $ port , string $ user , string $ password , array $ options ): void
3940 {
4041 $ options ['port ' ] = $ port ;
@@ -44,11 +45,13 @@ public function connect(string $host, int $port, string $user, string $password,
4445 }
4546 }
4647
48+ #[\Override]
4749 public function close (): void
4850 {
4951 $ this ->imap ->closeConnection ();
5052 }
5153
54+ #[\Override]
5255 public function listFolders (): array
5356 {
5457 $ folders = $ this ->imap ->listMailboxes ('' , '* ' );
@@ -59,18 +62,21 @@ public function listFolders(): array
5962 return array_values (array_map ('strval ' , $ folders ));
6063 }
6164
65+ #[\Override]
6266 public function getHierarchyDelimiter (): string
6367 {
6468 $ delimiter = $ this ->imap ->getHierarchyDelimiter ();
6569
6670 return is_string ($ delimiter ) && $ delimiter !== '' ? $ delimiter : '/ ' ;
6771 }
6872
73+ #[\Override]
6974 public function createFolder (string $ folder ): bool
7075 {
7176 return $ this ->imap ->createFolder ($ folder );
7277 }
7378
79+ #[\Override]
7480 public function selectFolder (string $ folder ): int
7581 {
7682 $ status = $ this ->imap ->status ($ folder , ['MESSAGES ' ]);
@@ -81,6 +87,7 @@ public function selectFolder(string $folder): int
8187 return (int ) ($ status ['MESSAGES ' ] ?? 0 );
8288 }
8389
90+ #[\Override]
8491 public function getFolderSize (string $ folder ): int
8592 {
8693 if ($ this ->supportsStatusSize ()) {
@@ -108,6 +115,7 @@ public function getFolderSize(string $folder): int
108115 return $ totalSize ;
109116 }
110117
118+ #[\Override]
111119 public function getQuota (string $ folder ): ?array
112120 {
113121 $ quota = $ this ->imap ->getQuota ($ folder );
@@ -121,6 +129,7 @@ public function getQuota(string $folder): ?array
121129 ];
122130 }
123131
132+ #[\Override]
124133 public function supportsStatusSize (): bool
125134 {
126135 if ($ this ->statusSizeSupported === null ) {
@@ -130,6 +139,7 @@ public function supportsStatusSize(): bool
130139 return $ this ->statusSizeSupported ;
131140 }
132141
142+ #[\Override]
133143 public function fetchMessageIdentities (string $ folder ): array
134144 {
135145 $ totalMessages = $ this ->selectFolder ($ folder );
@@ -160,6 +170,7 @@ public function fetchMessageIdentities(string $folder): array
160170 return $ identities ;
161171 }
162172
173+ #[\Override]
163174 public function fetchMessageRaw (string $ folder , int $ uid ): ?array
164175 {
165176 $ messages = $ this ->imap ->fetch ($ folder , (string ) $ uid , true , ['UID ' , 'RFC822 ' , 'FLAGS ' , 'INTERNALDATE ' ]);
@@ -179,6 +190,7 @@ public function fetchMessageRaw(string $folder, int $uid): ?array
179190 ];
180191 }
181192
193+ #[\Override]
182194 public function appendMessage (string $ folder , string $ rawMessage , array $ flags , ?string $ internalDate ): bool
183195 {
184196 $ message = $ rawMessage ;
@@ -193,7 +205,11 @@ public function appendMessage(string $folder, string $rawMessage, array $flags,
193205 throw new RoundcubeImapSyncException ($ errorMessage );
194206 }
195207
196- return $ result ;
208+ // rcube_imap_generic::append returns mixed: false on failure, true on
209+ // plain success, or the appended UID (string) when the server supports
210+ // UIDPLUS. Our interface only contracts a bool, so collapse the
211+ // success cases to true.
212+ return (bool ) $ result ;
197213 }
198214
199215 /**
0 commit comments