summaryrefslogtreecommitdiff
path: root/noncore/net/mail/smtpwrapper.cpp
authoralwin <alwin>2003-12-28 17:32:43 (UTC)
committer alwin <alwin>2003-12-28 17:32:43 (UTC)
commit696a2dcfcb65fbb24b709bbae0a18a7854e2d72c (patch) (unidiff)
treee813c9508881796cf999e9c25c05e4482c6fd9e8 /noncore/net/mail/smtpwrapper.cpp
parentb900cad9c050c2d5963228a2191e13053457ef1d (diff)
downloadopie-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/smtpwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/smtpwrapper.cpp54
1 files changed, 19 insertions, 35 deletions
diff --git a/noncore/net/mail/smtpwrapper.cpp b/noncore/net/mail/smtpwrapper.cpp
index 521cd0a..30c0707 100644
--- a/noncore/net/mail/smtpwrapper.cpp
+++ b/noncore/net/mail/smtpwrapper.cpp
@@ -130,5 +130,5 @@ mailimf_fields *SMTPwrapper::createImfFields(const Mail&mail )
130 mailimf_field *xmailer; 130 mailimf_field *xmailer;
131 mailimf_mailbox *sender, *fromBox; 131 mailimf_mailbox *sender=0,*fromBox=0;
132 mailimf_mailbox_list *from; 132 mailimf_mailbox_list *from=0;
133 mailimf_address_list *to, *cc, *bcc, *reply; 133 mailimf_address_list *to=0, *cc=0, *bcc=0, *reply=0;
134 char *subject = strdup( mail.getSubject().latin1() ); 134 char *subject = strdup( mail.getSubject().latin1() );
@@ -169,12 +169,12 @@ mailimf_fields *SMTPwrapper::createImfFields(const Mail&mail )
169err_free_xmailer: 169err_free_xmailer:
170 mailimf_field_free( xmailer ); 170 if (xmailer) mailimf_field_free( xmailer );
171err_free_fields: 171err_free_fields:
172 mailimf_fields_free( fields ); 172 if (fields) mailimf_fields_free( fields );
173err_free_reply: 173err_free_reply:
174 mailimf_address_list_free( reply ); 174 if (reply) mailimf_address_list_free( reply );
175 mailimf_address_list_free( bcc ); 175 if (bcc) mailimf_address_list_free( bcc );
176 mailimf_address_list_free( cc ); 176 if (cc) mailimf_address_list_free( cc );
177 mailimf_address_list_free( to ); 177 if (to) mailimf_address_list_free( to );
178err_free_from: 178err_free_from:
179 mailimf_mailbox_list_free( from ); 179 if (from) mailimf_mailbox_list_free( from );
180err_free_fromBox: 180err_free_fromBox:
@@ -182,5 +182,5 @@ err_free_fromBox:
182err_free_sender: 182err_free_sender:
183 mailimf_mailbox_free( sender ); 183 if (sender) mailimf_mailbox_free( sender );
184err_free: 184err_free:
185 free( subject ); 185 if (subject) free( subject );
186 qDebug( "createImfFields - error" ); 186 qDebug( "createImfFields - error" );
@@ -208,3 +208,3 @@ mailmime *SMTPwrapper::buildTxtPart(const QString&str )
208 208
209 fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_QUOTED_PRINTABLE); 209 fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT);
210 if ( fields == NULL ) goto err_free_content; 210 if ( fields == NULL ) goto err_free_content;
@@ -464,22 +464,2 @@ char *SMTPwrapper::getFrom( mailmime *mail )
464 464
465SMTPaccount *SMTPwrapper::getAccount(const QString&name )
466{
467 SMTPaccount *smtp;
468
469 QList<Account> list = settings->getAccounts();
470 Account *it;
471 for ( it = list.first(); it; it = list.next() ) {
472 if ( it->getType().compare( "SMTP" ) == 0 ) {
473 smtp = static_cast<SMTPaccount *>(it);
474 if ( smtp->getName()== name ) {
475 qDebug( "SMTPaccount found for" );
476 qDebug( name );
477 return smtp;
478 }
479 }
480 }
481
482 return NULL;
483}
484
485void SMTPwrapper::progress( size_t current, size_t maximum ) 465void SMTPwrapper::progress( size_t current, size_t maximum )
@@ -615,3 +595,3 @@ free_mem:
615 595
616void SMTPwrapper::sendMail(const Mail&mail,bool later ) 596void SMTPwrapper::sendMail(const Mail&mail,SMTPaccount*aSmtp,bool later )
617{ 597{
@@ -619,4 +599,8 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later )
619 599
620 SMTPaccount *smtp = getAccount(mail.getName()); 600 SMTPaccount *smtp = aSmtp;
621 601
602 if (!later && !smtp) {
603 qDebug("Didn't get any send method - giving up");
604 return;
605 }
622 mimeMail = createMimeMail(mail ); 606 mimeMail = createMimeMail(mail );