sbidy / MacroMilter

This python based milter (mail-filter) checks an incoming mail for suspicious VBA macro code in MS 20xx Office attachments (doc, xls, ppt ...).
MIT License
37 stars 14 forks source link

Option 'REJECT_MESSAGE = no' duplicates e-mail content #38

Closed robert-scheck closed 5 years ago

robert-scheck commented 6 years ago

Option REJECT_MESSAGE = no duplicates the e-mail content if the e-mail has no attachments (just text/plain), this is caused by this code:

                if REJECT_MESSAGE is False:
                        body = str(msg)
                        self.message = io.BytesIO(body)
                        self.replacebody(body)
                        log.info('[%d] Message relayed' % self.id)

Simply dropping this code however breaks functionality of REJECT_MESSAGE = no.