# slurp the email from STDIN my( $raw ); { local $/ = undef; local *FILE; open FILE, "-"; $raw = ; close FILE } defined( $raw ) or die( "Nothing read from STDIN!\n" ); # Create an IO::Handle for Mail::DKIM::Verifier to read message from my( $raw_iohandle ) = new IO::Scalar( \$raw ); # Read from the IO::Handle my( $mail ) = load Mail::DKIM::Verifier->new(); $mail->load( \$raw_iohandle ); $mail->CLOSE; # Import message to Email::Simple my( $incoming ) = Email::Simple->new( \$raw );