Mail-Milter

 view release on metacpan or  search on metacpan

lib/Mail/Milter/Module/HeaderValidateMIME.pm  view on Meta::CPAN


	SMFIS_CONTINUE;
}

sub header_callback {
	shift; # $this
	my $ctx = shift;
	my $hname = lc(shift);
	my $priv = $ctx->getpriv();

	if ($hname eq 'content-type' || $hname eq 'mime-version') {
		$priv->{$hname} = 1;
	}

	SMFIS_CONTINUE;
}

sub eoh_callback {
	shift; # $this
	my $ctx = shift;
	my $priv = $ctx->getpriv();

	if (defined($priv->{'content-type'}) xor defined($priv->{'mime-version'})) {
		$ctx->setreply("554", "5.6.0", "Message is corrupt -- RFC2047: MIME-Version and Content-Type must be used together, or not at all");
		return SMFIS_REJECT;
	}

	SMFIS_ACCEPT;
}

1;
__END__



( run in 2.483 seconds using v1.01-cache-2.11-cpan-524268b4103 )