This isn't really a solution, but rather an alternative. Instead of using linux's sendmail, try the
Mail::Sendmail module. It's a "simple platform independent mailer." Thus, it makes your program more portable should you wish to change your current OS. I've used it on both Windows and Linux with great success. Here's a code sample:
use Mail::Sendmail;
# Create the message hash
my %mail = (
To => 'You <your@address.com>', # To address..
From => 'Me <my@address.com>', # From address..
Message => 'Hello, world!', # The message body..
Smtp => 'your.mail.server' # erase this if you want to use "loc
+alhost" (default)
);
# Send the message
unless (sendmail(%mail)) {
# Error!
}
# All is well.