Mail::...:Daemon(3pm)
π Mail::SRS::Daemon β the Perl doc page, but make it make sense π
okay bestie, so this is Mail::SRS::Daemon(3pm) from the User Contributed Perl Documentation β yeah, the whole "user contributed" thing, we're all just out here contributing π«Ά. Anyway. Sit down, hydrate, and let's talk about a little daemon that does SRS address glow-ups on demand. It's giving modular, it's giving socket-based, it's giving your MTA's new best friend.
β¨ NAME β¨
Mail::SRS::Daemon β a modular daemon for Mail::SRS. literally that's it, that's the whole vibe. π
β¨ SYNOPSIS β¨
my $daemon = new Mail::SRS::Daemon( SecretFile => $secretfile,
Separator => $separator, ); $daemon->run();
like. construct it, then run it. that's the whole arc. main character energy fr fr π
β¨ DESCRIPTION β¨
The SRS daemon sits on a socket and waits β patiently, iconically β for SRS address transformation requests. When one shows up, it transforms the address and hands the new address right back down the socket. no cap. β¨
You can invoke it from exim using ${readsocket ...}, and probably from other MTAs too. If you want actual examples, go look at <http://www.anarres.org/projects/srs/> β that's the plug, iykyk.
β¨ METHODS β¨
πΈ $daemon = new Mail::SRS::Daemon(...)
Construct a brand new Mail::SRS object and return it. π
Every single parameter that's valid for Mail::SRS is also valid for Mail::SRS::Daemon, and it gets passed straight through to the Mail::SRS constructor verbatim β no changes, no edits, no notes, we just hand it over.
The one exception to this rule? The Secret parameter. That one gets promoted to a list, and all the secrets from SecretFile get included in it. Sneaky but iconic.
The new params are documented right here, and for everything else you go see Mail::SRS. π¦
SecretFile => $stringβ a file to read secrets from. Secrets are specified once per line. The first specified secret is the one used for encoding. Secrets are written one per line. Blank lines, and lines starting with a#, are ignored. IfSecretisn't given, then the secret file must be nonempty.
Also,Secretwill specify a primary secret and it overridesSecretFileif both are specified. BUT β plot twist β secrets read fromSecretFilestill get used for decoding if both are specified. so it's not a full breakup, it's a situationship. π
Socket => $socketβ an instance ofIO::Socket, presumed to be a listening socket. You can pass this in if you want to use a preexisting socket instead of makingMail::SRS::Daemonconstruct a whole new one. reuse, reduce, recycle π
πΈ $daemon->run()
Run the daemon. πβοΈ
This method will never return. Like, never ever. Errors and exceptions get caught, and error messages are returned down the socket.
β¨ EXPORTS β¨
If you give it :all, this module exports the following variable. (just the one, she's an only child π
)
$SRSSOCKETβ the filename of the default socket created byMail::SRS::Daemon.
β¨ PROTOCOL β¨
Here's the tea β: the daemon waits for a single line of text from the client, and it responds with a single line. That's it. One in, one out. beautiful, efficient, obsessed.
Every line is of the form "COMMAND args...". Right now, exactly two commands are supported: forward and reverse. periodt.
A forward request looks like:
FORWARD sender@source.com alias@forwarder.com
A reverse request looks like:
REVERSE srs0+HHH=TT=domain=local-part@forwarder.com
Either way, the daemon responds with either a translated address or a line starting with "ERROR ", followed by a message. so you'll know. you'll always know. π
β¨ TODO β¨
Add more daemon-related options, like path to socket, or inet socket address. it's on the list bestie, we're getting to it π§
β¨ SEE ALSO β¨
Mail::SRSsrsd- <http://www.anarres.org/projects/srs/>
β¨ AUTHOR β¨
Shevek
CPAN ID: SHEVEK
cpan@anarres.org
http://www.anarres.org/projects/
shoutout Shevek, the blueprint π
β¨ COPYRIGHT β¨
Copyright (c) 2004 Shevek. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π«Ά
and that's the whole page, bestie!! this was documented by the User Contributed Perl Documentation crew, on perl v5.36.0, dated 2022-11-27 β so if you're reading this way later and something's crunchy, that's why. go forth and daemon responsibly πβ¨πΈ
π¦ where this page comes from
- debian bookworm: libmail-srs-perl 0.31-9 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmail-srs-perl 0.31-9 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmail-srs-perl 0.31-9 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmail-srs-perl 0.31-9 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmail-srs-perl 0.31-9 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms