@@ -429,7 +429,7 @@ impl MailBackend for NntpType {
429429 _mailbox_hash : MailboxHash ,
430430 _flags : Option < Flag > ,
431431 ) -> ResultFuture < ( ) > {
432- Err ( Error :: new ( "NNTP doesn't support saving." ) )
432+ Err ( Error :: new ( "NNTP doesn't support saving." ) . set_kind ( ErrorKind :: NotSupported ) )
433433 }
434434
435435 fn copy_messages (
@@ -439,7 +439,7 @@ impl MailBackend for NntpType {
439439 _destination_mailbox_hash : MailboxHash ,
440440 _move_ : bool ,
441441 ) -> ResultFuture < ( ) > {
442- Err ( Error :: new ( "NNTP doesn't support copying/moving." ) )
442+ Err ( Error :: new ( "NNTP doesn't support copying/moving." ) . set_kind ( ErrorKind :: NotSupported ) )
443443 }
444444
445445 fn set_flags (
@@ -504,7 +504,7 @@ impl MailBackend for NntpType {
504504 _env_hashes : EnvelopeHashBatch ,
505505 _mailbox_hash : MailboxHash ,
506506 ) -> ResultFuture < ( ) > {
507- Err ( Error :: new ( "NNTP doesn't support deletion." ) )
507+ Err ( Error :: new ( "NNTP doesn't support deletion." ) . set_kind ( ErrorKind :: NotSupported ) )
508508 }
509509
510510 fn as_any ( & self ) -> & dyn std:: any:: Any {
@@ -525,7 +525,7 @@ impl MailBackend for NntpType {
525525 ) -> ResultFuture < ( MailboxHash , HashMap < MailboxHash , Mailbox > ) > {
526526 Err (
527527 Error :: new ( "Creating mailbox is not supported for nntp backend." )
528- . set_kind ( ErrorKind :: NotImplemented ) ,
528+ . set_kind ( ErrorKind :: NotSupported ) ,
529529 )
530530 }
531531
@@ -593,7 +593,9 @@ impl MailBackend for NntpType {
593593 let mut conn = timeout ( timeout_dur, connection. lock ( ) ) . await ?;
594594 let stream = conn. stream . as_ref ( ) ?;
595595 if !stream. supports_submission {
596- return Err ( Error :: new ( "Server prohibits posting." ) ) ;
596+ return Err (
597+ Error :: new ( "Server prohibits posting." ) . set_kind ( ErrorKind :: NotSupported )
598+ ) ;
597599 }
598600 // [ref:TODO] normalize CRLF in `bytes`
599601 let mut res = String :: with_capacity ( 8 * 1024 ) ;
0 commit comments