[Mimedefang] Help with header checking

Dianne Skoll dianne at skoll.ca
Tue Dec 1 13:54:50 EST 2020


On Tue, 1 Dec 2020 13:10:43 -0500
Joseph Brennan <brennan at columbia.edu> wrote:

> We used this to create an array of header information:

> if (open(IN, '<', './HEADERS')) {
>         while(<IN>) {
>             chomp;
>             if (/^(\S+):\s*(.*)/) {
>                 my $label = $1;
>                 my $data  = $2;
>                 $label = lc($label);
>                 $Header{$label} = $data;
>                 if ($label eq 'received') {
>                     push(@Received,$data);
>                 }
>         }
>         close(IN);
>     }

Hmm.  Received: isn't the only header that can permit multiple instances.
You may lose some information here.

Why would you not just use the MIME::Head object that you can
get from $entity->head?  It has all the headers pre-parsed and has
decent accessors.

(I assume this is all academic (heh...) as Columbia looks to be
using Proofpoint now.)

Regards,

Dianne.



More information about the MIMEDefang mailing list