LUA-URI-POP(3)
π 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
userinfomethod 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
pathmethod 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
nilif 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
nilto 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. π
- the return value will be
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 benilβ if there's no auth type specified then the default value of'*'is returned. she always shows up. π - setting a new value of
nilor the empty string will cause an exception to be thrown. absolutely not. π«
- the value returned is just the auth type, not the
β οΈ 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
- debian trixie: lua-uri 0.1+20130926+git14fa255d-3 Β· MIT
- ubuntu noble: lua-uri 0.1+20130926+git14fa255d-3 Β· MIT
- ubuntu questing: lua-uri 0.1+20130926+git14fa255d-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms