-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendmail_no_module.pl
More file actions
792 lines (579 loc) · 22 KB
/
sendmail_no_module.pl
File metadata and controls
792 lines (579 loc) · 22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
#!/usr/bin/perl -- -*-perl-*-
#
# ------------------------------------------------------------
# script: mail.pl
# Authors: David Wood (dwood@plugged.net.au)
# Brad Marshall (bmarshal@plugged.net.au)
# Date: 7 June 1997
#
# Purpose: Creates and sends an SMTP/MIME e-mail message.
#
# Usage: Called from cron or a shell to send a message.
#
# Location of the script: Immaterial to operation.
#
# Copyright (c) 1997-9 Plugged In Software Pty Ltd.
# Released under the GNU GPL - see http://www.gnu.org/copyleft/gpl.html
#
# Modification History:
# 11 Dec 1998: Initial revision, based on dwood's wrc.pl
# 17 Apr 1998: Changed to act more like /bin/mail for ORA
#
# ------------------------------------------------------------
# ---------------------------------------------------------
# | MAIN PROGRAM |
# ---------------------------------------------------------
# Packages
use strict;
use Socket; # Required for network communications
# ---------------------------------------------------------
# | CONSTANTS AND GLOBAL VARIABLES |
# ---------------------------------------------------------
# Set some default values:
my($CRLF) = "\r\n";
my($MIMEversion) = "1.0";
my($DEFAULT_CONTENT_TYPE) = "application/octet-stream";
my($content_type) = "";
my($padchar) = "=";
my($LINESIZE) = 76;
# Set some flags for use in determining state:
my($_attachment_encoded) = 0;
my($boundary) = "";
my($message) = "";
my($_filename) = "";
my($last_processed) = -1;
my($no_stdin) = 0;
my($headeroverride) = 0;
# Declare some variables for use in the SMTP session:
my ( $mailcmd, $in_addr, $proto, $addr );
my ( $mailtest, $error_test );
# Base 64 encode characters table:
my(@encode_table) = (
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',
'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/'
);
# Define global variables used for configuration information:
my($mailhost) = "cerberus.dbs.co.il";
my($mailport) = 25;
my($to) = "";
my($recipient);
my(@recipients);
my($from) = "no_address\@nowhere.com";
my($cc) = "";
my($bcc) = "";
my($replyto) = "";
my($subject) = "No Subject";
my($body) = "";
my($attachment_list) = "";
# Declare an array to hold files for attachment:
my(@file);
# Since we're being strict, we need to pre-declare all vars:
my($i, $j, @attachments, $filename, $file_buffer, @attachments_encoded, $attachment, $flag, $extension, $random_int, $the_header, $tmp_incoming_data, $header, @decoded_attachment_data, $plain_text, $element, $encoded_attachment, @buffer,
$encode_count, $buffer_string, $tmp_string);
# ---------------------------------------------------------
# | REAL WORK STARTS |
# ---------------------------------------------------------
# If this script was called without any command line information,
# there is not enough information to proceed. Instead, return
# a usage message.
unless ($#ARGV >= 0) {
&usage;
}
# Parse the command line to gather all necessary information.
&parseCmdLine;
unless ($no_stdin) {
while (<STDIN>) {
if ($_ =~ /^\./) {
last;
}
$body .= $_;
}
print STDOUT "EOT\n";
}
# DBG
# Dump the major vars to the screen for review and exit.
print "To: $to\n";
print "From: $from\n";
print "CC: $cc\n";
print "BCC: $bcc\n";
print "Reply-To: $replyto\n";
print "Subject: $subject\n";
print "Body: $body\n";
print "Mailhost: $mailhost\n";
print "Port: $mailport\n";
print "Attachments: $attachment_list\n";
print "Last arg processed: $last_processed\n";
#exit;
# ---------------------------------------------------------
# | CREATE MIME ATTACHMENTS |
# ---------------------------------------------------------
# Create MIME attachments for each file named as an attachment
if ($#attachments >= 0) {
for $j (0...$#attachments) {
$filename = $attachments[$j];
open (INCOMING, $filename) || die "Can't open $filename\n";
$file_buffer = "";
while (<INCOMING>) {
$file_buffer .= $_;
}
close(INCOMING);
# BWM 17/03/98
# Fix to correct filename so it doesn't include path name
@file = split(/\//, $filename);
$_filename = @file[$#file];
$attachments_encoded[$j] = &printEncoded("$file_buffer");
$j++;
}
}
# ---------------------------------------------------------
# | CREATE THE MESSAGE |
# ---------------------------------------------------------
$boundary = &createBoundaryMarker;
$message = "From: " . $from . $CRLF;
$message .= "To: $to" . $CRLF;
$message .= "Cc: $cc" . $CRLF;
$message .= "Bcc: $bcc" . $CRLF;
if ($replyto) {
$message .= "Reply-To: $replyto" . $CRLF;
}
$message .= "Subject: $subject" . $CRLF;
if ($attachment_list) {
$message .= "MIME-Version: $MIMEversion" . $CRLF;
$message .= "Content-Type: multipart/mixed; boundary=\"$boundary\"" . $CRLF . $CRLF;
$message .= "This is a multi-part message in MIME format." . $CRLF . $CRLF;
if ($body) {
$message .= "--$boundary" . $CRLF;
$message .= "Content-Type: text/plain; charset=us-ascii"
. $CRLF;
$message .= "Content-Transfer-Encoding: 7bit" . $CRLF;
}
}
unless ($headeroverride) {
$message .= $CRLF;
}
if ($body) {
$message .= $body . $CRLF; # Add the rest of the message
$message .= $CRLF;
}
if ($attachment_list) {
$message .= $CRLF . "--" . $boundary;
foreach $attachment (@attachments_encoded) {
$message .= $CRLF . $attachment . $CRLF;
$message .= "--$boundary";
}
$message .= "--" . $CRLF;
}
# ---------------------------------------------------------
# | SEND THE MESSAGE |
# ---------------------------------------------------------
$in_addr = (gethostbyname($mailhost))[4];
$addr = sockaddr_in($mailport, $in_addr);
$proto = getprotobyname('tcp');
# Create a socket
socket(S, AF_INET, SOCK_STREAM, $proto) or die "socket: $!";
# Connect the socket to the host
connect(S, $addr) or die "Connect: $!";
# fflush socket after every write
select (S); $| = 1; select (STDOUT);
# Send SMTP request to the server
die "ERROR: $!" unless &expect(220,500);
print $mailcmd;
# Be nice, say hello to the mail host.
# Of course, say in MIME-wise with EHLO.
print S "EHLO $mailhost" . $CRLF;
die "ERROR: $!" unless &expect(250,501);
print $mailcmd;
print "Connected to $mailhost." . $CRLF;
print S "MAIL FROM: $from" . $CRLF;
print "From: $from" . $CRLF;
die "ERROR: $!" unless &expect("ok",500);
print $mailcmd;
# Break the recipient list into individual addresses in
# order to create a proper envelope.
@recipients = split /,/, $to;
foreach $recipient (@recipients) {
print S "RCPT TO: $recipient" . $CRLF;
print "To: $recipient" . $CRLF;
die "ERROR: $!" unless &expect("ok",500);
print $mailcmd;
}
print S "DATA" . $CRLF;
print "Sending message...";
die "ERROR: $!" unless &expect(354,50);
print $mailcmd;
print S "$message" . $CRLF;
#print "$message" . $CRLF;
print S "." . $CRLF;
#print "." . $CRLF;
die "ERROR: $!" unless &expect(250,500);
#print $mailcmd;
print S "QUIT" . $CRLF;
#print "QUIT" . $CRLF;
die "ERROR: $!" unless &expect(221,50);
#print $mailcmd;
# DBG
print "Finished\n\n";
# Clean up and exit
close(S);
exit;
# ---------------------------------------------------------------
# | Everything below here is a subroutine. |
# ---------------------------------------------------------------
sub usage {
print <<ENDOFUSAGE;
mail.pl [-u] [-h] [-f from] [-m mailhost] [-p port]
[-s subject] [-c cc-addr] [-b bcc-addr] [-r replyto-addr]
[-a attachment#1[:attachment#2...]] [-w] to_addresses
-a List of files to attach, colon seperated
-b List of blind carbon copy addresses
-c List of carbon copy addresses
-f Email sender's address (FROM:)
-h Shows the man page (help)
-m SMTP mailhost (name or IP address)
-w Do not wait on STDIN for message part
-o Override headers
-p Port to use when connecting to mailhost
-r Email reply-to address
-s Subject to use
-u Shows this usage information
to_addresses Email recipients address (TO:) in a comma
seperated list
ENDOFUSAGE
exit(0);
} # End sub usage
sub manpage {
my($pager) = 'more';
$pager = $ENV{'PAGER'} if $ENV{'PAGER'};
if ( $ENV{'TERM'} =~ /^(dumb|emacs)$/ ) {
system ("pod2text $0");
} else {
system ("pod2man $0 | nroff -man | $pager");
}
exit (0);
}
sub parseCmdLine {
foreach $i (0...$#ARGV) {
if ( $ARGV[$i] =~ /^\-(\w)$/ ) {
$flag = $1;
$_ = $flag;
SWITCH: {
/u/ and &usage, last SWITCH;
/h/ and &manpage, last SWITCH;
/f/ and $from = $ARGV[$i+1], $last_processed += 2, last SWITCH;
/r/ and $replyto = $ARGV[$i+1], $last_processed += 2, last SWITCH;
/m/ and $mailhost = $ARGV[$i+1], $last_processed += 2, last SWITCH;
/o/ and $headeroverride = 1, last SWITCH;
/w/ and $no_stdin = 1, $last_processed++, last SWITCH;
/p/ and $mailport = $ARGV[$i+1], $last_processed += 2, last SWITCH;
/a/ and $attachment_list = $ARGV[$i+1], $last_processed += 2, last SWITCH;
/s/ and $subject = $ARGV[$i+1], $last_processed += 2, last SWITCH;
/c/ and $cc = $ARGV[$i+1], $last_processed += 2, last SWITCH;
/b/ and $bcc = $ARGV[$i+1], $last_processed += 2, last SWITCH;
} # end SWITCH
} # end if/else
} # end foreach
# If attachments were found, put them into the attachments array
if ($attachment_list) {
@attachments = split(/:/, $attachment_list);
}
# Any arguments left on the command line after the last
# switch processed should be To: addresses.
foreach $i (($last_processed + 1)...$#ARGV) {
if ($to) {
$to .= ",";
}
# Provide some basic error checking. Don't append anything
# to the To: list unless it has an '@' sign in it.
if ($ARGV[$i] =~ /\@/) {
$to .= $ARGV[$i];
}
}
} # end sub parseCmdLine
sub setContentType {
# Need to determine the type from filename
# set a default content type in case nothing can be found
$content_type = $DEFAULT_CONTENT_TYPE;
# get the start of the filename extension
if ( $_filename =~ /.*\.(\w{3,4})$/ ) {
# extract the extension
$extension = $1;
# DBG
print "file extension: $extension\n";
# try some common extensions
if ($extension eq "gif") {
# GIF
$content_type = "image/gif";
} elsif ($extension eq "jpg" || $extension eq "jpeg") {
# JPEG
$content_type = "image/jpeg";
} elsif ($extension eq "txt") {
# text
$content_type = "text/plain";
} elsif ($extension eq "htm" || $extension eq "html") {
# HTML
$content_type = "text/html";
} elsif ($extension eq "mpg" || $extension eq "mpeg") {
# MPEG
$content_type = "video/mpeg";
} # end if extension...
} # end if start_extension...
} # end sub setContentType
sub createBoundaryMarker {
# random number as integer
$random_int = int(rand(1000)) * 98765;
# create the marker
$boundary="====PLUGGEDIN====" . $random_int . "====_";
return $boundary;
} # end subcreateBoundaryMarker
sub createHeader {
# the header to be created
$the_header = "";
# set a content type
&setContentType;
# is the content type text?
if ($content_type =~ /^text/ ) {
# yes, it's text
# create header
$the_header = "Content-Type: $content_type; charset=us-ascii; name=\"$_filename\"\n" .
"Content-Transfer-Encoding: 7bit\n" .
"Content-Disposition: inline; filename=\"$_filename\"\n\n";
} else {
# not text, therefore the content will be base64 encoded
# create header
$the_header="Content-Type: $content_type; name=\"$_filename\"\n" .
"Content-Transfer-Encoding: base64\n" .
"Content-Disposition: inline; filename=\"$_filename\"\n\n";
}
return $the_header;
}
sub printEncoded {
# DHW: Added the requirement for the incoming data to be passed as
# a parameter. It is a String.
$tmp_incoming_data = pop(@_);
# DBG
#print "The input to \&printEncoded was $tmp_incoming_data\n";
# Turn the string input into an array of characters from processing.
@decoded_attachment_data = split(//,$tmp_incoming_data);
# DBG
#print "The decoded_attachment_data array consists of:\n";
#foreach $element (@decoded_attachment_data) {
#print "$element\n";
#}
# encoded attachment size counter
$encode_count = 0;
# is there anything to encode?
if (@decoded_attachment_data == 0) {
# nothing to encode
# DBG
print "Nothing to encode!\n\n";
return "null";
}
# Set the MIME content type for this attachment
&setContentType;
# DBG
print "Content type is: $content_type\n";
# create the MIME header
$header = &createHeader;
# initialise the encode string
$encoded_attachment = $header;
# DBG
#print "After setting the header, \$encoded_attachment is: $encoded_attachment\n";
# Is the content type text of some form?
if ($content_type =~ /^text/i) {
# the encoded attachment is plain text - no need to encode
# DBG
print "The content type is text: no encoding needed!\n";
$plain_text = "";
foreach $element (@decoded_attachment_data) {
$plain_text .= $element;
}
# DBG
print "plain_text length = " . length($plain_text) . "\n";
#print "plain_text is: $plain_text\n";
$encoded_attachment .= $plain_text;
} else {
# DBG
print "The content type is NOT text: encoding!\n";
# create a suitable buffer - each 3 decoded bytes, becomes 4 encoded
@buffer = ('');
# DBG
print "printEncoded: d_a_d length: " . @decoded_attachment_data . "\n";
# go through the attachment
for ($i=0; $i < ( @decoded_attachment_data - 2 ); $i+=3) {
# convert 3 bytes to 4 encoded characters
$buffer[$encode_count++] = $encode_table[((vec($decoded_attachment_data[$i],0,8) & 0xFC) >> 2) ];
$buffer[$encode_count++] = $encode_table[(((vec($decoded_attachment_data[$i],0,8) & 0x03) << 4) | ((vec($decoded_attachment_data[$i+1],0,8) & 0xF0) >> 4)) ];
$buffer[$encode_count++] = $encode_table[(((vec($decoded_attachment_data[$i+1],0,8) & 0x0F) << 2) | ((vec($decoded_attachment_data[$i+2],0,8) & 0xC0) >>
6)) ];
$buffer[$encode_count++] = $encode_table[(vec($decoded_attachment_data[$i+2],0,8) & 0x3F) ];
}
# check to see if padding required
if ( $i < @decoded_attachment_data ) {
$i -= 3;
# DBG
#print "\$i = $i\n";
print "Padding is required. At least one byte is left over.\n";
# there's at least one byte left over
$buffer[$encode_count++] = $encode_table[((vec($decoded_attachment_data[$i],0,8) & 0xFC) >> 2)];
$buffer[$encode_count] = $encode_table[((vec($decoded_attachment_data[$i],0,8) & 0x03) << 4)];
# move to the next char, if any
$i++;
# any more bytes left over?
if ($i < @decoded_attachment_data ) {
# yes, include it
# DBG
print "There is a second byte left over.\n";
# need to redo the current character
$buffer[$encode_count++] = $encode_table[(((vec($decoded_attachment_data[$i-1],0,8) & 0x03) << 4) | ((vec($decoded_attachment_data[$i],0,8) & 0xF0) >>
4))];
$buffer[$encode_count++] = $encode_table[((vec($decoded_attachment_data[$i],0,8) & 0x0F) << 2)];
} else {
# need a pad character
$buffer[$encode_count++] = $padchar;
# DBG
print "Added a pad character\n";
}
# need at least one pad character
$buffer[$encode_count++] = $padchar;
# DBG
print "Added a pad character\n";
}
# convert to string - put a new line every LINESIZE chars
$buffer_string = "";
foreach $element (@buffer) {
$buffer_string .= $element;
}
for ($i=0; $i<= ($encode_count-$LINESIZE) ; $i+=$LINESIZE) {
# DBG
print "Entered the line-wrapping for loop. i=$i\n";
# convert LINESIZE bytes to string
$tmp_string = substr($buffer_string,$i,$LINESIZE);
# add this string to the encoded string, plus a newline
$encoded_attachment .= $tmp_string . "\n";
# DBG
#print "tmp_string: $tmp_string\n";
#print "encoded_attachment: $encoded_attachment\n\n";
}
# do any leftover chars
if ($i != $encode_count) {
# convert the remaining bytes to string
$tmp_string = substr($buffer_string,$i,$encode_count - $i);
# add this string to the encoded string, plus a newline
$encoded_attachment .= $tmp_string . "\n";
}
}
# DBG
print "The buffer holds: $buffer_string\n";
# set flag to indicate attachment has been encoded
$_attachment_encoded = 1;
# DBG
print "TEMP: \$encoded_attachment = $encoded_attachment\n\n";
# attachment is appropriately encoded by now
return $encoded_attachment;
} # sub printEncoded
sub expect {
my($ok);
my($mailtest) = shift;
my($error_test) = shift;
# DBG
#print "test: $mailtest\n";
#print "error_test: $error_test\n";
$mailcmd = "";
while (<S>) {
$mailcmd .= $_;
if (/$mailtest/i) {
$ok = 1;
last;
}
if (/$error_test/i) {
$ok = 0;
last;
}
}
return $ok;
}
__END__
=head1 NAME
mail.pl - Send SMTP/MIME email
=head1 SYNOPSIS
B<mail.pl> [B<-a file1[:file2...]>]
[B<-b bcc list>]
[B<-c cc list>]
[B<-f sender>]
[B<-h>]
[B<-m mailhost>]
[B<-o>]
[B<-w>]
[B<-p mail port>]
[B<-r replyto>]
[B<-s subject>]
[B<-u>]
to_addresses
=head1 DESCRIPTION
I<mail.pl> allows a user to send SMTP/MIME compliant email
to a specified list of email addresses.
I<mail.pl> is intended to be a nearly-complete drop-in
replacement for Unix's /bin/mail, when used to send mail.
This script provides similar command-line arguments but
is extended to enable the sending of MIME-compliant mail
and reduces the need for a local MTA.
Mail is sent via an SMTP-compliant network connection to
a mail transfer agent, possibly on a different machine.
This script will wait on STDIN (as does /bin/mail) for
some text to be used as the first (textual) message body
part. Unlike /bin/mail, this behavior may be overriden
by use of switch w. Failure to provide a Subject: on
the command line does NOT result in the user being asked
for one (this also differs from /bin/mail).
=head1 OPTIONS
=over 6
=item B<-u> (usage)
Display the usage statement.
=item B<-h> (help)
Display the man page.
=item B<-f sender> (Sender's email address)
Provide an email address for the person sending the message.
=item B<-r replyto> (Replyto email address)
Provide a replyto email address for the message.
=item B<-m mailhost> (Mailhost)
Provide the name of the SMTP mailhost used to route SMTP mail.
=item B<-o> (Header Override)
If this flag is set, the message provided must contain additional
headers followed by a blank line and a message body. It can be
used to write additional headers into a message. If you use this
option, you must provide the blank line separarting headers and body!
=item B<-w> (No STDIN)
If this flag is given, do not wait on STDIN for the first
(textual) message body part. The default is that this
script will wait for input via STDIN for some text to be
entered. The text entry is terminated by a Ctrl-D
interruption or by entering a '.' on a line by itself.
This flag overrides the default behavior.
=item B<-p mail port> (Mailhost port)
Provide a port number to use when sending mail to the mailhost specified. The default port is 25, a well-known port used for SMTP mail transfers.
=item B<-s subject> (Subject)
Provide the subject for the mail.
=item B<-a attachment list> (Attachment list)
List of files to be MIME encoded, and attached. This list is colon-separated if more than one file to attach is given. For example:
-a "file1.txt:file2.html:file3.gif:file4.ps"
would attach four files, but
-a file1.txt
would only attach one file.
=item B<-c cc list> (CC List)
Provides a list of addresses to cc the message to.
=item B<-b bcc list> (BCC List)
Provides a list of addresses to bcc the message to.
=item to_addresses (Recipients' email addresses)
A comma-separated list of email addresses for the recipient of the message. Each address must include an '@' sign.
=back
=head1 AUTHOR
David Wood <C<dwood@plugged.net.au>> and
Brad Marshall <C<bmarshal@plugged.net.au>>
=head1 LIMITATIONS
This script is intended to be a drop-in replacement for the UNIX /bin/mail program for sending mail, with enhancements to allow MIME compliance. However, no attempt has been made to duplicate or replace /bin/mail's e-mail reading and manipulation capabilities.
=head1 SEE ALSO
Plugged In Software
http://www.plugged.net.au/
=cut