author | alwin <alwin> | 2004-02-13 02:52:41 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-13 02:52:41 (UTC) |
commit | aca5ba5ed24b4da61517560ea91f566afd132d28 (patch) (unidiff) | |
tree | 86085c6042e591dc9f211a8716cb63ff30cb5f4e /noncore | |
parent | 2fd9c32e07714b7caf38994c0b0f1da8ffb27aa9 (diff) | |
download | opie-aca5ba5ed24b4da61517560ea91f566afd132d28.zip opie-aca5ba5ed24b4da61517560ea91f566afd132d28.tar.gz opie-aca5ba5ed24b4da61517560ea91f566afd132d28.tar.bz2 |
interface changes
-rw-r--r-- | noncore/net/mail/composemail.cpp | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.cpp | 156 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.h | 27 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 5 |
4 files changed, 107 insertions, 85 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp index 5e823e8..abcc3f6 100644 --- a/noncore/net/mail/composemail.cpp +++ b/noncore/net/mail/composemail.cpp | |||
@@ -221,6 +221,6 @@ void ComposeMail::accept() | |||
221 | } | 221 | } |
222 | 222 | ||
223 | SMTPwrapper wrapper( settings ); | 223 | SMTPwrapper wrapper( smtp ); |
224 | wrapper.sendMail( *mail,smtp,checkBoxLater->isChecked() ); | 224 | wrapper.sendMail( *mail,checkBoxLater->isChecked() ); |
225 | 225 | ||
226 | QDialog::accept(); | 226 | QDialog::accept(); |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index 3ab6b77..a3c68ae 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp | |||
@@ -25,7 +25,8 @@ const char* SMTPwrapper::USER_AGENT="OpieMail v0.4"; | |||
25 | progressMailSend*SMTPwrapper::sendProgress = 0; | 25 | progressMailSend*SMTPwrapper::sendProgress = 0; |
26 | 26 | ||
27 | SMTPwrapper::SMTPwrapper( Settings *s ) | 27 | SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp ) |
28 | : QObject() { | 28 | : QObject() |
29 | settings = s; | 29 | { |
30 | m_SmtpAccount = aSmtp; | ||
30 | Config cfg( "mail" ); | 31 | Config cfg( "mail" ); |
31 | cfg.setGroup( "Status" ); | 32 | cfg.setGroup( "Status" ); |
@@ -33,4 +34,10 @@ SMTPwrapper::SMTPwrapper( Settings *s ) | |||
33 | emit queuedMails( m_queuedMail ); | 34 | emit queuedMails( m_queuedMail ); |
34 | connect( this, SIGNAL( queuedMails( int ) ), this, SLOT( emitQCop( int ) ) ); | 35 | connect( this, SIGNAL( queuedMails( int ) ), this, SLOT( emitQCop( int ) ) ); |
36 | m_smtp = 0; | ||
37 | } | ||
38 | |||
39 | SMTPwrapper::~SMTPwrapper() | ||
40 | { | ||
41 | disc_server(); | ||
35 | } | 42 | } |
36 | 43 | ||
@@ -511,12 +518,9 @@ void SMTPwrapper::storeMail(const char*mail, size_t length, const QString&box) { | |||
511 | } | 518 | } |
512 | 519 | ||
513 | void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ) { | 520 | void SMTPwrapper::smtpSend( mailmime *mail,bool later) { |
514 | clist *rcpts = 0; | 521 | clist *rcpts = 0; |
515 | char *from, *data; | 522 | char *from, *data; |
516 | size_t size; | 523 | size_t size; |
517 | 524 | ||
518 | if ( smtp == NULL ) { | ||
519 | return; | ||
520 | } | ||
521 | from = data = 0; | 525 | from = data = 0; |
522 | 526 | ||
@@ -546,5 +550,5 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ) { | |||
546 | from = getFrom( mail ); | 550 | from = getFrom( mail ); |
547 | rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); | 551 | rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); |
548 | smtpSend(from,rcpts,data,size,smtp); | 552 | smtpSend(from,rcpts,data,size); |
549 | if (data) { | 553 | if (data) { |
550 | free(data); | 554 | free(data); |
@@ -568,14 +572,14 @@ void SMTPwrapper::storeFailedMail(const char*data,unsigned int size, const char* | |||
568 | } | 572 | } |
569 | 573 | ||
570 | int SMTPwrapper::start_smtp_tls(mailsmtp *session) | 574 | int SMTPwrapper::start_smtp_tls() |
571 | { | 575 | { |
572 | if (!session) { | 576 | if (!m_smtp) { |
573 | return MAILSMTP_ERROR_IN_PROCESSING; | 577 | return MAILSMTP_ERROR_IN_PROCESSING; |
574 | } | 578 | } |
575 | int err = mailesmtp_starttls(session); | 579 | int err = mailesmtp_starttls(m_smtp); |
576 | if (err != MAILSMTP_NO_ERROR) return err; | 580 | if (err != MAILSMTP_NO_ERROR) return err; |
577 | mailstream_low * low; | 581 | mailstream_low * low; |
578 | mailstream_low * new_low; | 582 | mailstream_low * new_low; |
579 | low = mailstream_get_low(session->stream); | 583 | low = mailstream_get_low(m_smtp->stream); |
580 | if (!low) { | 584 | if (!low) { |
581 | return MAILSMTP_ERROR_IN_PROCESSING; | 585 | return MAILSMTP_ERROR_IN_PROCESSING; |
@@ -584,5 +588,5 @@ int SMTPwrapper::start_smtp_tls(mailsmtp *session) | |||
584 | if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) { | 588 | if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) { |
585 | mailstream_low_free(low); | 589 | mailstream_low_free(low); |
586 | mailstream_set_low(session->stream, new_low); | 590 | mailstream_set_low(m_smtp->stream, new_low); |
587 | } else { | 591 | } else { |
588 | return MAILSMTP_ERROR_IN_PROCESSING; | 592 | return MAILSMTP_ERROR_IN_PROCESSING; |
@@ -591,45 +595,43 @@ int SMTPwrapper::start_smtp_tls(mailsmtp *session) | |||
591 | } | 595 | } |
592 | 596 | ||
593 | int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMTPaccount *smtp ) { | 597 | void SMTPwrapper::connect_server() |
598 | { | ||
594 | const char *server, *user, *pass; | 599 | const char *server, *user, *pass; |
595 | bool ssl; | 600 | bool ssl; |
596 | uint16_t port; | 601 | uint16_t port; |
597 | mailsmtp *session; | ||
598 | int err,result; | ||
599 | QString failuretext = ""; | ||
600 | |||
601 | result = 1; | ||
602 | server = user = pass = 0; | ||
603 | server = smtp->getServer().latin1(); | ||
604 | |||
605 | // FIXME: currently only TLS and Plain work. | ||
606 | |||
607 | ssl = false; | 602 | ssl = false; |
608 | bool try_tls = true; | 603 | bool try_tls = true; |
609 | bool force_tls=false; | 604 | bool force_tls=false; |
610 | 605 | server = user = pass = 0; | |
611 | if ( smtp->ConnectionType() == 2 ) { | 606 | QString failuretext = ""; |
607 | |||
608 | if (m_smtp || !m_SmtpAccount) { | ||
609 | return; | ||
610 | } | ||
611 | server = m_SmtpAccount->getServer().latin1(); | ||
612 | if ( m_SmtpAccount->ConnectionType() == 2 ) { | ||
612 | ssl = true; | 613 | ssl = true; |
613 | try_tls = false; | 614 | try_tls = false; |
614 | } else if (smtp->ConnectionType() == 1) { | 615 | } else if (m_SmtpAccount->ConnectionType() == 1) { |
615 | force_tls = true; | 616 | force_tls = true; |
616 | } | 617 | } |
618 | int result = 1; | ||
619 | port = m_SmtpAccount->getPort().toUInt(); | ||
617 | 620 | ||
618 | port = smtp->getPort().toUInt(); | 621 | m_smtp = mailsmtp_new( 20, &progress ); |
619 | 622 | if ( m_smtp == NULL ) { | |
620 | session = mailsmtp_new( 20, &progress ); | ||
621 | if ( session == NULL ) { | ||
622 | /* no failure message cause this happens when problems with memory - than we | 623 | /* no failure message cause this happens when problems with memory - than we |
623 | we can not display any messagebox */ | 624 | we can not display any messagebox */ |
624 | return 0; | 625 | return; |
625 | } | 626 | } |
626 | 627 | ||
628 | int err = MAILSMTP_NO_ERROR; | ||
627 | qDebug( "Servername %s at port %i", server, port ); | 629 | qDebug( "Servername %s at port %i", server, port ); |
628 | if ( ssl ) { | 630 | if ( ssl ) { |
629 | qDebug( "SSL session" ); | 631 | qDebug( "SSL session" ); |
630 | err = mailsmtp_ssl_connect( session, server, port ); | 632 | err = mailsmtp_ssl_connect( m_smtp, server, port ); |
631 | } else { | 633 | } else { |
632 | qDebug( "No SSL session" ); | 634 | qDebug( "No SSL session" ); |
633 | err = mailsmtp_socket_connect( session, server, port ); | 635 | err = mailsmtp_socket_connect( m_smtp, server, port ); |
634 | } | 636 | } |
635 | if ( err != MAILSMTP_NO_ERROR ) { | 637 | if ( err != MAILSMTP_NO_ERROR ) { |
@@ -641,5 +643,5 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT | |||
641 | /* switch to tls after init 'cause there it will send the ehlo */ | 643 | /* switch to tls after init 'cause there it will send the ehlo */ |
642 | if (result) { | 644 | if (result) { |
643 | err = mailsmtp_init( session ); | 645 | err = mailsmtp_init( m_smtp ); |
644 | if (err != MAILSMTP_NO_ERROR) { | 646 | if (err != MAILSMTP_NO_ERROR) { |
645 | result = 0; | 647 | result = 0; |
@@ -649,9 +651,9 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT | |||
649 | 651 | ||
650 | if (try_tls) { | 652 | if (try_tls) { |
651 | err = start_smtp_tls(session); | 653 | err = start_smtp_tls(); |
652 | if (err != MAILSMTP_NO_ERROR) { | 654 | if (err != MAILSMTP_NO_ERROR) { |
653 | try_tls = false; | 655 | try_tls = false; |
654 | } else { | 656 | } else { |
655 | err = mailesmtp_ehlo(session); | 657 | err = mailesmtp_ehlo(m_smtp); |
656 | } | 658 | } |
657 | } | 659 | } |
@@ -662,9 +664,10 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT | |||
662 | } | 664 | } |
663 | 665 | ||
664 | if (result==1 && smtp->getLogin() ) { | 666 | if (result==1 && m_SmtpAccount->getLogin() ) { |
665 | qDebug("smtp with auth"); | 667 | qDebug("smtp with auth"); |
666 | if ( smtp->getUser().isEmpty() || smtp->getPassword().isEmpty() ) { | 668 | if ( m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty() ) { |
667 | // get'em | 669 | // get'em |
668 | LoginDialog login( smtp->getUser(), smtp->getPassword(), NULL, 0, true ); | 670 | LoginDialog login( m_SmtpAccount->getUser(), |
671 | m_SmtpAccount->getPassword(), NULL, 0, true ); | ||
669 | login.show(); | 672 | login.show(); |
670 | if ( QDialog::Accepted == login.exec() ) { | 673 | if ( QDialog::Accepted == login.exec() ) { |
@@ -677,10 +680,10 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT | |||
677 | } | 680 | } |
678 | } else { | 681 | } else { |
679 | user = smtp->getUser().latin1(); | 682 | user = m_SmtpAccount->getUser().latin1(); |
680 | pass = smtp->getPassword().latin1(); | 683 | pass = m_SmtpAccount->getPassword().latin1(); |
681 | } | 684 | } |
682 | qDebug( "session->auth: %i", session->auth); | 685 | qDebug( "session->auth: %i", m_smtp->auth); |
683 | if (result) { | 686 | if (result) { |
684 | err = mailsmtp_auth( session, (char*)user, (char*)pass ); | 687 | err = mailsmtp_auth( m_smtp, (char*)user, (char*)pass ); |
685 | if ( err == MAILSMTP_NO_ERROR ) { | 688 | if ( err == MAILSMTP_NO_ERROR ) { |
686 | qDebug("auth ok"); | 689 | qDebug("auth ok"); |
@@ -691,11 +694,31 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT | |||
691 | } | 694 | } |
692 | } | 695 | } |
696 | } | ||
693 | 697 | ||
694 | if (result) { | 698 | void SMTPwrapper::disc_server() |
695 | err = mailsmtp_send( session, from, rcpts, data, size ); | 699 | { |
700 | if (m_smtp) { | ||
701 | mailsmtp_quit( m_smtp ); | ||
702 | mailsmtp_free( m_smtp ); | ||
703 | m_smtp = 0; | ||
704 | } | ||
705 | } | ||
706 | |||
707 | int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size ) | ||
708 | { | ||
709 | int err,result; | ||
710 | QString failuretext = ""; | ||
711 | |||
712 | connect_server(); | ||
713 | |||
714 | result = 1; | ||
715 | if (m_smtp) { | ||
716 | err = mailsmtp_send( m_smtp, from, rcpts, data, size ); | ||
696 | if ( err != MAILSMTP_NO_ERROR ) { | 717 | if ( err != MAILSMTP_NO_ERROR ) { |
697 | failuretext=tr("Error sending mail: %1").arg(mailsmtpError(err)); | 718 | failuretext=tr("Error sending mail: %1").arg(mailsmtpError(err)); |
698 | result = 0; | 719 | result = 0; |
699 | } | 720 | } |
721 | } else { | ||
722 | result = 0; | ||
700 | } | 723 | } |
701 | 724 | ||
@@ -706,20 +729,11 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT | |||
706 | storeMail(data,size,"Sent"); | 729 | storeMail(data,size,"Sent"); |
707 | } | 730 | } |
708 | if (session) { | ||
709 | mailsmtp_quit( session ); | ||
710 | mailsmtp_free( session ); | ||
711 | } | ||
712 | return result; | 731 | return result; |
713 | } | 732 | } |
714 | 733 | ||
715 | void SMTPwrapper::sendMail(const Mail&mail,SMTPaccount*aSmtp,bool later ) { | 734 | void SMTPwrapper::sendMail(const Mail&mail,bool later ) |
735 | { | ||
716 | mailmime * mimeMail; | 736 | mailmime * mimeMail; |
717 | 737 | ||
718 | SMTPaccount *smtp = aSmtp; | ||
719 | |||
720 | if (!later && !smtp) { | ||
721 | qDebug("Didn't get any send method - giving up"); | ||
722 | return; | ||
723 | } | ||
724 | mimeMail = createMimeMail(mail ); | 738 | mimeMail = createMimeMail(mail ); |
725 | if ( mimeMail == NULL ) { | 739 | if ( mimeMail == NULL ) { |
@@ -729,5 +743,5 @@ void SMTPwrapper::sendMail(const Mail&mail,SMTPaccount*aSmtp,bool later ) { | |||
729 | sendProgress->show(); | 743 | sendProgress->show(); |
730 | sendProgress->setMaxMails(1); | 744 | sendProgress->setMaxMails(1); |
731 | smtpSend( mimeMail,later,smtp); | 745 | smtpSend( mimeMail,later); |
732 | qDebug("Clean up done"); | 746 | qDebug("Clean up done"); |
733 | sendProgress->hide(); | 747 | sendProgress->hide(); |
@@ -738,5 +752,5 @@ void SMTPwrapper::sendMail(const Mail&mail,SMTPaccount*aSmtp,bool later ) { | |||
738 | } | 752 | } |
739 | 753 | ||
740 | int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,SMTPaccount*smtp,RecMail*which) { | 754 | int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,RecMail*which) { |
741 | size_t curTok = 0; | 755 | size_t curTok = 0; |
742 | mailimf_fields *fields = 0; | 756 | mailimf_fields *fields = 0; |
@@ -761,5 +775,5 @@ int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,SMTPaccount*smtp,RecMail*which | |||
761 | 775 | ||
762 | if (rcpts && from) { | 776 | if (rcpts && from) { |
763 | res = smtpSend(from,rcpts,data->Content(),data->Length(),smtp ); | 777 | res = smtpSend(from,rcpts,data->Content(),data->Length()); |
764 | } | 778 | } |
765 | if (fields) { | 779 | if (fields) { |
@@ -780,9 +794,9 @@ int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,SMTPaccount*smtp,RecMail*which | |||
780 | 794 | ||
781 | /* this is a special fun */ | 795 | /* this is a special fun */ |
782 | bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) { | 796 | bool SMTPwrapper::flushOutbox() { |
783 | bool returnValue = true; | 797 | bool returnValue = true; |
784 | 798 | ||
785 | qDebug("Sending the queue"); | 799 | qDebug("Sending the queue"); |
786 | if (!smtp) { | 800 | if (!m_SmtpAccount) { |
787 | qDebug("No smtp account given"); | 801 | qDebug("No smtp account given"); |
788 | return false; | 802 | return false; |
@@ -807,10 +821,10 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) { | |||
807 | } | 821 | } |
808 | 822 | ||
809 | oldPw = smtp->getPassword(); | 823 | oldPw = m_SmtpAccount->getPassword(); |
810 | oldUser = smtp->getUser(); | 824 | oldUser = m_SmtpAccount->getUser(); |
811 | if (smtp->getLogin() && (smtp->getUser().isEmpty() || smtp->getPassword().isEmpty()) ) { | 825 | if (m_SmtpAccount->getLogin() && (m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty()) ) { |
812 | // get'em | 826 | // get'em |
813 | QString user,pass; | 827 | QString user,pass; |
814 | LoginDialog login( smtp->getUser(), smtp->getPassword(), NULL, 0, true ); | 828 | LoginDialog login( m_SmtpAccount->getUser(), m_SmtpAccount->getPassword(), NULL, 0, true ); |
815 | login.show(); | 829 | login.show(); |
816 | if ( QDialog::Accepted == login.exec() ) { | 830 | if ( QDialog::Accepted == login.exec() ) { |
@@ -819,6 +833,6 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) { | |||
819 | pass = login.getPassword().latin1(); | 833 | pass = login.getPassword().latin1(); |
820 | reset_user_value = true; | 834 | reset_user_value = true; |
821 | smtp->setUser(user); | 835 | m_SmtpAccount->setUser(user); |
822 | smtp->setPassword(pass); | 836 | m_SmtpAccount->setPassword(pass); |
823 | } else { | 837 | } else { |
824 | return true; | 838 | return true; |
@@ -833,5 +847,5 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) { | |||
833 | 847 | ||
834 | while (mailsToSend.count()>0) { | 848 | while (mailsToSend.count()>0) { |
835 | if (sendQueuedMail(wrap,smtp,mailsToSend.at(0))==0) { | 849 | if (sendQueuedMail(wrap,mailsToSend.at(0))==0) { |
836 | QMessageBox::critical(0,tr("Error sending mail"), | 850 | QMessageBox::critical(0,tr("Error sending mail"), |
837 | tr("Error sending queued mail - breaking")); | 851 | tr("Error sending queued mail - breaking")); |
@@ -844,6 +858,6 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) { | |||
844 | } | 858 | } |
845 | if (reset_user_value) { | 859 | if (reset_user_value) { |
846 | smtp->setUser(oldUser); | 860 | m_SmtpAccount->setUser(oldUser); |
847 | smtp->setPassword(oldPw); | 861 | m_SmtpAccount->setPassword(oldPw); |
848 | } | 862 | } |
849 | Config cfg( "mail" ); | 863 | Config cfg( "mail" ); |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h index 75e4891..7f6aac1 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.h +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h | |||
@@ -1,2 +1,3 @@ | |||
1 | // -*- Mode: C++; -*- | ||
1 | #ifndef SMTPwrapper_H | 2 | #ifndef SMTPwrapper_H |
2 | #define SMTPwrapper_H | 3 | #define SMTPwrapper_H |
@@ -21,4 +22,5 @@ struct mailimf_address_list; | |||
21 | class progressMailSend; | 22 | class progressMailSend; |
22 | struct mailsmtp; | 23 | struct mailsmtp; |
24 | class SMTPaccount; | ||
23 | 25 | ||
24 | class SMTPwrapper : public QObject | 26 | class SMTPwrapper : public QObject |
@@ -27,8 +29,8 @@ class SMTPwrapper : public QObject | |||
27 | 29 | ||
28 | public: | 30 | public: |
29 | SMTPwrapper( Settings *s ); | 31 | SMTPwrapper(SMTPaccount * aSmtp); |
30 | virtual ~SMTPwrapper(){} | 32 | virtual ~SMTPwrapper(); |
31 | void sendMail(const Mail& mail,SMTPaccount*smtp,bool later=false ); | 33 | void sendMail(const Mail& mail,bool later=false ); |
32 | bool flushOutbox(SMTPaccount*smtp); | 34 | bool flushOutbox(); |
33 | 35 | ||
34 | static progressMailSend*sendProgress; | 36 | static progressMailSend*sendProgress; |
@@ -38,4 +40,11 @@ signals: | |||
38 | 40 | ||
39 | protected: | 41 | protected: |
42 | mailsmtp *m_smtp; | ||
43 | SMTPaccount * m_SmtpAccount; | ||
44 | |||
45 | void connect_server(); | ||
46 | void disc_server(); | ||
47 | int start_smtp_tls(); | ||
48 | |||
40 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); | 49 | mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); |
41 | mailimf_fields *createImfFields(const Mail &mail ); | 50 | mailimf_fields *createImfFields(const Mail &mail ); |
@@ -46,5 +55,5 @@ protected: | |||
46 | mailmime *buildTxtPart(const QString&str ); | 55 | mailmime *buildTxtPart(const QString&str ); |
47 | mailmime *buildFilePart(const QString&filename,const QString&mimetype,const QString&content); | 56 | mailmime *buildFilePart(const QString&filename,const QString&mimetype,const QString&content); |
48 | void smtpSend( mailmime *mail,bool later, SMTPaccount *smtp ); | 57 | void smtpSend( mailmime *mail,bool later); |
49 | clist *createRcptList( mailimf_fields *fields ); | 58 | clist *createRcptList( mailimf_fields *fields ); |
50 | 59 | ||
@@ -56,12 +65,10 @@ protected: | |||
56 | static char *getFrom( mailimf_field *ffrom); | 65 | static char *getFrom( mailimf_field *ffrom); |
57 | static mailimf_field *getField( mailimf_fields *fields, int type ); | 66 | static mailimf_field *getField( mailimf_fields *fields, int type ); |
58 | static int start_smtp_tls(mailsmtp *session); | ||
59 | 67 | ||
60 | int smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMTPaccount *smtp ); | 68 | int smtpSend(char*from,clist*rcpts,const char*data,size_t size); |
61 | 69 | ||
62 | void storeMail(mailmime*mail, const QString&box); | 70 | void storeMail(mailmime*mail, const QString&box); |
63 | Settings *settings; | ||
64 | 71 | ||
65 | int sendQueuedMail(AbstractMail*wrap,SMTPaccount*smtp,RecMail*which); | 72 | int sendQueuedMail(AbstractMail*wrap,RecMail*which); |
66 | void storeFailedMail(const char*data,unsigned int size, const char*failuremessage); | 73 | void storeFailedMail(const char*data,unsigned int size, const char*failuremessage); |
67 | 74 | ||
@@ -70,5 +77,5 @@ protected: | |||
70 | 77 | ||
71 | protected slots: | 78 | protected slots: |
72 | void emitQCop( int queued ); | 79 | void emitQCop( int queued ); |
73 | 80 | ||
74 | }; | 81 | }; |
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index ea0019d..0795436 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -95,8 +95,9 @@ void OpieMail::slotSendQueued() | |||
95 | } | 95 | } |
96 | if (smtp) { | 96 | if (smtp) { |
97 | SMTPwrapper * wrap = new SMTPwrapper(settings); | 97 | SMTPwrapper * wrap = new SMTPwrapper(smtp); |
98 | if ( wrap->flushOutbox(smtp) ) { | 98 | if ( wrap->flushOutbox() ) { |
99 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); | 99 | QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); |
100 | } | 100 | } |
101 | delete wrap; | ||
101 | } | 102 | } |
102 | } | 103 | } |