[MailScanner] Removing the ALT attribute for Web Bug images


Well-Known Member
Jan 17, 2004
With MailScanner, "Web bug from" warnings appear when a Web bug, i.e. a tiny 1x1 image is inserted in an HTML message, by which the sender attempts to know whether the recipient has read the email.

Now, having a string of characters replace a 1x1 picture in a mail client which does not load the pictures (for example, Thunderbird), means the page formatting is broken. On the eBay message I just received, the Web bug warnings make the page unreadable. I could show the images (it's only a button click away...), but I thought it would make more sense to remove the ALT attribute from the IMG tag entirely.

I've commented out a line in /usr/mailscanner/lib/MailScanner/Message.pm:

        # It's not in the whitelist, so zap it with insecticide!
        $output .= '<img src="' . $WebBugReplacement . '" width="' .
                   $attr->{'width'} .  '" height="' . $attr->{'height'} .
                   '" alt="';
[COLOR="Red"]#        $output .= 'Web Bug from ' . $attr->{'src'} if $attr->{'src'};[/COLOR]
        $output .= '" />';
        $DisarmWebBugFound = 1;
        $DisarmDoneSomething{'web bug'} = 1;
Is there anything wrong in doing this? Specifically, would a remote server deem an incoming message from my server more likely flaggable as spam if the ALT attributes are set to the empty string?