Ticket #2974: fax-process.pl.diff
| File fax-process.pl.diff, 2.0 kB (added by ip-rob, 4 months ago) |
|---|
-
fax-process.pl.old
old new 11 11 # Default paramaters 12 12 my $to = "xrobau\@gmail.com"; 13 13 my $from = "fax\@"; 14 my $dest = undef; 14 15 my $subject = "Fax received"; 15 16 my $ct = "application/x-pdf"; 16 17 my $file = undef; … … 25 26 $from .= $hostname; 26 27 27 28 # Usage: 28 my $usage="Usage: --file filename [--attachment filename] [--to email_address] [--from email_address] [--type content/type] [--subject \"Subject Of Email\"] ";29 my $usage="Usage: --file filename [--attachment filename] [--to email_address] [--from email_address] [--type content/type] [--subject \"Subject Of Email\"] [--dest DID]"; 29 30 30 31 # Parse command line.. 31 32 while (my $cmd = shift @ARGV) { … … 87 88 } elsif ($cmd eq "--attachment") { 88 89 my $tmp = shift @ARGV; 89 90 $attachment = $tmp if (defined $tmp); 91 } elsif ($cmd eq "--dest") { 92 my $tmp = shift @ARGV; 93 if ($tmp =~ /\^(\")|^(\')/) { 94 # It's a quoted string 95 my $delim = $+; # $+ is 'last match', which is ' or " 96 $tmp =~ s/\Q$delim\E//; # Strip out ' or " 97 $dest = $tmp; 98 while ($tmp = shift @ARGV) { 99 if ($tmp =~ /\Q$delim\E/) { 100 $tmp =~ s/\Q$delim\E//; 101 last; 102 } 103 $dest .= $tmp; 104 } 105 } else { 106 # It's a single word 107 $dest = $tmp; 108 } 90 109 } else { 91 110 die "$cmd not understood\n$usage\n"; 92 111 } … … 156 175 Content-Type: text/plain; charset=\"us-ascii\" 157 176 Content-Transfer-Encoding: quoted-printable 158 177 159 A Fax has been recieved by the fax gateway, and is attached to this message. 178 A Fax has been recieved by the fax gateway and is attached to this message. 179 180 The destination number for this fax is ".$dest." 160 181 161 182 162 183 --$boundary
