| 1 | package Email::Simple::OneLineHeaders; | ||
| 2 | |||
| 3 | use 5.00503; | ||
| 4 | use strict; | ||
| 5 | use Carp; | ||
| 6 | use Email::Simple; | ||
| 7 | use vars qw($VERSION @ISA); | ||
| 8 | $VERSION = '1.92'; | ||
| 9 | @ISA = qw(Email::Simple); | ||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | Email::Simple::OneLineHeaders - same as Email::Simple but without the folding | ||
| 14 | |||
| 15 | =head1 SYNOPSIS | ||
| 16 | |||
| 17 | my $mail = Email::Simple::OneLineHeaders->new($text); | ||
| 18 | print $mail->as_string; | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | The original Email::Simple might output something like this: | ||
| 23 | |||
| 24 | Received: from [10.10.10.178] (account jonathan [10.10.10.178] verified) | ||
| 25 | by imiinc.com (CommuniGate Pro SMTP 4.3.4) | ||
| 26 | with ESMTPA id 130117 for jonathan@imiinc.com; Wed, 27 Jul 2005 23:01:07 -0700 | ||
| 27 | |||
| 28 | But this module outputs one line headers: | ||
| 29 | |||
| 30 | Received: from [10.10.10.178] (account jonathan [10.10.10.178] verified) by imiinc.com (CommuniGate Pro SMTP 4.3.4) with ESMTPA id 130117 for jonathan@imiinc.com; Wed, 27 Jul 2005 23:01:07 -0700 | ||
| 31 | |||
| 32 | |||
| 33 | =head1 METHODS | ||
| 34 | |||
| 35 | Same as Email::Simple | ||
| 36 | |||
| 37 | =cut | ||
| 38 | |||
| 39 | sub _header_as_string { | ||
| 40 | my ($self, $field, $data) = @_; | ||
| 41 | my @stuff = @$data; | ||
| 42 | # Ignore "empty" headers | ||
| 43 | return '' unless @stuff = grep { defined $_ } @stuff; | ||
| 44 | return join "", map { $_ = "$field: $_$self->{mycrlf}"; | ||
| 45 | $_ } | ||
| 46 | @stuff; | ||
| 47 | } | ||
| 48 | |||
| 49 | 1; | ||
| 50 | |||
| 51 | __END__ |