
=head1 NAME

Mail::Transport::Mailx - transmit messages using external mailx program

=head1 CLASS INHERITANCE

 Mail::Transport::Mailx
   is a Mail::Transport::Send
   is a Mail::Transport
   is a Mail::Reporter

=head1 SYNOPSIS

 my $sender = Mail::Transport::Mailx->new(...);
 $sender->send($message);

=head1 DESCRIPTION

Implements mail transport using the external programs C<'mailx'>,
C<Mail>, or C<'mail'>.  When instantiated, the mailer will look for
any of these binaries in specific system directories, and the first
program found is taken.

B<WARNING: There are many security issues with mail and mailx. DO NOT USE
these commands to send messages which contains data derived from any
external source!!!>

Under Linux, freebsd, and bsdos the C<mail>, C<Mail>, and C<mailx> names are
just links to the same binary.  The implementation is very primitive, pre-MIME
standard,  what may cause many headers to be lost.  For these platforms (and
probably for other platforms as well), you can better not use this transport
mechanism.

=head1 METHODS

=head2 Initiation

=over 4

=item B<new> OPTIONS

(Class method)

 OPTION               DEFAULT
 executable           C<undef>
 hostname             'localhost'
 interval             30
 log                  'WARNINGS'
 password             undef
 port                 undef
 proxy                undef
 retry                <false>
 style                <autodetect>
 timeout              120
 trace                'WARNINGS'
 username             undef
 via                  'mailx'

=over 4

=item B<executable> =E<gt> FILENAME

See Mail::Transport::new(executable)

=item B<hostname> =E<gt> HOSTNAME|ARRAY-OF-HOSTNAMES

See Mail::Transport::new(hostname)

=item B<interval> =E<gt> SECONDS

See Mail::Transport::new(interval)

=item B<log> =E<gt> LEVEL

See Mail::Reporter::new(log)

=item B<password> =E<gt> STRING

See Mail::Transport::new(password)

=item B<port> =E<gt> INTEGER

See Mail::Transport::new(port)

=item B<proxy> =E<gt> PATH

See Mail::Transport::new(proxy)

=item B<retry> =E<gt> NUMBER|undef

See Mail::Transport::new(retry)

=item B<style> =E<gt> 'BSD'|'RFC822'

There are two version of the C<mail> program.  The newest accepts
RFC822 messages, and automagically collect information about where
the message is to be send to.  The BSD style mail command predates
MIME, and expects lines which start with a '~' (tilde) to specify
destinations and such.  This field is autodetect, however on some
platforms both versions of C<mail> can live (like various Linux
distributions).

=item B<timeout> =E<gt> SECONDS

See Mail::Transport::new(timeout)

=item B<trace> =E<gt> LEVEL

See Mail::Reporter::new(trace)

=item B<username> =E<gt> STRING

See Mail::Transport::new(username)

=item B<via> =E<gt> CLASS|NAME

See Mail::Transport::new(via)

=back

=back

=head2 Server Connection

=over 4

=item B<findBinary> NAME [, DIRECTORIES]

See Mail::Transport::findBinary()

=item B<remoteHost> 

See Mail::Transport::remoteHost()

=item B<retry> 

See Mail::Transport::retry()

=back

=head2 Sending Mail

=over 4

=item B<putContent> MESSAGE, FILEHANDLE, OPTIONS

See Mail::Transport::Send::putContent()

=item B<send> MESSAGE, OPTIONS

See Mail::Transport::Send::send()

=item B<trySend> MESSAGE, OPTIONS

=back

=head2 Logging and Tracing

=over 4

=item B<defaultTrace> [LEVEL, [LEVEL]

See Mail::Reporter::defaultTrace()

=item B<errors> 

See Mail::Reporter::errors()

=item B<log> [LEVEL [,STRINGS]]

See Mail::Reporter::log()

=item B<report> [LEVEL]

See Mail::Reporter::report()

=item B<reportAll> [LEVEL]

See Mail::Reporter::reportAll()

=item B<trace> [LEVEL]

See Mail::Reporter::trace()

=item B<warnings> 

See Mail::Reporter::warnings()

=back

=head2 Other Methods

=over 4

=item B<AUTOLOAD> 

See Mail::Reporter::AUTOLOAD()

=item B<DESTROY> 

See Mail::Reporter::DESTROY()

=item B<inGlobalDestruction> 

See Mail::Reporter::inGlobalDestruction()

=item B<logPriority> LEVEL

See Mail::Reporter::logPriority()

=item B<logSettings> 

See Mail::Reporter::logSettings()

=item B<notImplemented> 

See Mail::Reporter::notImplemented()

=back

=head1 SEE ALSO

A good start to read is Mail::Box-Overview.
More documentation and a mailinglist are available from the project's
website at L<http://perl.overmeer.net/mailbox/>.

=head1 AUTHOR

Written by Mark Overmeer (L<mark@overmeer.net|mailto:mark@overmeer.net>)
with the help of many.  See the ChangeLog for details.

=head1 VERSION

This code is beta, version 2.037.

Copyright (c) 2001-2003 by the authors. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
