Sendmail Configuration Problem

Discussion in 'Perl Misc' started by Robert TV, Nov 21, 2003.

  1. Robert TV

    Robert TV Guest

    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 ()
    To: John ()

    It's reading this:

    From Andy Raxin () on behalf of Robert
    ()
    To: John ()

    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 <>
    Subject: Test Subject
    Sender: Andy Raxin <>
    To: John <>

    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
     
    Robert TV, Nov 21, 2003
    #1
    1. Advertising

  2. Robert TV

    Robert TV Guest

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


    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
     
    Robert TV, Nov 21, 2003
    #2
    1. Advertising

  3. Robert TV wrote:
    > When I open the e-mail in M$ Outlook, instead of reading EG:
    >
    > From: Robert ()
    > To: John ()
    >
    > It's reading this:
    >
    > From Andy Raxin () on behalf of Robert
    > ()
    > To: John ()


    <snip>

    > Here is a section of the email header:
    >
    > Date: Thu, 20 Nov 2003 17:39:15 -0800
    > From: Robert <>
    > Subject: Test Subject
    > Sender: Andy Raxin <>
    > To: John <>


    <snip>

    > 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.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Nov 21, 2003
    #3
  4. Robert TV

    Guest

    Gunnar Hjalmarsson <> wrote:
    > 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
    --
    @s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
    until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
     
    , Nov 21, 2003
    #4
  5. wrote:
    > Gunnar Hjalmarsson wrote:
    >> 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".


    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...

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Nov 21, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jim

    Sendmail problem

    jim, Oct 24, 2003, in forum: Perl
    Replies:
    4
    Views:
    675
  2. Andrea Williams

    Urgent SendMail Problem

    Andrea Williams, Dec 9, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    1,883
    Andrea Williams
    Dec 13, 2004
  3. Mark
    Replies:
    0
    Views:
    844
  4. sugapablo
    Replies:
    0
    Views:
    2,187
    sugapablo
    Sep 21, 2007
  5. Andrzej Adam Filip
    Replies:
    0
    Views:
    4,147
    Andrzej Adam Filip
    Mar 31, 2008
Loading...

Share This Page