- my $subject = decode_rfc1522($entity->head->get('Subject:'));
- $subject =~ s/\n(?:(\s)\s*|\s*$)/$1/g;
- my $to = decode_rfc1522($entity->head->get('To:'));
- $to =~ s/\n(?:(\s)\s*|\s*$)/$1/g;
- my $from = decode_rfc1522($entity->head->get('From:'));
- $from =~ s/\n(?:(\s)\s*|\s*$)/$1/g;
+ my $subject = decode_rfc1522($entity->head->get('Subject')//'');
+ $subject =~ s/\n(?:(\s)\s*|\s*$)//g;
+ my $to = decode_rfc1522($entity->head->get('To')//'');
+ $to =~ s/\n(?:(\s)\s*|\s*$)//g;
+ my $from = decode_rfc1522($entity->head->get('From')//'');
+ $from =~ s/\n(?:(\s)\s*|\s*$)//g;