LUA-URI-POP(3)

πŸ“¦
version 0.1+20130926+git14fa255d Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’– LUA-URI-POP πŸ’–

okay bestie so this is lua-uri-pop, the POP URI support module for the Lua URI library πŸŽ€ and no, it's not the "pop off" kind of pop, it's the mail-server kind. still iconic tho.


✨ NAME ✨

lua-uri-pop β€” POP URI support for the Lua URI library πŸ¦‹


🌸 DESCRIPTION 🌸

so the class uri.pop is the whole vibe for URIs rockin' the pop scheme. it inherits from the uri class, so all that parent energy is there πŸ’…

here's the tea on what counts as invalid, and bestie we do not do invalid:

  • POP URIs with a non-empty path part? invalid. literally not it. 🚫
  • POP URIs with a userinfo part that has an empty POP username or an empty POP 'auth' type? also invalid. no exceptions.

now for the glow-up: the ;auth= part of a POP URI gets normalized so that the word auth is all lowercase πŸ’– and if the auth type is the default '*' value, it gets yeeted entirely β€” removed altogether β€” leaving just the username behind. so clean. so demure. ✨

oh and the default port is 110 πŸ‘‘


πŸ’… METHODS πŸ’…

every single method defined in lua-uri(3) is supported, periodt. but two of them act a lil special:

  • the userinfo method will throw an exception if the new userinfo would form an invalid POP URI 😭 and it will normalize the auth type part if appropriate (doing the lord's work honestly).
  • the path method will always return empty strings for POP URIs 🫢 and it will throw an exception if you give it a new value that is not the empty string. do not test it. it will not pass the vibe check.

and now, the moment you've been waiting for, the additional methods:

  • uri:pop_user(...) β€” get or set the POP username, which lives in the userinfo part of the authority πŸŽ€
    • the return value will be nil if there's no user information in the URI, or a fully decoded string if there is.
    • if the new value is empty, an exception is thrown 🚫 (yes, an empty username is a crime here).
    • the user can be set to nil to remove the userinfo part from the URI β€” cute, right? β€” but this will also throw an exception if there is an 'auth' type specified. so like, pick a struggle. 😭
  • uri:pop_auth(...) β€” get or set the POP authentication type, which is stored in the userinfo part of the authority, right after the string ;auth= πŸ”₯
    • the value returned is just the auth type, not the ;auth= part, and it will be fully decoded. the value returned will never be nil β€” if there's no auth type specified then the default value of '*' is returned. she always shows up. πŸ‘‘
    • setting a new value of nil or the empty string will cause an exception to be thrown. absolutely not. 🚫
⚠️ lowkey important: those exceptions are not a drill. setting an empty username, an empty auth, or a non-empty path is all gonna blow up in your face. respect the rules bestie πŸ’€

πŸ“š REFERENCES πŸ“š

this class is based on RFC 2384 β€” go read it, iykyk 🌈


πŸŽ€ SIGN-OFF πŸŽ€

this little masterpiece is version 1.1, dated 2012-00-00 πŸ¦‹ and that's the whole page, bestie. go forth and slay your POP URIs βœ¨πŸ’– no cap.

πŸ“¦ where this page comes from