cfreak has asked for the wisdom of the Perl Monks concerning the following question:

Hey everyone. I have a problem with MIME::Lite I'm hoping someone can help me with. Searched Google, here, asked on IRC, no one seems to have the problem much less the solution :).

I'm using MIME::Lite, I've used it extensively in the past without a problem, but now on a particular program, it seems to ignore the From header that I specify and instead show my messages as coming from 'nobody@myserver.com'

Here's the code, almost the same as the docs with just some minor differences for my own variables

my $msg = MIME::Lite->new( From =>$CONFIG{submit_by}, To =>$CONFIG{submit_to}, Subject =>$CONFIG{subject}, Type =>'TEXT', Data =>$message, ); if($CONFIG{SENDMAIL}) { MIME::Lite->send("sendmail","$CONFIG{SENDMAIL} -t"); } elsif($CONFIG{SMTP_SERVER}) { MIME::Lite->send("smtp",$CONFIG{SMTP_SERVER},Timeout=>30); } else { # Yikes! No send method specified. Abort croak "No send method specified.\n"; } $msg->send();

I've verified that my %CONFIG has the information it needs to work including an email address in the 'submit_by' but all the messages I receive from it have 'nobody' as the sender. I've tried sending this both through my sendmail installation and through a remote SMTP server (postfix) with the same results. Anyone have any ideas?

Thanks

Replies are listed 'Best First'.
Re: MIME::Lite From header problem
by mifflin (Curate) on Jul 23, 2004 at 18:42 UTC
    I had a similar problem where the mail header was not being set correctly and email was being rejected due to reverse-dns-lookup.
    Look at the MIME::Lite perldoc on SetSender and FromSender. They might help.
    The solution for my problem was to do this...
    $mimeliteobj->send('sendmail', SetSender => 1);
Re: MIME::Lite From header problem
by chanio (Priest) on Jul 23, 2004 at 17:24 UTC
    Did you try just putting 'your@email.address'? You should show the example, also. And the resulting error.log.

    .{\('v')/}
    _`(___)' __________________________

      Ummm ... did you even look at my post? As I said, I've verified that $CONFIG{submit_to} does indeed have an email address in it, there is a large example of the code I'm using, and as I previously stated the message gets sent so there is no error. The problem is the email address in the From=> is being ignored.