aboutsummaryrefslogtreecommitdiff
path: root/models/mail/email.go
blob: b0cc27e3f6425a06b6e56ccc9176fb084d74ecc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package mail

import "gorm.io/gorm"

type Email struct {
	gorm.Model
	MailboxID       uint    `gorm:"not null;index" json:"mailbox_id"`
	Mailbox         Mailbox `gorm:"foreignKey:MailboxID" json:"mailbox"`
	FolderID        uint    `gorm:"not null;index" json:"folder_id"`
	Folder          Folder  `gorm:"foreignKey:FolderID" json:"folder"`
	IsStarred       bool    `gorm:"default:false;index" json:"is_starred"`
	MessageID       string  `gorm:"index" json:"message_id"`
	Filename        string  `gorm:"uniqueIndex;not null" json:"filename"`
	FromAddress     string  `gorm:"not null" json:"from_address"`
	FromName        string  `json:"from_name"`
	ToAddresses     string  `gorm:"not null" json:"to_addresses"`
	CcAddresses     string  `json:"cc_addresses"`
	BccAddresses    string  `json:"bcc_addresses"`
	ReplyToAddress  string  `json:"reply_to_address"`
	ReturnPath      string  `json:"return_path"`
	Subject         string  `json:"subject"`
	Snippet         string  `json:"snippet"`
	Size            int64   `json:"size"`
	IsRead          bool    `gorm:"default:false;index" json:"is_read"`
	AttachmentCount int     `gorm:"default:0" json:"attachment_count"`
	InlineCount     int     `gorm:"default:0" json:"inline_count"`
	Tags            []Tag   `gorm:"many2many:email_tags" json:"tags"`
}