CiderW...PClient(3pm)

πŸ“¦
version 1.05+20240702 Β· 5 versions
, in debian trixie, ubuntu resolute

πŸ’– CiderWebmail::Model::IMAPClient β€” the vibe-coded docs πŸ’–

okay bestie, so this is CiderW...PClient(3pm) from the User Contributed Perl Documentation, and honestly? it's giving ✨ancient wisdom✨. buckle up πŸŽ€


🌸 NAME 🌸

CiderWebmail::Model::IMAPClient β€” it's a Catalyst Model, no cap. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

It's the interface to the IMAP Server. that's the whole job. that's what it does. 🫢

⚠️ and like, real talk: you should really read rfc3501 if you want to use this. not "skim it", not "ask an LLM about it", not "vibe it out". READ IT. the docs said it with a whole asterisk-emphasis and everything, so you know they meant it. 😭

πŸ‘‘ METHODS πŸ‘‘

🌈 new()

creates a new CiderWebmail::Model::IMAPClient. fresh baby model, brand new, main character energy. ✨

πŸ’€ _die_on_error()

okay so this one dies if the last IMAP command that got sent to the server caused an error. yes, literally dies. rip. πŸ’€

the important bit: this should be called after every command you send to the imap server. every single one. don't skip it, bestie, that's how you get mystery bugs at 3am. πŸ™ˆ

πŸ“ disconnect

disconnects from the IMAP Server, if connected. if you weren't connected, it just… doesn't. chill like that. 😌

πŸŽ€ separator()

returns the folder separator. that's it. that's the whole method. iconic minimalism. πŸ’…

🧚 folder_tree()

returns all folders as a hash-tree. whole hierarchy, all nested and cute. 🌳

⭐ folder_sort

a custom sort for folders β€” it always puts INBOX on top. as it should. INBOX is the queen, INBOX stays at the top. πŸ‘‘

πŸ’œ select({ mailbox => $mailbox })

selects a folder. done. next. ✨

🌸 message_count({ mailbox => $mailbox })

returns the number of messages in a mailbox. counting! math! we love her. πŸ”’

πŸ¦‹ unseen_count({ mailbox => $mailbox })

returns the number of unseen messages in a mailbox. the ones you've been ignoring. we see you. πŸ‘€

🌈 check_sort($sort)

checks if the given sort criteria is valid. a little vibe check for your sort param. βœ…

🫢 get_folder_uids({ mailbox => $mailbox, sort => $sort, range => $range })

returns a MessageSet object representing all UIDs in a mailbox. πŸ“¬

the range option accepts a range of UIDs β€” for example 1:100 or 1:*. and here's the tea: if you specify a range containing '*', the last (highest UID) message will always be returned. periodt. πŸ’…

πŸŽ€ get_headers_hash({ uids => [qw/ 1 .. 10 /], sort => [qw/ date /], headers => [qw/ date subject /], mailbox => 'INBOX' })

returns an array of hashes for messages in a mailbox. look at that example signature, she's gorgeous. πŸ˜­πŸ’–

  • uids (arrayref): a list of uids (as described in RFC2060) to fetch
  • sort (arrayref): sort criteria (as described in RFC2060). for example: [ qw/ date / ] will sort by date, [ qw/ reverse date / ] will sort by reverse date
  • headers (arrayref, required): a list of mail-headers to fetch.
  • mailbox (required)

searches a mailbox, returns an arrayref containing a list of UIDs. go find your messages bestie πŸ”

🧚 all_headers({ mailbox => $mailbox, uid => $uid })

fetches all headers for a message and updates the local headercache. cache refresh moment. ✨

πŸ’œ get_headers({ mailbox => $mailbox })

fetches headers for a single message β€” either from the server, or (if it's available) from the local headercache. efficient queen. πŸ‘‘

🌸 mark_read({ mailbox => $mailbox, uid => $uid })

marks a message as read. the guilt is gone. 🫢

πŸ¦‹ mark_answered({ mailbox => $mailbox, uid => $uid })

marks a message as answered. you replied! growth! 🌱

⭐ toggle_important({ mailbox => $mailbox, uid => $uid })

toggles the important/flagged IMAP flag. returns 'flagged' if the flag is now set, otherwise returns undef. so like, undef means "nope, not flagged". 🚩

πŸŽ€ get_flags({ mailbox => $mailbox, uid => $uid })

fetches the flags of a message, returns a hashref with the lowercased flag names as keys. lowercase. always. πŸ’…

🌈 bodypart_as_string({ mailbox => $mailbox, uid => $uid, parts => [ $part ] })

fetches body part(s) of a message β€” part IDs according to the bodystructure of the message. body parts, plural, it's a whole thing. 🧩

πŸ’€ get_bodystructure({ mailbox => $mailbox, uid => $uid })

fetches the bodystructure of a message. returns a Mail::IMAPClient::BodyStructure object. ⚠️ heads up though: this might change when they parse this into something more useful. so don't get too attached, it's a situationship. 😭

πŸ“ message_as_string({ mailbox => $mailbox, uid => $uid })

returns a full message body as a string. the whole thing. all of it. πŸ“©

πŸ”₯ delete_messages({ mailbox => $mailbox, uid => $uid })

deletes message(s) from the server and expunges the mailbox. gone. gone gone. no undo button, bestie. πŸ—‘οΈ

🧚 append_message({ mailbox => $mailbox, message_text => $message_text })

a low level method to append an RFC822-formatted message to a mailbox. lowkey powerful, highkey dangerous if you feed it garbage. πŸ™ˆ

πŸ‘‘ move_message({ mailbox => $mailbox, target_mailbox => $target_mailbox, uid => $uid })

moves a message to another mailbox. relocation era. πŸ“¦βœ¨

🌸 create_mailbox({ mailbox => $mailbox, name => $name })

creates a subfolder. nesting time. πŸͺ†

πŸ’œ delete_mailbox({ mailbox => $mailbox })

deletes a complete folder. the whole thing. everything inside it too. be so serious before you call this one. 😭

πŸ¦‹ get_quotas({ mailbox => $mailbox })

gets a list of quotaroots that apply to the specified mailbox. space check! are we full? πŸ‘€


🌟 AUTHOR 🌟

Stefan Seifert and Mathias Reitinger <mathias.reitinger@loop0.org> β€” legends, honestly. 🫢


πŸ’– LICENSE πŸ’–

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. slay, open source. 🌈


and that's the whole page, bestie!! πŸŽ€ this was written for perl v5.40.1, dated 2025-03-02, and it's part of the User Contributed Perl Documentation β€” so like, thanks for reading, mwah, go read rfc3501 fr fr πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from