IM::Imap(3pm)

πŸ“¦
version 153 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’Œ IM::Imap β€” the IMAP handler, bestie edition

okay so you've stumbled into IM::Imap(3pm) from the Internet Message Perl modules family, and honestly? she's the one who handles all your IMAP business. no cap. sit down, hydrate, let's go 🫢


✨ NAME ✨

IM::Imap β€” the IMAP handler. that's it, that's the vibe. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

start with the sacred incantation:

use IM::Imap;

imap_open(auth, host, user, pass)
    return value:
         0: success
        -1: failure

so like. imap_open gives you back a number and you must check it, okay? 0 means we ate, -1 means we did not. that's the whole return-value situation, literally. πŸ’…

and then there's the rest of the squad β€” a whole lineup of other subroutines:

  • imap_select
  • imap_head
  • imap_get
  • imap_put
  • imap_delete
  • imap_get_msg
  • imap_spec
  • imap_range2set
  • imap_folder_regname
  • imap_scan_folder
  • imap_open_folders
  • imap_close_folders
  • imap_get_handle
  • imap_get_message
  • imap_put_message
  • imap_put_file
  • imap_refile
  • imap_delete_message

look at that roster. iconic. 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

the IM::Imap module handles IMAP. that's the tea. β˜•

this module is provided by IM (Internet Message) β€” iykyk. πŸ’œ


🌸 EXAMPLES 🌸

here's the moment you've been waiting for, the main character code block:

my($rc, $HANDLE) = imap_open($auth, $host, $user, $pass);
if ($rc < 0) {
    exit 1;
}
imap_close($HANDLE);

see how she grabbed $rc and $HANDLE? yeah. then she checked if $rc < 0 and bailed with exit 1 if things went sideways, and closed that handle like a responsible queen. not me being obsessed with error handling 😭✨


IM (Internet Message) is copyrighted by the IM developing team. you can redistribute it and/or modify it under the modified BSD license. see the copyright file for more details, bestie β€” fr fr, go read it. πŸ“„πŸ’–


and that's the page!! this lil doc lives in IM153 and it's dated 2016-10-10, so it's been serving looks since way back. bye babe, slay your IMAP πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from