4 use vars qw ( @ISA @EXPORT_OK $DEBUG $DISABLE_ALL_NOTICES );
8 use IPC::Run qw( run timeout ); # for _pslatex
9 use IPC::Run3; # for do_print... should just use IPC::Run i guess
13 #do NOT depend on any FS:: modules here, causes weird (sometimes unreproducable
14 #until on client machine) dependancy loops. put them in FS::Misc::Something
17 @ISA = qw( Exporter );
18 @EXPORT_OK = qw( send_email generate_email send_fax
19 states_hash counties cities state_label
22 generate_ps generate_pdf do_print
32 FS::Misc - Miscellaneous subroutines
36 use FS::Misc qw(send_email);
42 Miscellaneous subroutines. This module contains miscellaneous subroutines
43 called from multiple other modules. These are not OO or necessarily related,
44 but are collected here to eliminate code duplication.
46 =head1 DISABLE ALL NOTICES
48 Set $FS::Misc::DISABLE_ALL_NOTICES to suppress:
52 =item FS::cust_bill::send_csv
54 =item FS::cust_bill::spool_csv
56 =item FS::msg_template::email::send_prepared
58 =item FS::Misc::send_email
60 =item FS::Misc::do_print
62 =item FS::Misc::send_fax
64 =item FS::Template_Mixin::postal_mail_fsinc
70 $DISABLE_ALL_NOTICES = 0;
76 =item send_email OPTION => VALUE ...
88 (required) comma-separated scalar or arrayref of recipients
96 (optional) MIME type for the body
100 (required unless I<nobody> is true) arrayref of body text lines
104 (optional, but required if I<nobody> is true) arrayref of MIME::Entity->build PARAMHASH refs or MIME::Entity objects. These will be passed as arguments to MIME::Entity->attach().
108 (optional) when set true, send_email will ignore the I<body> option and simply construct a message with the given I<mimeparts>. In this case,
109 I<content-type>, if specified, overrides the default "multipart/mixed" for the outermost MIME container.
111 =item content-encoding
113 (optional) when using nobody, optional top-level MIME
114 encoding which, if specified, overrides the default "7bit".
118 (optional) type parameter for multipart/related messages
122 (optional) L<FS::cust_main> key; if passed, the message will be logged
123 (if logging is enabled) with this custnum.
127 (optional) L<FS::msg_template> key, for logging.
133 use vars qw( $conf );
136 use Email::Sender::Simple qw(sendmail);
137 use Email::Sender::Transport::SMTP;
138 use Email::Sender::Transport::SMTP::TLS 0.11;
141 FS::UID->install_callback( sub {
142 $conf = new FS::Conf;
148 if ( $DISABLE_ALL_NOTICES ) {
149 warn 'send_email() disabled by $FS::Misc::DISABLE_ALL_NOTICES' if $DEBUG;
154 my %doptions = %options;
155 $doptions{'body'} = '(full body not shown in debug)';
156 warn "FS::Misc::send_email called with options:\n ". Dumper(\%doptions);
157 # join("\n", map { " $_: ". $options{$_} } keys %options ). "\n"
160 my @to = ref($options{to}) ? @{ $options{to} } : ( $options{to} );
164 if ( $options{'nobody'} ) {
166 croak "'mimeparts' option required when 'nobody' option given\n"
167 unless $options{'mimeparts'};
169 @mimeparts = @{$options{'mimeparts'}};
172 'Type' => ( $options{'content-type'} || 'multipart/mixed' ),
173 'Encoding' => ( $options{'content-encoding'} || '7bit' ),
178 @mimeparts = @{$options{'mimeparts'}}
179 if ref($options{'mimeparts'}) eq 'ARRAY';
181 if (scalar(@mimeparts)) {
184 'Type' => 'multipart/mixed',
185 'Encoding' => '7bit',
188 unshift @mimeparts, {
189 'Type' => ( $options{'content-type'} || 'text/plain' ),
190 'Charset' => 'UTF-8',
191 'Data' => ( $options{'content-type'} =~ /^text\//
192 ? Encode::encode_utf8( $options{'body'} )
195 'Encoding' => ( $options{'content-type'} ? '-SUGGEST' : '7bit' ),
196 'Disposition' => 'inline',
202 'Type' => ( $options{'content-type'} || 'text/plain' ),
203 'Data' => ( $options{'content-type'} =~ /^text\//
204 ? Encode::encode_utf8( $options{'body'} )
207 'Encoding' => ( $options{'content-type'} ? '-SUGGEST' : '7bit' ),
208 'Charset' => 'UTF-8',
215 my $from = $options{from};
216 $from =~ s/^\s*//; $from =~ s/\s*$//;
217 if ( $from =~ /^(.*)\s*<(.*@.*)>$/ ) {
223 if ( $from =~ /\@([\w\.\-]+)/ ) {
226 warn 'no domain found in invoice from address '. $options{'from'}.
227 '; constructing Message-ID (and saying HELO) @example.com';
228 $domain = 'example.com';
230 my $message_id = join('.', rand()*(2**32), $$, time). "\@$domain";
233 my $message = MIME::Entity->build(
234 'From' => $options{'from'},
235 'To' => join(', ', @to),
236 'Sender' => $options{'from'},
237 'Reply-To' => $options{'from'},
238 'Date' => time2str("%a, %d %b %Y %X %z", $time),
239 'Subject' => Encode::encode('MIME-Header', $options{'subject'}),
240 'Message-ID' => "<$message_id>",
244 if ( $options{'type'} ) {
245 #false laziness w/cust_bill::generate_email
246 $message->head->replace('Content-type',
248 '; boundary="'. $message->head->multipart_boundary. '"'.
249 '; type='. $options{'type'}
253 foreach my $part (@mimeparts) {
255 if ( UNIVERSAL::isa($part, 'MIME::Entity') ) {
257 warn "attaching MIME part from MIME::Entity object\n"
259 $message->add_part($part);
261 } elsif ( ref($part) eq 'HASH' ) {
263 warn "attaching MIME part from hashref:\n".
264 join("\n", map " $_: ".$part->{$_}, keys %$part ). "\n"
266 $message->attach(%$part);
269 croak "mimepart $part isn't a hashref or MIME::Entity object!";
276 my %smtp_opt = ( 'host' => $conf->config('smtpmachine'),
280 my($port, $enc) = split('-', ($conf->config('smtp-encryption') || '25') );
281 $smtp_opt{'port'} = $port;
284 if ( defined($enc) && $enc eq 'starttls' ) {
285 $smtp_opt{$_} = $conf->config("smtp-$_") for qw(username password);
286 $transport = Email::Sender::Transport::SMTP::TLS->new( %smtp_opt );
288 if ( $conf->exists('smtp-username') && $conf->exists('smtp-password') ) {
289 $smtp_opt{"sasl_$_"} = $conf->config("smtp-$_") for qw(username password);
291 $smtp_opt{'ssl'} = 1 if defined($enc) && $enc eq 'tls';
292 $transport = Email::Sender::Transport::SMTP->new( %smtp_opt );
295 push @to, $options{bcc} if defined($options{bcc});
296 # fully unpack all addresses found in @to (including Bcc) to make the
299 foreach my $dest (@to) {
300 push @env_to, map { $_->address } Email::Address->parse($dest);
303 local $@; # just in case
304 eval { sendmail($message, { transport => $transport,
309 if(ref($@) and $@->isa('Email::Sender::Failure')) {
310 $error = $@->code.' ' if $@->code;
311 $error .= $@->message;
318 if ( $conf->exists('log_sent_mail') ) {
319 my $cust_msg = FS::cust_msg->new({
320 'env_from' => $options{'from'},
321 'env_to' => join(', ', @env_to),
322 'header' => $message->header_as_string,
323 'body' => $message->body_as_string,
326 'custnum' => $options{'custnum'},
327 'msgnum' => $options{'msgnum'},
328 'status' => ($error ? 'failed' : 'sent'),
329 'msgtype' => $options{'msgtype'},
331 my $log_error = $cust_msg->insert;
332 warn "Error logging message: $log_error\n" if $log_error; # at least warn
338 =item generate_email OPTION => VALUE ...
346 Sender address, required
350 Recipient address, required
354 Blind copy address, optional
358 email subject, required
362 Email body (HTML alternative). Arrayref of lines, or scalar.
364 Will be placed inside an HTML <BODY> tag.
368 Email body (Text alternative). Arrayref of lines, or scalar.
370 =item custnum, msgnum (optional)
372 Customer and template numbers, passed through to send_email for logging.
376 Constructs a multipart message from text_body and html_body.
380 #false laziness w/FS::cust_bill::generate_email
388 my $me = '[FS::Misc::generate_email]';
390 my @fields = qw(from to bcc subject custnum msgnum msgtype);
392 @return{@fields} = @args{@fields};
394 warn "$me creating HTML/text multipart message"
397 $return{'nobody'} = 1;
399 my $alternative = build MIME::Entity
400 'Type' => 'multipart/alternative',
401 'Encoding' => '7bit',
402 'Disposition' => 'inline'
406 if ( ref($args{'text_body'}) eq 'ARRAY' ) {
407 $data = join("\n", @{ $args{'text_body'} });
409 $data = $args{'text_body'};
412 $alternative->attach(
413 'Type' => 'text/plain',
414 'Encoding' => 'quoted-printable',
415 'Charset' => 'UTF-8',
416 #'Encoding' => '7bit',
417 'Data' => Encode::encode_utf8($data),
418 'Disposition' => 'inline',
422 if ( ref($args{'html_body'}) eq 'ARRAY' ) {
423 @html_data = @{ $args{'html_body'} };
425 @html_data = split(/\n/, $args{'html_body'});
428 $alternative->attach(
429 'Type' => 'text/html',
430 'Encoding' => 'quoted-printable',
431 'Data' => [ '<html>',
434 ' '. encode_entities($return{'subject'}),
437 ' <body bgcolor="#ffffff">',
438 ( map Encode::encode_utf8($_), @html_data ),
442 'Disposition' => 'inline',
443 #'Filename' => 'invoice.pdf',
446 #no other attachment:
448 # multipart/alternative
452 $return{'content-type'} = 'multipart/related';
453 $return{'mimeparts'} = [ $alternative ];
454 $return{'type'} = 'multipart/alternative'; #Content-Type of first part...
455 #$return{'disposition'} = 'inline';
461 =item send_fax OPTION => VALUE ...
465 I<dialstring> - (required) 10-digit phone number w/ area code
467 I<docdata> - (required) Array ref containing PostScript or TIFF Class F document
471 I<docfile> - (required) Filename of PostScript TIFF Class F document
473 ...any other options will be passed to L<Fax::Hylafax::Client::sendfax>
482 die 'HylaFAX support has not been configured.'
483 unless $conf->exists('hylafax');
485 if ( $DISABLE_ALL_NOTICES ) {
486 warn 'send_fax() disabled by $FS::Misc::DISABLE_ALL_NOTICES' if $DEBUG;
491 require Fax::Hylafax::Client;
495 if ($@ =~ /^Can't locate Fax.*/) {
496 die "You must have Fax::Hylafax::Client installed to use invoice faxing."
502 my %hylafax_opts = map { split /\s+/ } $conf->config('hylafax');
504 die 'Called send_fax without a \'dialstring\'.'
505 unless exists($options{'dialstring'});
507 if (exists($options{'docdata'}) and ref($options{'docdata'}) eq 'ARRAY') {
508 my $dir = $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc;
509 my $fh = new File::Temp(
510 TEMPLATE => 'faxdoc.'. $options{'dialstring'} . '.XXXXXXXX',
513 ) or die "can't open temp file: $!\n";
515 $options{docfile} = $fh->filename;
517 print $fh @{$options{'docdata'}};
520 delete $options{'docdata'};
523 die 'Called send_fax without a \'docfile\' or \'docdata\'.'
524 unless exists($options{'docfile'});
526 #FIXME: Need to send canonical dialstring to HylaFAX, but this only
529 $options{'dialstring'} =~ s/[^\d\+]//g;
530 if ($options{'dialstring'} =~ /^\d{10}$/) {
531 $options{dialstring} = '+1' . $options{'dialstring'};
533 return 'Invalid dialstring ' . $options{'dialstring'} . '.';
536 my $faxjob = &Fax::Hylafax::Client::sendfax(%options, %hylafax_opts);
538 if ($faxjob->success) {
539 warn "Successfully queued fax to '$options{dialstring}' with jobid " .
544 return 'Error while sending FAX: ' . $faxjob->trace;
549 =item states_hash COUNTRY
551 Returns a list of key/value pairs containing state (or other sub-country
552 division) abbriviations and names.
556 use FS::Record qw(qsearch);
557 use Locale::SubCountry;
562 #a hash? not expecting an explosion of business from unrecognized countries..
563 return states_hash_nosubcountry($country) if $country eq 'XC';
567 map { s/[\n\r]//g; $_; }
571 'table' => 'cust_main_county',
572 'hashref' => { 'country' => $country },
573 'extra_sql' => 'GROUP BY state',
576 #it could throw a fatal "Invalid country code" error (for example "AX")
577 my $subcountry = eval { new Locale::SubCountry($country) }
578 or return (); # ( '', '(n/a)' );
580 #"i see your schwartz is as big as mine!"
581 map { ( $_->[0] => $_->[1] ) }
582 sort { $a->[1] cmp $b->[1] }
583 map { [ $_ => state_label($_, $subcountry) ] }
587 sub states_hash_nosubcountry {
592 map { s/[\n\r]//g; $_; }
596 'table' => 'cust_main_county',
597 'hashref' => { 'country' => $country },
598 'extra_sql' => 'GROUP BY state',
601 #"i see your schwartz is as big as mine!"
602 map { ( $_->[0] => $_->[1] ) }
603 sort { $a->[1] cmp $b->[1] }
608 =item counties STATE COUNTRY
610 Returns a list of counties for this state and country.
615 my( $state, $country ) = @_;
617 map { $_ } #return num_counties($state, $country) unless wantarray;
618 sort map { s/[\n\r]//g; $_; }
621 'select' => 'DISTINCT county',
622 'table' => 'cust_main_county',
623 'hashref' => { 'state' => $state,
624 'country' => $country,
629 =item cities COUNTY STATE COUNTRY
631 Returns a list of cities for this county, state and country.
636 my( $county, $state, $country ) = @_;
638 map { $_ } #return num_cities($county, $state, $country) unless wantarray;
639 sort map { s/[\n\r]//g; $_; }
642 'select' => 'DISTINCT city',
643 'table' => 'cust_main_county',
644 'hashref' => { 'county' => $county,
646 'country' => $country,
651 =item state_label STATE COUNTRY_OR_LOCALE_SUBCOUNRY_OBJECT
656 my( $state, $country ) = @_;
658 unless ( ref($country) ) {
659 $country = eval { new Locale::SubCountry($country) }
664 # US kludge to avoid changing existing behaviour
665 # also we actually *use* the abbriviations...
666 my $full_name = $country->country_code eq 'US'
668 : $country->full_name($state);
670 $full_name = '' if $full_name eq 'unknown';
671 $full_name =~ s/\(see also.*\)\s*$//;
672 $full_name .= " ($state)" if $full_name;
674 $full_name || $state || '(n/a)';
680 Returns a hash reference of the accepted credit card types. Keys are shorter
681 identifiers and values are the longer strings used by the system (see
682 L<Business::CreditCard>).
689 my $conf = new FS::Conf;
692 #displayname #value (Business::CreditCard)
693 "VISA" => "VISA card",
694 "MasterCard" => "MasterCard",
695 "Discover" => "Discover card",
696 "American Express" => "American Express card",
697 "Diner's Club/Carte Blanche" => "Diner's Club/Carte Blanche",
698 "enRoute" => "enRoute",
700 "BankCard" => "BankCard",
701 "Switch" => "Switch",
704 my @conf_card_types = grep { ! /^\s*$/ } $conf->config('card-types');
705 if ( @conf_card_types ) {
706 #perhaps the hash is backwards for this, but this way works better for
707 #usage in selfservice
708 %card_types = map { $_ => $card_types{$_} }
711 grep { $card_types{$d} eq $_ } @conf_card_types
721 Returns a hash reference of allowed package billing frequencies.
726 tie my %freq, 'Tie::IxHash', (
727 '0' => '(no recurring fee)',
730 '2d' => 'every two days',
731 '3d' => 'every three days',
733 '2w' => 'biweekly (every 2 weeks)',
735 '45d' => 'every 45 days',
736 '2' => 'bimonthly (every 2 months)',
737 '3' => 'quarterly (every 3 months)',
738 '4' => 'every 4 months',
739 '137d' => 'every 4 1/2 months (137 days)',
740 '6' => 'semiannually (every 6 months)',
742 '13' => 'every 13 months (annually +1 month)',
743 '24' => 'biannually (every 2 years)',
744 '36' => 'triannually (every 3 years)',
745 '48' => '(every 4 years)',
746 '60' => '(every 5 years)',
747 '120' => '(every 10 years)',
752 =item generate_ps FILENAME
754 Returns an postscript rendition of the LaTex file, as a scalar.
755 FILENAME does not contain the .tex suffix and is unlinked by this function.
759 use String::ShellQuote;
764 my $dir = $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc;
769 my $papersize = $conf->config('papersize') || 'letter';
771 local($SIG{CHLD}) = sub {};
773 system('dvips', '-q', '-t', $papersize, "$file.dvi", '-o', "$file.ps" ) == 0
774 or die "dvips failed";
776 open(POSTSCRIPT, "<$file.ps")
777 or die "can't open $file.ps: $! (error in LaTeX template?)\n";
779 unlink("$file.dvi", "$file.log", "$file.aux", "$file.ps", "$file.tex")
780 unless $FS::CurrentUser::CurrentUser->option('save_tmp_typesetting');
784 if ( $conf->exists('lpr-postscript_prefix') ) {
785 my $prefix = $conf->config('lpr-postscript_prefix');
786 $ps .= eval qq("$prefix");
789 while (<POSTSCRIPT>) {
795 if ( $conf->exists('lpr-postscript_suffix') ) {
796 my $suffix = $conf->config('lpr-postscript_suffix');
797 $ps .= eval qq("$suffix");
804 =item generate_pdf FILENAME
806 Returns an PDF rendition of the LaTex file, as a scalar. FILENAME does not
807 contain the .tex suffix and is unlinked by this function.
811 use String::ShellQuote;
816 my $dir = $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc;
819 #system('pdflatex', "$file.tex");
820 #system('pdflatex', "$file.tex");
821 #! LaTeX Error: Unknown graphics extension: .eps.
825 my $sfile = shell_quote $file;
827 #system('dvipdf', "$file.dvi", "$file.pdf" );
828 my $papersize = $conf->config('papersize') || 'letter';
830 local($SIG{CHLD}) = sub {};
833 "dvips -q -f $sfile.dvi -t $papersize ".
834 "| gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$sfile.pdf ".
837 or die "dvips | gs failed: $!";
839 open(PDF, "<$file.pdf")
840 or die "can't open $file.pdf: $! (error in LaTeX template?)\n";
842 unlink("$file.dvi", "$file.log", "$file.aux", "$file.pdf", "$file.tex")
843 unless $FS::CurrentUser::CurrentUser->option('save_tmp_typesetting');
859 #my $sfile = shell_quote $file;
863 '-interaction=batchmode',
864 '\AtBeginDocument{\RequirePackage{pslatex}}',
865 '\def\PSLATEXTMP{\futurelet\PSLATEXTMP\PSLATEXTMPB}',
866 '\def\PSLATEXTMPB{\ifx\PSLATEXTMP\nonstopmode\else\input\fi}',
871 my $timeout = 30; #? should be more than enough
875 local($SIG{CHLD}) = sub {};
876 run( \@cmd, '>'=>'/dev/null', '2>'=>'/dev/null', timeout($timeout) )
877 or warn "bad exit status from pslatex pass $_\n";
881 return if -e "$file.dvi" && -s "$file.dvi";
882 die "pslatex $file.tex failed, see $file.log for details?\n";
886 =item do_print ARRAYREF [, OPTION => VALUE ... ]
888 Sends the lines in ARRAYREF to the printer.
890 Options available are:
896 Uses this agent's 'lpr' configuration setting override instead of the global
901 Uses this command instead of the configured lpr command (overrides both the
902 global value and agentnum).
907 my( $data, %opt ) = @_;
909 if ( $DISABLE_ALL_NOTICES ) {
910 warn 'do_print() disabled by $FS::Misc::DISABLE_ALL_NOTICES' if $DEBUG;
914 my $lpr = ( exists($opt{'lpr'}) && $opt{'lpr'} )
916 : $conf->config('lpr', $opt{'agentnum'} );
919 local($SIG{CHLD}) = sub {};
920 run3 $lpr, $data, \$outerr, \$outerr;
922 $outerr = ": $outerr" if length($outerr);
923 die "Error from $lpr (exit status ". ($?>>8). ")$outerr\n";
928 =item csv_from_fixed, FILEREF COUNTREF, [ LENGTH_LISTREF, [ CALLBACKS_LISTREF ] ]
930 Converts the filehandle referenced by FILEREF from fixed length record
931 lines to a CSV file according to the lengths specified in LENGTH_LISTREF.
932 The CALLBACKS_LISTREF refers to a correpsonding list of coderefs. Each
933 should return the value to be substituted in place of its single argument.
935 Returns false on success or an error if one occurs.
940 my( $fhref, $countref, $lengths, $callbacks) = @_;
942 eval { require Text::CSV_XS; };
946 my $unpacker = new Text::CSV_XS;
948 my $template = join('', map {$total += $_; "A$_"} @$lengths) if $lengths;
950 my $dir = "%%%FREESIDE_CACHE%%%/cache.$FS::UID::datasrc";
951 my $fh = new File::Temp( TEMPLATE => "FILE.csv.XXXXXXXX",
954 ) or return "can't open temp file: $!\n"
957 while ( defined(my $line=<$ofh>) ) {
963 return "unexpected input at line $$countref: $line".
964 " -- expected $total but received ". length($line)
965 unless length($line) == $total;
967 $unpacker->combine( map { my $i = $column++;
968 defined( $callbacks->[$i] )
969 ? &{ $callbacks->[$i] }( $_ )
971 } unpack( $template, $line )
973 or return "invalid data for CSV: ". $unpacker->error_input;
975 print $fh $unpacker->string(), "\n"
976 or return "can't write temp file: $!\n";
980 if ( $template ) { close $$fhref; $$fhref = $fh }
986 =item ocr_image IMAGE_SCALAR
988 Runs OCR on the provided image data and returns a list of text lines.
993 my $logo_data = shift;
995 #XXX use conf dir location from Makefile
996 my $dir = $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc;
997 my $fh = new File::Temp(
998 TEMPLATE => 'bizcard.XXXXXXXX',
999 SUFFIX => '.png', #XXX assuming, but should handle jpg, gif, etc. too
1002 ) or die "can't open temp file: $!\n";
1004 my $filename = $fh->filename;
1006 print $fh $logo_data;
1009 local($SIG{CHLD}) = sub {};
1011 run( [qw(ocroscript recognize), $filename], '>'=>"$filename.hocr" )
1012 or die "ocroscript recognize failed\n";
1014 run( [qw(ocroscript hocr-to-text), "$filename.hocr"], '>pipe'=>\*OUT )
1015 or die "ocroscript hocr-to-text failed\n";
1017 my @lines = split(/\n/, <OUT> );
1019 foreach (@lines) { s/\.c0m\s*$/.com/; }
1024 =item bytes_substr STRING, OFFSET[, LENGTH[, REPLACEMENT] ]
1027 Use Unicode::Truncate truncate_egc instead
1029 A replacement for "substr" that counts raw bytes rather than logical
1030 characters. Unlike "bytes::substr", will suppress fragmented UTF-8 characters
1031 rather than output them. Unlike real "substr", is not an lvalue.
1035 # sub bytes_substr {
1036 # my ($string, $offset, $length, $repl) = @_;
1037 # my $bytes = substr(
1038 # Encode::encode('utf8', $string),
1041 # Encode::encode('utf8', $repl)
1043 # my $chk = $DEBUG ? Encode::FB_WARN : Encode::FB_QUIET;
1044 # return Encode::decode('utf8', $bytes, $chk);
1049 Accepts a postive or negative numerical value.
1050 Returns amount formatted for display,
1051 including money character.
1057 my $money_char = $conf->{'money_char'} || '$';
1058 $amount = sprintf("%0.2f",$amount);
1059 $amount =~ s/^(-?)/$1$money_char/;
1067 This package exists.
1071 L<FS::UID>, L<FS::CGI>, L<FS::Record>, the base documentation.
1073 L<Fax::Hylafax::Client>