From af0b88049e0c77cb90ef1aca608accc32a2e2828 Mon Sep 17 00:00:00 2001 From: alwin Date: Sun, 21 Dec 2003 10:36:22 +0000 Subject: - MailWrapper -> SMTPwrapper - made dependies from libetpan includes somewhat cleaner - removed standalone static funs and moved to class based static methods - arguements in SMTPwrapper now always const references and not deep copies TODO: clean up GOTO statements, change QList to QValueList for a better handling of "const" arguments, store mails in queue and/or a local "Sent" folder. --- (limited to 'noncore/net/mail/libmailwrapper/smtpwrapper.h') diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h new file mode 100644 index 0000000..8fdb07d --- a/dev/null +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h @@ -0,0 +1,53 @@ +#ifndef SMTPwrapper_H +#define SMTPwrapper_H + +#include + +#include +#include +#include + +#include "settings.h" + +class Mail; +class Attachment; +struct mailimf_fields; +struct mailimf_field; +struct mailimf_mailbox; +struct mailmime; +struct mailimf_address_list; + +class SMTPwrapper : public QObject +{ + Q_OBJECT + +public: + SMTPwrapper( Settings *s ); + virtual ~SMTPwrapper(){} + void sendMail(const Mail& mail ); + +protected: + mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); + mailimf_fields *createImfFields(const Mail &mail ); + mailmime *createMimeMail(const Mail&mail ); + + mailimf_address_list *parseAddresses(const QString&addr ); + void addFileParts( mailmime *message,const QList&files ); + mailmime *buildTxtPart(const QString&str ); + mailmime *buildFilePart(const QString&filename,const QString&mimetype ); + void smtpSend( mailmime *mail ); + mailimf_field *getField( mailimf_fields *fields, int type ); + clist *createRcptList( mailimf_fields *fields ); + char *getFrom( mailmime *mail ); + SMTPaccount *getAccount(const QString&from ); + void writeToFile(const QString&file, mailmime *mail ); + void readFromFile(const QString&file, char **data, size_t *size ); + + static QString mailsmtpError( int err ); + static QString getTmpFile(); + static void progress( size_t current, size_t maximum ); + static void addRcpts( clist *list, mailimf_address_list *addr_list ); + Settings *settings; +}; + +#endif -- cgit v0.9.0.2