HomePhabricator

Drop empty inbound mail at the beginning of the receive workflow, not inside…

Description

Drop empty inbound mail at the beginning of the receive workflow, not inside object handlers

Summary:
Ref T920. Ref T7477. We currently drop empty mail only once it reaches the ReplyHandler layer.

I think no plausible receiver can ever do anything useful with this kind of mail, so we can safely drop it earlier and simplify some of the logic. After T7477, we'd end up throwing multiple exceptions if you sent empty mail to several valid receivers.

(I also want to move away from APIs oriented around raw addresses in more specialized layers, and this is one of the few callsites for raw mail address information.)

This requires updating some unit tests to actually have message bodies, since they failed with this error before hitting the other errors otherwise.

Test Plan: Used bin/mail receive-test to send empty mail, got appropriate "err:empty" out of it.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T7477, T920

Differential Revision: https://secure.phabricator.com/D19947