Bulkma...yServer(3pm)

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

πŸ’– Mail::Bulkmail::DummyServer (3pm) πŸ’–

okay bestie, welcome to the man page for Mail::Bulkmail::DummyServer, straight outta the User Contributed Perl Documentation section. it's a lil dummy server class and it's about to save your whole debugging era, no cap. 🫢


✨ NAME ✨

Mail::Bulkmail::DummyServer β€” a dummy class for dummy server objects πŸ’…


🌸 AUTHOR 🌸

Jim Thomason, jim@jimandkoka.com β€” the icon, the moment, the legend. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe. Mail::Bulkmail::DummyServer is a drop in replacement for Mail::Bulkmail::Server. literally just swap it in, no drama.

and why would you want that? because sometimes you just wanna test your own stuff on your own end, y'know?? like:

  • make sure your list iterates properly βœ…
  • make sure your mail merge is functioning fine βœ…
  • make sure your logging functions are correct βœ…
  • whatever else your heart desires βœ…

and in those situations you probably don't wanna be futzing around with your SMTP relay and blasting junk messages through it that you don't even care about. like why. and then not only that, you'd have to go inspect all that mess and delete it later?? a whole hassle for debugging. the audacity. πŸ’€

so enter DummyServer. ✨ it's a subclass of Mail::Bulkmail::Server that behaves exactly the same, with one teeny tiny little difference: it does not actually connect to a server. instead, it sends all the data that would've gone to the server to a file instead. and that file? it should be specified in the conf file. periodt.

 #in your conf file
 define package Mail::Bulkmail::DummyServer
 dummy_file     = ./my.dummy.file

so now, instead of your commands going off to your SMTP relay, they get sent to ./my.dummy.file for easy inspection at a later date. iconic behavior honestly. πŸŽ€


🌈 CLASS ATTRIBUTES 🌈

  • dummy_file β€” stores the dummy_file that you want to output your data to. that's it, that's the whole thing. πŸ’œ

πŸ’… METHODS πŸ’…

  • connect β€” "connects" to your DummyServer. and yes, the scare quotes are doing heavy lifting there, because internally it actually ties a filehandle onto this package. yep. this thing has a (minimal) implementation of a tied handle class to accomplish this feat. the way that it just... ties a handle. obsessed. 🧚

This method is known to return:

 MBDu001 - server won't say EHLO

so if you see that bad boy, you know what's up. 😭

  • disconnect β€” overloaded disconnect method. it wipes out the internal socket as usual, but it does not try to say RSET or QUIT to the server. respectfully, there's no server to say it to.

disconnect can also disconnect quietly, i.e., it won't try to issue a RSET and then quit before closing the socket.

 $server->disconnect();                         #issues RSET and quit
 $server->disconnect('quietly');        #issues nothing

so like, loud disconnect or silent disconnect, your call bestie. ✨


πŸ‘€ SEE ALSO πŸ‘€

  • Mail::Bulkmail::Server

go read that one too, iykyk. πŸ“š


Copyright and (c) 2003 James A Thomason III (jim@jimandkoka.com). All rights reserved. Mail::Bulkmail::DummyServer is distributed under the terms of the Perl Artistic License.


🫢 CONTACT INFO 🫢

okay so you don't have to scroll all the way back to the top (you're welcome, bestie), it's me, Jim Thomason (jim@jimandkoka.com), and feedback is appreciated. Bug reports / suggestions / questions / etc. Hell, drop me a line to let me know that you're using the module and that it's made your life easier. :-) πŸ’–


and that's the whole page fr fr 🌸 β€” this was perl v5.36.0, dated 2022-10-22. stay slaying, and may all your dummy servers behave. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from