mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add created_via column to IncomingEmail (#11751)
This should make it easier to track down how the incoming email was created, which is one of four locations: The POP3 poller (which picks up reply via email replies) The admin email controller #handle_mail (which is where hosted mail is sent) The IMAP sync tool The group SMTP mailer, which sends emails when replying to IMAP topics, pre-emptively creating IncomingEmail records to avoid double syncing
This commit is contained in:
@@ -29,6 +29,15 @@ class IncomingEmail < ActiveRecord::Base
|
||||
SQL
|
||||
end
|
||||
|
||||
def self.created_via_types
|
||||
@types ||= Enum.new(
|
||||
handle_mail: 1,
|
||||
pop3_poll: 2,
|
||||
imap: 3,
|
||||
group_smtp: 4
|
||||
)
|
||||
end
|
||||
|
||||
def to_addresses_split
|
||||
self.to_addresses&.split(";") || []
|
||||
end
|
||||
@@ -83,6 +92,7 @@ end
|
||||
# imap_uid :integer
|
||||
# imap_sync :boolean
|
||||
# imap_group_id :bigint
|
||||
# created_via :integer
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user