48 |
capitalize => 1, |
capitalize => 1, |
49 |
fold_length => 70, |
fold_length => 70, |
50 |
mail_from => 0, |
mail_from => 0, |
51 |
field_type => {_DEFAULT => 'Message::Field::Unstructured'}, |
field_type => {':DEFAULT' => 'Message::Field::Unstructured'}, |
52 |
); |
); |
53 |
my @field_type_Structured = qw(cancel-lock content-language |
my @field_type_Structured = qw(cancel-lock |
54 |
content-transfer-encoding |
importance mime-version path precedence user-agent x-cite |
55 |
encrypted followup-to importance mime-version newsgroups |
x-face x-mail-count x-msmail-priority x-priority x-uidl xref); |
|
path precedence user-agent x-cite |
|
|
x-face x-mail-count |
|
|
x-msmail-priority x-priority x-uidl xref); |
|
56 |
for (@field_type_Structured) |
for (@field_type_Structured) |
57 |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Structured'} |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Structured'} |
58 |
my @field_type_Address = qw(approved bcc cc delivered-to envelope-to |
my @field_type_Address = qw(approved bcc cc delivered-to envelope-to |
59 |
errors-to from mail-followup-to reply-to resent-bcc |
errors-to fcc from mail-followup-to mail-followup-cc mail-from reply-to resent-bcc |
60 |
resent-cc resent-to resent-from resent-sender return-path |
resent-cc resent-to resent-from resent-sender return-path |
61 |
return-receipt-to sender to x-approved x-beenthere |
return-receipt-to sender to x-approved x-beenthere |
62 |
x-complaints-to x-envelope-from x-envelope-sender |
x-complaints-to x-envelope-from x-envelope-sender |
63 |
x-envelope-to x-ml-address x-ml-command x-ml-to); |
x-envelope-to x-ml-address x-ml-command x-ml-to x-nfrom x-nto); |
64 |
for (@field_type_Address) |
for (@field_type_Address) |
65 |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Address'} |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Address'} |
66 |
my @field_type_Date = qw(date date-received delivery-date expires |
my @field_type_Date = qw(date date-received delivery-date expires |
71 |
references resent-message-id see-also supersedes); |
references resent-message-id see-also supersedes); |
72 |
for (@field_type_MsgID) |
for (@field_type_MsgID) |
73 |
{$DEFAULT{field_type}->{$_} = 'Message::Field::MsgID'} |
{$DEFAULT{field_type}->{$_} = 'Message::Field::MsgID'} |
74 |
my @field_type_Received = qw(received x-received); |
for (qw(received x-received)) |
|
for (@field_type_Received) |
|
75 |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Received'} |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Received'} |
76 |
my @field_type_Param = qw(content-disposition content-type |
for (qw(accept accept-charset accept-encoding accept-language |
77 |
|
content-disposition content-language |
78 |
|
content-transfer-encoding content-type encrypted followup-to keywords newsgroups |
79 |
x-brother x-daughter x-face-type x-respect x-moe |
x-brother x-daughter x-face-type x-respect x-moe |
80 |
x-syster x-wife); |
x-syster x-wife)) |
81 |
for (@field_type_Param) |
{$DEFAULT{field_type}->{$_} = 'Message::Field::CSV'} |
|
{$DEFAULT{field_type}->{$_} = 'Message::Field::Structured'} |
|
82 |
my @field_type_URI = qw(list-archive list-help list-owner |
my @field_type_URI = qw(list-archive list-help list-owner |
83 |
list-post list-subscribe list-unsubscribe uri url x-home-page x-http_referer |
list-post list-subscribe list-unsubscribe uri url x-home-page x-http_referer |
84 |
x-info x-pgp-key x-ml-url x-uri x-url x-web); |
x-info x-pgp-key x-ml-url x-uri x-url x-web); |
85 |
for (@field_type_URI) |
for (@field_type_URI) |
86 |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Structured'} |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Structured'} |
87 |
my @field_type_ListID = qw(list-id); |
for (qw(list-id)) |
|
for (@field_type_ListID) |
|
88 |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Structured'} |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Structured'} |
89 |
my @field_type_Subject = qw(content-description subject title); |
for (qw(content-description subject title x-nsubject)) |
|
for (@field_type_Subject) |
|
90 |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Subject'} |
{$DEFAULT{field_type}->{$_} = 'Message::Field::Subject'} |
91 |
|
|
92 |
=head2 Message::Header->new ([%option]) |
=head2 Message::Header->new ([%option]) |
183 |
my ($body, $name) = @_; |
my ($body, $name) = @_; |
184 |
unless (ref $body) { |
unless (ref $body) { |
185 |
my $type = $self->{option}->{field_type}->{$name} |
my $type = $self->{option}->{field_type}->{$name} |
186 |
|| $self->{option}->{field_type}->{_DEFAULT}; |
|| $self->{option}->{field_type}->{':DEFAULT'}; |
187 |
eval "require $type"; |
eval "require $type"; |
188 |
unless ($body) { |
unless ($body) { |
189 |
$body = $type->new (field_name => $name); |
$body = $type->new (field_name => $name); |
354 |
$self->{option}->{field_type}->{$field_name} = $new_field_type; |
$self->{option}->{field_type}->{$field_name} = $new_field_type; |
355 |
} |
} |
356 |
$self->{option}->{field_type}->{$field_name} |
$self->{option}->{field_type}->{$field_name} |
357 |
|| $self->{option}->{field_type}->{_DEFAULT}; |
|| $self->{option}->{field_type}->{':DEFAULT'}; |
358 |
} |
} |
359 |
|
|
360 |
sub _delete_empty_field ($) { |
sub _delete_empty_field ($) { |