Unexplained Email::Receiver::InvalidPost errors

We have tests that ensure Discourse can receive mail for read-only categories that mirror a mailing list:

To support that, posts sent to mailing list mirrors bypass some checks:

    def create_post(options = {})
      …
      if sent_to_mailinglist_mirror?
        options[:skip_validations] = true
        options[:skip_guardian] = true
      else
        options[:email_spam] = is_spam?
        options[:first_post_checks] = true if is_spam?
        options[:email_auth_res_action] = auth_res_action
      end
    def sent_to_mailinglist_mirror?
      @sent_to_mailinglist_mirror ||=
        begin
          destinations.each do |destination|
            return true if destination.is_a?(Category) && destination.mailinglist_mirror?
          end

          false
        end
    end

at a guess, something to do with your setup might create condition such that the fact it’s a mailing list mirror isn’t detected? Note that to bypass these checks, the mail has to be sent to the category email address and not the site’s reply_by_email_address.

1 Like