Sendmail Configuration Problem

R

Robert TV

Hey everyone, I am having a problem with Sendmail for Perl. I have a web
page with five fields.

Four textbox fields are:
"fname" = From name
"femail" = From email
"tname" = To name
"temail" = To email

1 textarea:
"contents" = Email contents

The script itself seems to be working fine. I input names and email
addresses in the "to" and "from" fields and add contents. The e-mail send
correctly and it gets to my inbox. When I open the e-mail in M$ Outlook,
instead of reading EG:

From: Robert ([email protected])
To: John ([email protected])

It's reading this:

From Andy Raxin ([email protected]) on behalf of Robert
([email protected])
To: John ([email protected])

Notice the "on behalf" above. Sendmail is getting my own personal name and
email address from the hosting config and showing this as on behalf of what
I program in the Web page form fields. Here is a section of the email
header:

Date: Thu, 20 Nov 2003 17:39:15 -0800
From: Robert <[email protected]>
Subject: Test Subject
Sender: Andy Raxin <[email protected]>
To: John <[email protected]>

Sendmail is attaching a "Sender" header to the email (as seen in line 3 of
the headers above), and Outlooks see's this and thus puts in the "on behalf"
in it's final message. I have been reading Sendmail manuals like crazy but
can't figure out a way to get rid of this "on behalf" thingy. I assume it
can be done because FormMail doesn't do this. FormMail uses the variables
"-t -i" and I use them too, to no avail. Can someobe help me? I do not want
my name and email address showing as the From on behalf, I want to show it
as being from who I enter into the Web page form fields. Here is my code:

#!/usr/bin/perl

use Fcntl qw:)DEFAULT :flock);
use CGI;
use CGI::Carp qw(fatalsToBrowser);

$mailprog="/usr/sbin/sendmail -t -i";
$fname = CGI::param('fname');
$femail = CGI::param('femail');
$tname = CGI::param('tname');
$temail = CGI::param('temail');
@contents = CGI::param('contents');

open (MAIL, "|$mailprog") or die "Can't open mail program: $!";
print MAIL "From: $fname <$femail>\n";
print MAIL "To: $tname <$temail>\n";
print MAIL "Subject: Test Subject\n";
print MAIL "MIME-Version: 1.0\n";
print MAIL "X-MSMail-Priority: $priority\n";
print MAIL "Content-Type: multipart/alternative;\n";
print MAIL " boundary=\"separator\"\n\n";
print MAIL "This is a multi-part message in MIME format.\n\n";
print MAIL "--separator\n";
print MAIL "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
print MAIL "Content-Transfer-Encoding: 7bit\n\n";
print MAIL "@contents\n\n";
print MAIL "--separator\n";
print MAIL "Content-Type: text/html; charset=\"iso-8859-1\"\n";
print MAIL "Content-Transfer-Encoding: 8bit\n\n";
print MAIL "<html>\n";
print MAIL "<head>\n";
print MAIL "</head>\n\n";
print MAIL "<body>\n\n";
print MAIL "@contents\n";
print MAIL "</body>\n";
print MAIL "</html>\n\n";
print MAIL "--separator--";
close (MAIL);

print "Content-type: text/html \n\n";
print "Mail sent";
exit;

Please and thank you to all who reply!!!!!

Andy
 
R

Robert TV

Please and thank you to all who reply!!!!!

I just noticed that this may not have been the correct Newsgroup to post to,
forgive me, I am going to visit the Sendmail specific newsgroup now.

Andy
 
G

Gunnar Hjalmarsson

Robert said:
When I open the e-mail in M$ Outlook, instead of reading EG:

From: Robert ([email protected])
To: John ([email protected])

It's reading this:

From Andy Raxin ([email protected]) on behalf of Robert
([email protected])
To: John ([email protected])

Here is a section of the email header:

Date: Thu, 20 Nov 2003 17:39:15 -0800
From: Robert <[email protected]>
Subject: Test Subject
Sender: Andy Raxin <[email protected]>
To: John <[email protected]>

I just noticed that this may not have been the correct Newsgroup to
post to, forgive me, I am going to visit the Sendmail specific
newsgroup now.

No, this is not the right news group. Neither is the sendmail group,
probably.

I'd suggest that you check the configuration of your Outlook client at
first hand. (Don't think it's necessary that a "Sender:" header is
treated like that.) You may also want to ask your ISP why their
sendmail program or mail server is configured to add that "Sender:"
header.
 
N

news

Gunnar Hjalmarsson said:
You may also want to ask your ISP why their
sendmail program or mail server is configured to add that "Sender:"
header.

Because that's the (arguably) correct behaviour for a mailer when someone
tries to send an email whilst pretending to be someone else. To do that
without having sendmail add the Sender: header you need to be in the
list of "trusted users".

Chris
 
G

Gunnar Hjalmarsson

Because that's the (arguably) correct behaviour for a mailer when
someone tries to send an email whilst pretending to be someone
else. To do that without having sendmail add the Sender: header you
need to be in the list of "trusted users".

I see. I just got the impression that the added "Sender:" header in
this case was some administrator of a web hosting service or ISP. If
that's actually the case, it makes no sense to me. But maybe that's
what you meant by arguably...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top