This was causing warnings to pop up in syslogs for messages with
empty Subject headers.
sub subject_fn ($) {
my ($hdr) = @_;
my $fn = $hdr->header('Subject');
- return 'no-subject' unless defined($fn);
+ return 'no-subject' if (!defined($fn) || $fn eq '');
# no need for full Email::MIME, here
if ($fn =~ /=\?/) {
my $body = $class->new($ctx, $cb);
# http://www.iana.org/assignments/media-types/application/gzip
my @h = qw(Content-Type application/gzip);
- if ($fn) {
+ if (defined $fn && $fn ne '') {
$fn = to_filename($fn);
push @h, 'Content-Disposition', "inline; filename=$fn.mbox.gz";
}