Documentation
¶
Index ¶
- Constants
- type CloudflareService
- type CreateMailboxRequest
- type DNSRecord
- type DomainService
- type EmailAttachmentRepository
- type EmailEventRepository
- type EmailLogRepository
- type EmailProcessor
- type EmailRepository
- type EmailService
- type EmailThreadRepository
- type FolderStats
- type GoogleService
- type IMAPService
- type MailEvent
- type MailboxDetails
- type MailboxRepository
- type MailboxService
- type MailboxServiceOld
- type MailboxStatus
- type MailboxSyncRepository
- type NamecheapDomainInfo
- type NamecheapService
- type OauthMailboxRequest
- type OpenSrsService
- type OrphanEmailRepository
- type SenderRepository
- type StorageService
Constants ¶
View Source
const ( HEADER_TENANT = "X-Tenant" HEADER_USERID = "X-UserId" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudflareService ¶ added in v0.0.3
type CloudflareService interface { SetupDomainForMailStack(ctx context.Context, tenant, domain, destinationUrl string) ([]string, error) AddDNSRecord(ctx context.Context, zoneID, recordType, name, content string, ttl int, proxied bool, priority *int) error GetDNSRecords(ctx context.Context, domain string) (*[]DNSRecord, error) DeleteDNSRecord(ctx context.Context, zoneID string, recordID string) error CheckDomainExists(ctx context.Context, domain string) (bool, string, error) }
type CreateMailboxRequest ¶ added in v0.0.3
type DomainService ¶ added in v0.0.3
type DomainService interface { ConfigureDomain(ctx context.Context, domain, redirectWebsite string) error GetDomain(ctx context.Context, domain string) (*models.MailStackDomain, error) CheckMailstackDomainReputations(ctx context.Context) error GetTenantForMailstackDomain(ctx context.Context, domain string) (string, error) }
type EmailAttachmentRepository ¶
type EmailAttachmentRepository interface { GetByID(ctx context.Context, id string) (*models.EmailAttachment, error) ListByEmail(ctx context.Context, emailID string) ([]*models.EmailAttachment, error) ListByThread(ctx context.Context, threadID string) ([]*models.EmailAttachment, error) Store(ctx context.Context, attachment *models.EmailAttachment, emailID, mailboxID string, data []byte) (string, error) DownloadAttachment(ctx context.Context, id string) ([]byte, error) Delete(ctx context.Context, id string) error }
type EmailEventRepository ¶ added in v0.2.5
type EmailEventRepository interface {
Create(ctx context.Context, emailEvent *models.EmailEvent) error
}
type EmailLogRepository ¶ added in v0.2.5
type EmailProcessor ¶ added in v0.1.12
type EmailRepository ¶
type EmailRepository interface { Create(ctx context.Context, email *models.Email) (string, error) GetByID(ctx context.Context, id string) (*models.Email, error) GetByUID(ctx context.Context, mailboxID, folder string, uid uint32) (*models.Email, error) GetByMessageID(ctx context.Context, messageID string) (*models.Email, error) ListByMailbox(ctx context.Context, mailboxID string, limit, offset int) ([]*models.Email, int64, error) ListByFolder(ctx context.Context, mailboxID, folder string, limit, offset int) ([]*models.Email, int64, error) ListByThread(ctx context.Context, threadID string) ([]*models.Email, error) Search(ctx context.Context, query string, limit, offset int) ([]*models.Email, int64, error) Update(ctx context.Context, email *models.Email) error SetEmailRawData(ctx context.Context, emailID string, headers, envelope, bodyStructure models.JSONMap) error }
type EmailService ¶
type EmailThreadRepository ¶ added in v0.0.3
type EmailThreadRepository interface { Create(ctx context.Context, thread *models.EmailThread) (string, error) GetByID(ctx context.Context, id string) (*models.EmailThread, error) GetByMailboxIDs(ctx context.Context, mailboxIDs []string, limit int, offset int) ([]*models.EmailThread, error) CountByMailboxIDs(ctx context.Context, mailboxIDs []string) (int64, error) Update(ctx context.Context, thread *models.EmailThread) error GetParticipantsForThread(ctx context.Context, threadID string) ([]string, error) FindBySubjectAndMailbox(ctx context.Context, subject string, mailboxID string) ([]*models.EmailThread, error) MarkThreadAsViewed(ctx context.Context, threadID string) error MarkThreadAsDone(ctx context.Context, threadID string, isDone bool) error }
type FolderStats ¶
type GoogleService ¶ added in v0.2.16
type GoogleService interface { // RefreshTokenIfNeeded checks if the token needs refresh and refreshes it if necessary RefreshTokenIfNeeded(ctx context.Context, mailbox *models.Mailbox) error // RefreshToken refreshes the OAuth2 token for the given mailbox RefreshToken(ctx context.Context, mailbox *models.Mailbox) error // GetDecryptedAccessToken returns the decrypted access token for the mailbox GetDecryptedAccessToken(ctx context.Context, mailbox *models.Mailbox) (string, error) }
GoogleService handles Google-specific operations like OAuth2 token management
type IMAPService ¶
type IMAPService interface { Start(ctx context.Context) error Stop() error GetMessageByUID(ctx context.Context, mailboxID, folderName string, uid uint32) (*imap.Message, error) Status() map[string]MailboxStatus AcceptMailboxForSync(ctx context.Context, mailbox *models.Mailbox) bool ListFolders(ctx context.Context, mailboxID string) ([]string, error) }
type MailboxDetails ¶ added in v0.0.3
type MailboxRepository ¶
type MailboxRepository interface { GetMailboxes(ctx context.Context) ([]*models.Mailbox, error) GetMailboxesByUserID(ctx context.Context, userID string) ([]*models.Mailbox, error) GetMailbox(ctx context.Context, id string) (*models.Mailbox, error) GetMailboxByEmailAddress(ctx context.Context, emailAddress string) (*models.Mailbox, error) GetMailboxByEmailAddressCrossTenant(ctx context.Context, emailAddress string) (*models.Mailbox, error) GetForConfiguration(ctx context.Context, limit int) ([]*models.Mailbox, error) GetAllWithFilters(ctx context.Context, provider enum.EmailProvider, domain, userId string) ([]*models.Mailbox, error) SaveMailbox(ctx context.Context, mailbox models.Mailbox) (string, error) DeleteMailbox(ctx context.Context, id string) error UpdateConnectionStatus(ctx context.Context, mailboxID string, status enum.ConnectionStatus, errorMessage string) error UpdateProvisionStatus(ctx context.Context, id string, status models.MailboxProvisionStatus) error ConfigureAttempt(ctx context.Context, id string) error GetForRampUp(ctx context.Context) ([]*models.Mailbox, error) UpdateRampUpFields(ctx context.Context, mailbox *models.Mailbox) error UpdateOauthToken(ctx context.Context, mailboxID, accessToken, refreshToken string, tokenExpiry *time.Time) error MarkForManualRefresh(ctx context.Context, mailboxID string, needsManualRefresh bool) error // Methods for distributed processing GetMailboxesForSync(ctx context.Context, staleTimeout time.Duration) ([]*models.Mailbox, error) AcquireMailboxLock(ctx context.Context, mailboxID, podID string, staleTimeout time.Duration) (bool, error) UpdateMailboxHeartbeat(ctx context.Context, mailboxID, podID string) error ReleaseMailboxLock(ctx context.Context, mailboxID, podID string) error }
type MailboxService ¶ added in v0.0.3
type MailboxService interface { EnrollMailbox(ctx context.Context, mailbox *models.Mailbox) (*models.Mailbox, error) CreateMailbox(ctx context.Context, request CreateMailboxRequest) error ConfigureMailbox(ctx context.Context, mailboxId string) error RampUpMailboxes(ctx context.Context) error GetMailboxes(ctx context.Context, provider enum.EmailProvider, domain, userId string) ([]*models.Mailbox, error) GetMailboxByEmailAddress(ctx context.Context, emailAddress string) (*models.Mailbox, error) }
type MailboxServiceOld ¶ added in v0.1.3
type MailboxStatus ¶
type MailboxSyncRepository ¶
type MailboxSyncRepository interface { GetSyncState(ctx context.Context, mailboxID, folderName string) (*models.MailboxSyncState, error) SaveSyncState(ctx context.Context, state *models.MailboxSyncState) error DeleteSyncState(ctx context.Context, mailboxID, folderName string) error DeleteMailboxSyncStates(ctx context.Context, mailboxID string) error GetAllSyncStates(ctx context.Context) (map[string]map[string]uint32, error) GetMailboxSyncStates(ctx context.Context, mailboxID string) (map[string]uint32, error) }
type NamecheapDomainInfo ¶ added in v0.0.3
type NamecheapService ¶ added in v0.0.3
type NamecheapService interface { CheckDomainAvailability(ctx context.Context, domain string) (bool, bool, error) PurchaseDomain(ctx context.Context, tenant, domain string) error GetDomainPrice(ctx context.Context, domain string) (float64, error) GetDomainInfo(ctx context.Context, tenant, domain string) (NamecheapDomainInfo, error) UpdateNameservers(ctx context.Context, tenant, domain string, nameservers []string) error }
type OauthMailboxRequest ¶ added in v0.2.16
type OpenSrsService ¶ added in v0.0.3
type OpenSrsService interface { SendEmail(ctx context.Context, request *models.EmailMessage) error SetupDomain(ctx context.Context, tenant, domain string) error SetupMailbox(ctx context.Context, tenant, username, password string, forwardingTo []string, webmailEnabled bool) error GetMailboxDetails(ctx context.Context, email string) (MailboxDetails, error) }
type OrphanEmailRepository ¶ added in v0.0.3
type OrphanEmailRepository interface { Create(ctx context.Context, orphan *models.OrphanEmail) (string, error) GetByID(ctx context.Context, id string) (*models.OrphanEmail, error) GetByMessageID(ctx context.Context, messageID string) (*models.OrphanEmail, error) Delete(ctx context.Context, id string) error DeleteByThreadID(ctx context.Context, threadID string) error ListByThreadID(ctx context.Context, threadID string) ([]*models.OrphanEmail, error) ListByMailboxID(ctx context.Context, mailboxID string, limit, offset int) ([]*models.OrphanEmail, error) DeleteOlderThan(ctx context.Context, cutoffDate time.Time) error }
type SenderRepository ¶ added in v0.0.22
type SenderRepository interface { Create(ctx context.Context, sender *models.Sender) error GetByID(ctx context.Context, id string) (*models.Sender, error) GetByUserID(ctx context.Context, userID string) ([]models.Sender, error) GetDefaultForUser(ctx context.Context, userID string) (*models.Sender, error) Update(ctx context.Context, sender *models.Sender) error SetDefault(ctx context.Context, id string, userID string) error SetActive(ctx context.Context, id string, isActive bool) error Delete(ctx context.Context, id string) error ListByTenant(ctx context.Context, tenant string, limit, offset int) ([]models.Sender, int64, error) }
Source Files
¶
- cloudflare.go
- domain.go
- email.go
- email_attachment_repository.go
- email_event_repository.go
- email_log_repository.go
- email_prosessor.go
- email_repository.go
- email_thread_repository.go
- google.go
- imap.go
- mailbox.go
- mailbox_old.go
- mailbox_repository.go
- mailbox_sync_repository.go
- namecheap.go
- opensrs.go
- orphan_email_repository.go
- senders_repository.go
- storage.go
Click to show internal directories.
Click to hide internal directories.