Verp(3pm)

πŸ“¦
version 0.06 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Mail::Verp β€” the module that encodes and decodes Variable Envelope Return Paths (VERP) addresses. bestie, it's the bounce-handling queen πŸ‘‘


✨ SYNOPSIS ✨

use Mail::Verp;

#Using class methods

#Change separator to something else
Mail::Verp->separator('+');

#Create a VERP envelope sender of an email to recipient@example.net.
my $verp_email = Mail::Verp->encode('sender@example.com', 'recipient@example.net');

#If a bounce comes back, decode $verp_email to figure out
#the original recipient of the bounced mail.
my ($sender, $recipient) = Mail::Verp->decode($verp_email);

#Using instance methods

my $verp = Mail::Verp->new(separator => '+');

#Create a VERP envelope sender of an email to recipient@example.net.
my $verp_email = $verp->encode('sender@example.com', 'recipient@example.net');

#Decode a bounce
my ($sender, $recipient) = $verp->decode($verp_email);

🌸 ABSTRACT 🌸

Mail::Verp encodes and decodes Variable Envelope Return Paths (VERP) email addresses. that's the whole vibe πŸ¦‹


πŸ‘‘ DESCRIPTION πŸ‘‘

Okay so picture this: Mail::Verp takes the address of an email recipient and stashes it inside the envelope sender address. why tho? because then when a bounce comes back, you can actually handle it β€” even in the cursed scenario where the original recipient is forwarding their mail somewhere else and the remote Mail Transport Agents send back bounce messages that tell you literally nothing useful. 😭

and it works both ways, bestie β€” the module can also be used to decode bounce recipient addresses. main character energy on both sides of the transaction, fr fr. πŸ’…


πŸŽ€ FUNCTIONS πŸŽ€

new()

so this one is primarily useful to save typing. instead of typing out Mail::Verp every single time, you can say my $x = Mail::Verp->new; and then just use $x wherever Mail::Verp is usually required. lazy girlie wins again πŸ™ˆ

it accepts an optional separator argument for changing the separator, and the default is the hyphen -. lowkey iconic. you can also change the value later using the separator accessor.

my $x = Mail::Verp->new(separator => '+');

encode(LOCAL-ADDRESS, REMOTE-ADDRESS)

encodes LOCAL-ADDRESS, REMOTE-ADDRESS into a verped address suitable for use as an envelope return address. ✨

it may also be useful to use the same address in Errors-To and Reply-To headers, to compensate for broken Mail Transport Agents. yes, really β€” doing the most to work around chaos that isn't yours. πŸ’€

uses the current separator value.

decode(VERPED-ADDRESS)

decodes VERPED-ADDRESS into its constituent parts, no cap.

  • returns LOCAL-ADDRESS and REMOTE-ADDRESS in list context
  • returns REMOTE-ADDRESS in scalar context
  • returns VERPED-ADDRESS if the decoding fails (it just hands you back what you gave it, a little "idk her" moment)

uses the current separator value.

separator

returns the current value of the VERP separator. just a lil peek, nothing more 🫢

separator(SEPARATOR)

sets a new value for the VERP separator and returns the previous value. she gives and she takes, that's the duality. ⭐


🧚 EXPORT 🧚

None. nothing gets exported, you have to ask nicely.


🌈 SEE ALSO 🌈

DJ Bernstein details verps here: http://cr.yp.to/proto/verp.txt.

Sam Varshavchik proposes an encoding here: http://www.courier-mta.org/draft-varshavchik-verp-smtpext.txt.


πŸ’œ AUTHOR πŸ’œ

Gyepi Sam <gyepi@cpan.org>


Copyright 2007 by Gyepi Sam

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole Verp(3pm) page, bestie!! πŸ’–

this lil masterpiece dropped in perl v5.36.0, dated 2022-10-13 β€” she's been serving since 2007 and she's still eating. obsessed. periodt. πŸ‘‘βœ¨

πŸ“¦ where this page comes from