Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
SmtpClient Class Reference

#include <smtpclient.h>

Inheritance diagram for SmtpClient:
[legend]
Collaboration diagram for SmtpClient:
[legend]

Classes

struct  PendingEmail

Public Slots

bool enqueueActivationTokenMail (const QString &nickname, const QString &recipient, const QString &token)
bool enqueueForgotPasswordTokenMail (const QString &nickname, const QString &recipient, const QString &token, qint64 rowId=-1)
void sendAllEmails ()

Signals

void mailDelivered (const QString &userName, EmailType type, const QString &token, qint64 rowId)
void mailPermanentlyFailed (const QString &userName, EmailType type, FailureReason reason, const QString &token, qint64 rowId)

Public Member Functions

 SmtpClient (QObject *parent=nullptr)
 ~SmtpClient () override

Protected Slots

void authenticated ()
void authenticationFailed (const QByteArray &msg)
void connected ()
void connectionFailed (const QByteArray &msg)
void disconnected ()
void encrypted ()
void encryptionFailed (const QByteArray &msg)
void finished ()
void idleTimeout ()
void mailFailed (int mailID, int errorCode, const QByteArray &msg)
void mailSent (int mailID)
void recipientRejected (int mailID, const QString &address, const QByteArray &msg)
void senderRejected (int mailID, const QString &address, const QByteArray &msg)

Protected Attributes

QxtSmtp * smtp

Private Member Functions

PendingEmail buildEmail (const QString &nickname, EmailType type, const QString &subject, const QString &body, const QString &recipient, const QString &token, const QString &email, qint64 rowId=-1)
bool enqueue (const PendingEmail &email)
void relayoutForSending ()
QDateTime nextRetryTime (int attempts, int retryDelay) const
void recordFailed (int mailID)
void recordConnectionFailure ()
bool validateEmailFields (const QString &email, const QString &subject, const QString &body, const QString &recipient, const QString &token, const QString &nickname)
int maxRetries () const
int retryDelaySeconds () const

Private Attributes

QHash< QString, PendingEmail > pendingEmails
QHash< int, QString > mailIdToUser
QTimer * idleTimer
int connectionAttempts = 0
QDateTime connectionBackoffUntil

Constructor & Destructor Documentation

◆ SmtpClient()

SmtpClient::SmtpClient ( QObject * parent = nullptr)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~SmtpClient()

SmtpClient::~SmtpClient ( )
override

Member Function Documentation

◆ authenticated

void SmtpClient::authenticated ( )
protectedslot
Here is the caller graph for this function:

◆ authenticationFailed

void SmtpClient::authenticationFailed ( const QByteArray & msg)
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildEmail()

SmtpClient::PendingEmail SmtpClient::buildEmail ( const QString & nickname,
EmailType type,
const QString & subject,
const QString & body,
const QString & recipient,
const QString & token,
const QString & email,
qint64 rowId = -1 )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ connected

void SmtpClient::connected ( )
protectedslot
Here is the caller graph for this function:

◆ connectionFailed

void SmtpClient::connectionFailed ( const QByteArray & msg)
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ disconnected

void SmtpClient::disconnected ( )
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ encrypted

void SmtpClient::encrypted ( )
protectedslot
Here is the caller graph for this function:

◆ encryptionFailed

void SmtpClient::encryptionFailed ( const QByteArray & msg)
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enqueue()

bool SmtpClient::enqueue ( const PendingEmail & email)
private
Here is the caller graph for this function:

◆ enqueueActivationTokenMail

bool SmtpClient::enqueueActivationTokenMail ( const QString & nickname,
const QString & recipient,
const QString & token )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enqueueForgotPasswordTokenMail

bool SmtpClient::enqueueForgotPasswordTokenMail ( const QString & nickname,
const QString & recipient,
const QString & token,
qint64 rowId = -1 )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ finished

void SmtpClient::finished ( )
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ idleTimeout

void SmtpClient::idleTimeout ( )
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mailDelivered

void SmtpClient::mailDelivered ( const QString & userName,
EmailType type,
const QString & token,
qint64 rowId )
signal
Here is the caller graph for this function:

◆ mailFailed

void SmtpClient::mailFailed ( int mailID,
int errorCode,
const QByteArray & msg )
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mailPermanentlyFailed

void SmtpClient::mailPermanentlyFailed ( const QString & userName,
EmailType type,
FailureReason reason,
const QString & token,
qint64 rowId )
signal
Here is the caller graph for this function:

◆ mailSent

void SmtpClient::mailSent ( int mailID)
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ maxRetries()

int SmtpClient::maxRetries ( ) const
private
Here is the caller graph for this function:

◆ nextRetryTime()

QDateTime SmtpClient::nextRetryTime ( int attempts,
int retryDelay ) const
private
Here is the caller graph for this function:

◆ recipientRejected

void SmtpClient::recipientRejected ( int mailID,
const QString & address,
const QByteArray & msg )
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ recordConnectionFailure()

void SmtpClient::recordConnectionFailure ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ recordFailed()

void SmtpClient::recordFailed ( int mailID)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ relayoutForSending()

void SmtpClient::relayoutForSending ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ retryDelaySeconds()

int SmtpClient::retryDelaySeconds ( ) const
private
Here is the caller graph for this function:

◆ sendAllEmails

void SmtpClient::sendAllEmails ( )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ senderRejected

void SmtpClient::senderRejected ( int mailID,
const QString & address,
const QByteArray & msg )
protectedslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateEmailFields()

bool SmtpClient::validateEmailFields ( const QString & email,
const QString & subject,
const QString & body,
const QString & recipient,
const QString & token,
const QString & nickname )
private
Here is the caller graph for this function:

Member Data Documentation

◆ connectionAttempts

int SmtpClient::connectionAttempts = 0
private

◆ connectionBackoffUntil

QDateTime SmtpClient::connectionBackoffUntil
private

◆ idleTimer

QTimer* SmtpClient::idleTimer
private

◆ mailIdToUser

QHash<int, QString> SmtpClient::mailIdToUser
private

◆ pendingEmails

QHash<QString, PendingEmail> SmtpClient::pendingEmails
private

◆ smtp

QxtSmtp* SmtpClient::smtp
protected

The documentation for this class was generated from the following files: