On the subject of timeouts sendmail has an -odq option. This means "on delivery queue". What this means is that you get spooling. Adding this will be a good idea. Warning if your sendmail is not configured the messages will never get sent so test it first!

Sendmail assumes that a single . char on a line by itself is the end of a message unless you use the -i flag (currently if your $messagebody contains this single period newline then only the message to that point will get sent just BTW so the -i option is a good idea usually) Anyway this means you could open your pipe to sendmail ONCE, add the -odq option, and just dump all the emails, separated by a "\n.\n", then close sendmail. This will be heaps faster.

open MAIL, "|/usr/lib/senmail -t -odq" or die "Oops $!"; foreach $user (@maillist) { &print_message($user); print "\n.\n"; } close MAIL; print "All done\n";

Using a database or even a flat file is better than cut and paste! Sendmail may not be the best solution. You have already been pointed to some modules. cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: Sendmail with large address book by tachyon
in thread Send mail with large address book by Valkerri

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.