might be OT sendmail script running very slow

Discussion in 'Perl Misc' started by Mark D Smith, May 23, 2005.

  1. Mark D Smith

    Mark D Smith Guest

    Hi

    this might be a sendmail issue but the snippet below is from a script that
    is used in part of an automated program than ran fine on RH8 but on FC3
    takes around 13 seconds from Start of sendmail line to end of sendmail line.

    my $mailprog = '/usr/sbin/sendmail';

    print "start of sendmail<br>\n";

    open (MAIL, "|$mailprog -t -f system-check\@domain.xyz");
    print MAIL "To: Support <support\@domain.xyz>\n";
    print MAIL "Cc: Support1 <support1\@domain1.xyz>\n";
    print MAIL "From: Test Script<server1\@domain.xyz>\n";
    print MAIL "Subject: mail test\n\n";

    close(MAIL);
    print "end of sendmail<br>\n";

    Mark
    Mark D Smith, May 23, 2005
    #1
    1. Advertising

  2. Mark D Smith wrote:
    > this might be a sendmail issue


    So it seems.

    > but the snippet below is from a script that
    > is used in part of an automated program than ran fine on RH8 but on FC3
    > takes around 13 seconds from Start of sendmail line to end of sendmail line.
    >
    > my $mailprog = '/usr/sbin/sendmail';
    >
    > print "start of sendmail<br>\n";
    >
    > open (MAIL, "|$mailprog -t -f system-check\@domain.xyz");
    > print MAIL "To: Support <support\@domain.xyz>\n";
    > print MAIL "Cc: Support1 <support1\@domain1.xyz>\n";
    > print MAIL "From: Test Script<server1\@domain.xyz>\n";
    > print MAIL "Subject: mail test\n\n";
    >
    > close(MAIL);
    > print "end of sendmail<br>\n";


    Try using one of the Perl modules instead. This code replaces the above
    using Mail::Sender:

    use Mail::Sender;
    ref (new Mail::Sender -> MailMsg( {
    smtp => 'localhost',
    from => 'Test Script <>',
    fake_from => '',
    to => 'Support <>',
    cc => 'Support1 <>',
    subject => 'mail test',
    msg => '',
    } )) or die "Cannot send mail. $Mail::Sender::Error\n";

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, May 23, 2005
    #2
    1. Advertising

  3. Mark D Smith wrote:

    > Hi
    >
    > this might be a sendmail issue but the snippet below is from a script
    > that is used in part of an automated program than ran fine on RH8 but
    > on FC3 takes around 13 seconds from Start of sendmail line to end of
    > sendmail line.
    >
    > my $mailprog = '/usr/sbin/sendmail';
    >
    > print "start of sendmail<br>\n";
    >
    > open (MAIL, "|$mailprog -t -f system-check\@domain.xyz");
    > print MAIL "To: Support <support\@domain.xyz>\n";
    > print MAIL "Cc: Support1 <support1\@domain1.xyz>\n";
    > print MAIL "From: Test Script<server1\@domain.xyz>\n";
    > print MAIL "Subject: mail test\n\n";
    >
    > close(MAIL);
    > print "end of sendmail<br>\n";
    >

    DNS is working correctly on the FC3 system? Can its hostname (or
    whatever sendmail thinks it's called) be resolved by DNS?

    What happens if you run sendmail directly?

    This is off-topic for this newsgroup (as you have guessed), so I
    suggest that you either post the question in a sendmail group, or you
    can mail me directly, but note my crude address-munging.

    Mark
    Mark Clements, May 23, 2005
    #3
  4. Gunnar Hjalmarsson wrote:
    >
    > from => 'Test Script <>',
    > fake_from => '',


    Sorry, that would be the other way around:

    from => '',
    fake_from => 'Test Script <>',

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, May 23, 2005
    #4
  5. Mark D Smith

    Mark D Smith Guest

    "Gunnar Hjalmarsson" <> wrote in message
    news:...
    > Gunnar Hjalmarsson wrote:
    > >
    > > from => 'Test Script <>',
    > > fake_from => '',

    >
    > Sorry, that would be the other way around:
    >
    > from => '',
    > fake_from => 'Test Script <>',
    >
    > --
    > Gunnar Hjalmarsson
    > Email: http://www.gunnar.cc/cgi-bin/contact.pl


    Hi

    takes just as long! , I'll contact Mark Clements via email and see if he can
    help as per his posting.

    Mark
    Mark D Smith, May 23, 2005
    #5
  6. Mark D Smith

    Mark D Smith Guest

    "Mark Clements" <> wrote in message
    news:4291befb$0$1242$...
    > Mark D Smith wrote:
    >
    > > Hi
    > >
    > > this might be a sendmail issue but the snippet below is from a script
    > > that is used in part of an automated program than ran fine on RH8 but
    > > on FC3 takes around 13 seconds from Start of sendmail line to end of
    > > sendmail line.
    > >
    > > my $mailprog = '/usr/sbin/sendmail';
    > >
    > > print "start of sendmail<br>\n";
    > >
    > > open (MAIL, "|$mailprog -t -f system-check\@domain.xyz");
    > > print MAIL "To: Support <support\@domain.xyz>\n";
    > > print MAIL "Cc: Support1 <support1\@domain1.xyz>\n";
    > > print MAIL "From: Test Script<server1\@domain.xyz>\n";
    > > print MAIL "Subject: mail test\n\n";
    > >
    > > close(MAIL);
    > > print "end of sendmail<br>\n";
    > >

    > DNS is working correctly on the FC3 system? Can its hostname (or
    > whatever sendmail thinks it's called) be resolved by DNS?
    >
    > What happens if you run sendmail directly?
    >
    > This is off-topic for this newsgroup (as you have guessed), so I
    > suggest that you either post the question in a sendmail group, or you
    > can mail me directly, but note my crude address-munging.
    >
    > Mark


    Hi Mark & group

    just to let you know it was sendmail. as i use 8.13.1 i added 2 lines the
    submit.mc and rebuilt it.

    FEATURE(`nocanonify')
    define(`confDIRECT_SUBMISSION_MODIFIERS',`C')

    Mark
    Mark D Smith, May 24, 2005
    #6
    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. sugapablo
    Replies:
    0
    Views:
    2,153
    sugapablo
    Sep 21, 2007
  2. Andrzej Adam Filip
    Replies:
    0
    Views:
    4,084
    Andrzej Adam Filip
    Mar 31, 2008
  3. olivier.melcher

    Help running a very very very simple code

    olivier.melcher, May 12, 2008, in forum: Java
    Replies:
    8
    Views:
    2,288
  4. Alf P. Steinbach /Usenet

    Slow -- VERY slow brain

    Alf P. Steinbach /Usenet, Jun 16, 2011, in forum: C++
    Replies:
    17
    Views:
    515
    Noah Roberts
    Jun 29, 2011
  5. Nick Green
    Replies:
    4
    Views:
    192
    Nick Green
    Nov 18, 2009
Loading...

Share This Page