Пример #1
0
def written_store(resource_id: str) -> None:
    action = StoreWrittenClientEmails(
        client_storage=get_client_storage(),
        email_storage=get_email_storage(),
        next_task=send.delay)

    action(resource_id)
Пример #2
0
def written_store(resource_id: str) -> None:
    action = StoreWrittenClientEmails(
        client_storage=get_client_storage(),
        email_storage=get_email_storage(),
        user_storage=get_user_storage(),
        next_task=send_and_index_email,
    )

    action(resource_id)
Пример #3
0
def register_client(domain: str, owner: str) -> None:
    action = RegisterClient(
        auth=get_auth(),
        client_storage=get_client_storage(),
        setup_mailbox=SetupSendgridMailbox(
            key=config.SENDGRID_KEY,
            max_retries=config.SENDGRID_MAX_RETRIES,
            retry_interval_seconds=config.SENDGRID_RETRY_INTERVAL_SECONDS,
        ),
        setup_mx_records=SetupMxRecords(
            account=config.DNS_ACCOUNT,
            secret=config.DNS_SECRET,
            provider=config.DNS_PROVIDER,
        ),
        client_id_source=get_guid_source(),
    )

    action(domain, owner)
Пример #4
0
from opwen_email_server.services.auth import BasicAuth

email_receive = ReceiveInboundEmail(
    auth=get_auth(),
    raw_email_storage=get_raw_email_storage(),
    next_task=inbound_store.delay,
)

client_write = UploadClientEmails(
    auth=get_auth(),
    next_task=written_store.delay,
)

client_read = DownloadClientEmails(
    auth=get_auth(),
    client_storage=get_client_storage(),
    email_storage=get_email_storage(),
    pending_factory=get_pending_storage,
)

client_register = RegisterClient(
    auth=get_auth(),
    client_storage=get_client_storage(),
    setup_mailbox=get_mailbox_setup(),
    setup_mx_records=get_mx_setup(),
)

metrics_pending = CalculatePendingEmailsMetric(
    auth=get_auth(),
    pending_factory=get_pending_storage,
)