[Mailmunge] Fetching all Headers.

list at ptld.com list at ptld.com
Mon Nov 11 19:53:18 EST 2024


> The best way i found so far is:
>   my $all_headers = $ctx->mime_entity->head->as_string;
>   my @full_headers = split(/\n/, $all_headers);
>   chomp @full_headers;
>   my %headers;
>   foreach (@full_headers) {
>     my ($k, $v) = split(/\s*:\s*/, $_, 2);
>     $headers{$k} = $v;
>   }


I take that back, this method is flawed also because it doesn't account for 
when a single header has multiple lines like a DKIM key.
What would be the correct approach?


More information about the Mailmunge mailing list