http://www.perlmonks.org?node_id=1017244


in reply to Email Forwarding

Where do you want to get the message from, system mailbox? Try reading /var/mail/$username (and parsing it with help from some MIME-parsing/creating module, like Email::MIME or MIME::Tools).
Sorry if my advice was wrong.

Replies are listed 'Best First'.
Re^2: Email Forwarding
by Anonymous Monk on Feb 05, 2013 at 18:32 UTC

    The email would come from "replaceme@thedomain.com" w/ Subject: "this is the subject to replace" Which "replaceme" is in the Aliase file as: replaceme: "|/msg/forward.pl" When an email is received, the perl script is ran, but I need it to include the Message that is sent.

      Then use one of the modules specified to read and parse the text going from STDIN. You can read from STDIN filehandle using diamond operator (<>), like this:  my $whole_message = do { local $/; <STDIN> }; (see also $/ for more information on slurping filehandle contents).
      Sorry if my advice was wrong.