author | alwin <alwin> | 2003-12-28 17:32:43 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-28 17:32:43 (UTC) |
commit | 696a2dcfcb65fbb24b709bbae0a18a7854e2d72c (patch) (side-by-side diff) | |
tree | e813c9508881796cf999e9c25c05e4482c6fd9e8 /noncore/net/mail/libmailwrapper | |
parent | b900cad9c050c2d5963228a2191e13053457ef1d (diff) | |
download | opie-696a2dcfcb65fbb24b709bbae0a18a7854e2d72c.zip opie-696a2dcfcb65fbb24b709bbae0a18a7854e2d72c.tar.gz opie-696a2dcfcb65fbb24b709bbae0a18a7854e2d72c.tar.bz2 |
reduced to the max...
- from address isn't setup any longer within the smtp account (it makes realy no
sense, a smtp account describes the connection to a smtp server, not the
identity of the sender)
- from address is taken from the personal info of the addressbook (thats why this
info exists). Of course the user can change it when sending an email.
- user can select a from with a selection of the mails given in their personal
infos.
- in addresspicker: use "<Firstname> <Lastname>" instead of "Filename"
- settings ui: switched of the part within the smtp accounts describing the
identitiy of user
ToDo: a dialog setting up a default signature
Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 25 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.h | 20 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.cpp | 54 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.h | 3 |
4 files changed, 20 insertions, 82 deletions
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index b580954..17aa1b0 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp @@ -275,5 +275,2 @@ SMTPaccount::SMTPaccount( QString filename ) login = false; - useCC = false; - useBCC = false; - useReply = false; type = "SMTP"; @@ -308,13 +305,2 @@ void SMTPaccount::read() password = conf->readEntryCrypt( "Password" ); - useCC = conf->readBoolEntry( "useCC" ); - useBCC = conf->readBoolEntry( "useBCC" ); - useReply = conf->readBoolEntry( "useReply" ); - name = conf->readEntry( "Name" ); - mail = conf->readEntry( "Mail" ); - org = conf->readEntry( "Org" ); - cc = conf->readEntry( "CC" ); - bcc = conf->readEntry( "BCC" ); - reply = conf->readEntry( "Reply" ); - signature = conf->readEntry( "Signature" ); - signature = signature.replace( QRegExp( "<br>" ), "\n" ); } @@ -335,13 +321,2 @@ void SMTPaccount::save() conf->writeEntryCrypt( "Password", password ); - conf->writeEntry( "useCC", useCC ); - conf->writeEntry( "useBCC", useBCC ); - conf->writeEntry( "useReply", useReply ); - conf->writeEntry( "Name", name ); - conf->writeEntry( "Mail", mail ); - conf->writeEntry( "Org", org ); - conf->writeEntry( "CC", cc ); - conf->writeEntry( "BCC", bcc ); - conf->writeEntry( "Reply", reply ); - conf->writeEntry( "Signature", - signature.replace( QRegExp( "\\n" ), "<br>" ) ); conf->write(); diff --git a/noncore/net/mail/libmailwrapper/settings.h b/noncore/net/mail/libmailwrapper/settings.h index 22184a5..caa5dfc 100644 --- a/noncore/net/mail/libmailwrapper/settings.h +++ b/noncore/net/mail/libmailwrapper/settings.h @@ -95,22 +95,2 @@ public: - void setName( QString str ) { name = str; } - QString getName() { return name; } - void setMail( QString str ) { mail = str; } - QString getMail() { return mail; } - void setOrg( QString str ) { org = str; } - QString getOrg() { return org; } - void setUseCC( bool b ) { useCC = b; } - bool getUseCC() { return useCC; } - void setCC( QString str ) { cc = str; } - QString getCC() { return cc; } - void setUseBCC( bool b ) { useBCC = b; } - bool getUseBCC() { return useBCC; } - void setBCC( QString str ) { bcc = str; } - QString getBCC() { return bcc; } - void setUseReply( bool b ) { useReply = b; } - bool getUseReply() { return useReply; } - void setReply( QString str ) { reply = str; } - QString getReply() { return reply; } - void setSignature( QString str ) { signature = str; } - QString getSignature() { return signature; } void setLogin( bool b ) { login = b; } diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index 521cd0a..30c0707 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp @@ -130,5 +130,5 @@ mailimf_fields *SMTPwrapper::createImfFields(const Mail&mail ) mailimf_field *xmailer; - mailimf_mailbox *sender, *fromBox; - mailimf_mailbox_list *from; - mailimf_address_list *to, *cc, *bcc, *reply; + mailimf_mailbox *sender=0,*fromBox=0; + mailimf_mailbox_list *from=0; + mailimf_address_list *to=0, *cc=0, *bcc=0, *reply=0; char *subject = strdup( mail.getSubject().latin1() ); @@ -169,12 +169,12 @@ mailimf_fields *SMTPwrapper::createImfFields(const Mail&mail ) err_free_xmailer: - mailimf_field_free( xmailer ); + if (xmailer) mailimf_field_free( xmailer ); err_free_fields: - mailimf_fields_free( fields ); + if (fields) mailimf_fields_free( fields ); err_free_reply: - mailimf_address_list_free( reply ); - mailimf_address_list_free( bcc ); - mailimf_address_list_free( cc ); - mailimf_address_list_free( to ); + if (reply) mailimf_address_list_free( reply ); + if (bcc) mailimf_address_list_free( bcc ); + if (cc) mailimf_address_list_free( cc ); + if (to) mailimf_address_list_free( to ); err_free_from: - mailimf_mailbox_list_free( from ); + if (from) mailimf_mailbox_list_free( from ); err_free_fromBox: @@ -182,5 +182,5 @@ err_free_fromBox: err_free_sender: - mailimf_mailbox_free( sender ); + if (sender) mailimf_mailbox_free( sender ); err_free: - free( subject ); + if (subject) free( subject ); qDebug( "createImfFields - error" ); @@ -208,3 +208,3 @@ mailmime *SMTPwrapper::buildTxtPart(const QString&str ) - fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_QUOTED_PRINTABLE); + fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT); if ( fields == NULL ) goto err_free_content; @@ -464,22 +464,2 @@ char *SMTPwrapper::getFrom( mailmime *mail ) -SMTPaccount *SMTPwrapper::getAccount(const QString&name ) -{ - SMTPaccount *smtp; - - QList<Account> list = settings->getAccounts(); - Account *it; - for ( it = list.first(); it; it = list.next() ) { - if ( it->getType().compare( "SMTP" ) == 0 ) { - smtp = static_cast<SMTPaccount *>(it); - if ( smtp->getName()== name ) { - qDebug( "SMTPaccount found for" ); - qDebug( name ); - return smtp; - } - } - } - - return NULL; -} - void SMTPwrapper::progress( size_t current, size_t maximum ) @@ -615,3 +595,3 @@ free_mem: -void SMTPwrapper::sendMail(const Mail&mail,bool later ) +void SMTPwrapper::sendMail(const Mail&mail,SMTPaccount*aSmtp,bool later ) { @@ -619,4 +599,8 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) - SMTPaccount *smtp = getAccount(mail.getName()); + SMTPaccount *smtp = aSmtp; + if (!later && !smtp) { + qDebug("Didn't get any send method - giving up"); + return; + } mimeMail = createMimeMail(mail ); diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h index f734fa4..0535983 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.h +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h @@ -29,3 +29,3 @@ public: virtual ~SMTPwrapper(){} - void sendMail(const Mail& mail,bool later=false ); + void sendMail(const Mail& mail,SMTPaccount*smtp,bool later=false ); bool flushOutbox(SMTPaccount*smtp); @@ -44,3 +44,2 @@ protected: clist *createRcptList( mailimf_fields *fields ); - SMTPaccount *getAccount(const QString&from ); |