Re: implementing multiple smtp servers...




On 2001-07-20 06:54 Riccardo Persichetti wrote:
> -i don't know if we should remove the default smtp entries
>  found under Settings->Preferences->Mail_Servers->Outgoing_mail
>  and, at start up, load the ones stored on the current identity,
>  or the Default one.

I do not know, neither. Some user reports would be useful here. Note
that the need for multiple SMTP servers is smaller if you can
authenticate to your server.

> -or, maybe it's better if we leave the entries in the preferences,
>  so that if we have an identity with empty smtp entries, we use
>  the one found under preferences...
>
> Please could someone help me?
> Attached to this message there is a small patch,
> basically it just adds smtp fields to identities...

I have rewritten this patch to make it compile with current CVS
(attached). The identity dialog becomes to big and needs rearrangement
(use GtkNotebook?).

BTW, I am going to create a branch in CVS for patches that seem useful
but not urgent enough to make it into balsa-1.2.0. I am very grateful
that at least some patches were checked by other people (thanks,
christophe): I am not able to have a look at all of them and I
appreciate any help I can get.

/Pawel
-- 
Pawel Salek (pawsa@theochem.kth.se) http://www.theochem.kth.se/~pawsa/
Theoretical Chemistry Division, KTH voice: +46 8 790-8202
Index: libbalsa/identity.c
===================================================================
RCS file: /cvs/gnome/balsa/libbalsa/identity.c,v
retrieving revision 1.3
diff -u -r1.3 identity.c
--- libbalsa/identity.c	2001/07/24 10:55:37	1.3
+++ libbalsa/identity.c	2001/08/14 09:28:27
@@ -129,6 +129,11 @@
 {
     ident->identity_name = NULL;
     ident->address = libbalsa_address_new();
+#ifdef ENABLE_ESMTP
+    ident->smtpserver = NULL;
+    ident->smtpuser = NULL;
+    ident->smtppassphrase = NULL;
+#endif
     ident->replyto = NULL;
     ident->domain = NULL;
     ident->bcc = NULL;
@@ -186,6 +191,11 @@
     ident = LIBBALSA_IDENTITY(object);
 
     gtk_object_destroy(GTK_OBJECT(ident->address));
+#ifdef ENABLE_ESMTP
+    g_free(ident->smtpserver);
+    g_free(ident->smtpuser);
+    g_free(ident->smtppassphrase);
+#endif
     g_free(ident->identity_name);
     g_free(ident->replyto);
     g_free(ident->domain);
@@ -220,7 +230,39 @@
 }
 
 
+#ifdef ENABLE_ESMTP
 void
+libbalsa_identity_set_smtpserver(LibBalsaIdentity* ident, const gchar* serv)
+{
+    g_return_if_fail(ident != NULL);
+    
+    g_free(ident->smtpserver);
+    ident->smtpserver = g_strdup(serv);
+}
+
+
+void
+libbalsa_identity_set_smtpuser(LibBalsaIdentity* ident, const gchar* user)
+{
+    g_return_if_fail(ident != NULL);
+    
+    g_free(ident->smtpuser);
+    ident->smtpuser = g_strdup(user);
+}
+
+
+void
+libbalsa_identity_set_smtppassphrase(LibBalsaIdentity* ident, const gchar* pass)
+{
+    g_return_if_fail(ident != NULL);
+    
+    g_free(ident->smtppassphrase);
+    ident->smtppassphrase = g_strdup(pass);
+}
+#endif
+
+
+void
 libbalsa_identity_set_replyto(LibBalsaIdentity* ident, const gchar* address)
 {
     g_return_if_fail(ident != NULL);
@@ -637,7 +679,18 @@
                                "identity-address",
                                NULL);
     }
-    
+
+#ifdef ENABLE_ESMTP
+    ident_dialog_add_entry(dialog, _("SMTP Server:"), 
+                           "identity-smtpserver",
+                           ident->smtpserver);
+    ident_dialog_add_entry(dialog, _("SMTP User:"), 
+                           "identity-smtpuser",
+                           ident->smtpuser);
+    ident_dialog_add_entry(dialog, _("SMTP Pass Phrase:"), 
+                           "identity-smtpassphrase",
+                           ident->smtppassphrase);
+#endif
     ident_dialog_add_entry(dialog, _("Reply To:"), 
                            "identity-replyto",
                            ident->replyto);
@@ -871,6 +924,12 @@
     address->address_list = g_list_append(address->address_list, text);
     libbalsa_identity_set_address(id, address);
 
+#ifdef ENABLE_ESMTP
+    g_free(id->smtpserver); g_free(id->smtpuser); g_free(id->smtppassphrase);
+    id->smtpserver      = ident_dialog_get_text(dlg, "identity-smtpserver");
+    id->smtpuser        = ident_dialog_get_text(dlg, "identity-smtpuser");
+    id->smtppassphrase  = ident_dialog_get_text(dlg, "identity-smtppassphrase");
+#endif
     g_free(id->replyto);
     id->replyto         = ident_dialog_get_text(dlg, "identity-replyto");
     g_free(id->domain);
@@ -1132,6 +1191,14 @@
                             _("Full Name:"), "identity-fullname");
     display_frame_add_field(GTK_FRAME(frame1), GTK_BOX(vbox1), 
                             _("Mailing Address:"), "identity-address");
+#ifdef ENABLE_ESMTP
+    display_frame_add_field(GTK_FRAME(frame1), GTK_BOX(vbox1), 
+                            _("SMTP Server:"), "identity-smtpserver");
+    display_frame_add_field(GTK_FRAME(frame1), GTK_BOX(vbox1), 
+                            _("SMTP User:"), "identity-smtpuser");
+    display_frame_add_field(GTK_FRAME(frame1), GTK_BOX(vbox1), 
+                            _("SMTP Pass Phrase:"), "identity-smtppassphrase");
+#endif
     display_frame_add_field(GTK_FRAME(frame1), GTK_BOX(vbox1), 
                             _("Reply To:"), "identity-replyto");
     display_frame_add_field(GTK_FRAME(frame1), GTK_BOX(vbox1), 
@@ -1208,6 +1275,11 @@
     else
         display_frame_set_field(frame, "identity-address", NULL);
     
+#ifdef ENABLE_ESMTP
+    display_frame_set_field(frame, "identity-smtpserver", ident->smtpserver);
+    display_frame_set_field(frame, "identity-smtpuser", ident->smtpuser);
+    display_frame_set_field(frame, "identity-smtppassphrase", ident->smtppassphrase);
+#endif
     display_frame_set_field(frame, "identity-replyto", ident->replyto);
     display_frame_set_field(frame, "identity-domain", ident->domain);
     display_frame_set_field(frame, "identity-bcc", ident->bcc);
@@ -1264,6 +1336,11 @@
     ident->address->address_list = 
         g_list_append(ident->address->address_list, 
                       gnome_config_get_string("Address"));
+#ifdef ENABLE_ESMTP
+    ident->smtpserver = gnome_config_get_string("ESMTPServer");
+    ident->smtpuser = gnome_config_get_string("ESMTPUser");
+    ident->smtppassphrase = gnome_config_get_string("ESMTPPassPhrase");
+#endif
     ident->replyto = gnome_config_get_string("ReplyTo");
     ident->domain = gnome_config_get_string("Domain");
     ident->bcc = gnome_config_get_string("Bcc");
@@ -1305,6 +1382,11 @@
     if (ident->address->address_list != NULL)
         gnome_config_set_string("Address", ident->address->address_list->data);
 
+#ifdef ENABLE_ESMTP
+    gnome_config_set_string("ESMTPServer", ident->smtpserver);
+    gnome_config_set_string("ESMTPUser", ident->smtpuser);
+    gnome_config_set_string("ESMTPPassPhrase", ident->smtppassphrase);
+#endif
     gnome_config_set_string("ReplyTo", ident->replyto);
     gnome_config_set_string("Domain", ident->domain);
     gnome_config_set_string("Bcc", ident->bcc);
Index: libbalsa/identity.h
===================================================================
RCS file: /cvs/gnome/balsa/libbalsa/identity.h,v
retrieving revision 1.1
diff -u -r1.1 identity.h
--- libbalsa/identity.h	2001/07/11 20:48:19	1.1
+++ libbalsa/identity.h	2001/08/14 09:28:27
@@ -24,7 +24,8 @@
 #define __LIBBALSA_IDENTITY_H__
 
 #include <gtk/gtk.h>
-#include <address.h>
+#include "config.h"
+#include "address.h"
 
 #ifdef __cpluscplus
 extern "C" 
@@ -50,6 +51,11 @@
         gchar* identity_name;
         
         LibBalsaAddress* address;
+#ifdef ENABLE_ESMTP
+	gchar* smtpserver;
+	gchar* smtpuser;
+	gchar* smtppassphrase;
+#endif
         gchar* replyto;
         gchar* domain;
         gchar* bcc;
@@ -76,6 +82,11 @@
     
     void libbalsa_identity_set_identity_name(LibBalsaIdentity*, const gchar*);
     void libbalsa_identity_set_address(LibBalsaIdentity*, LibBalsaAddress*);
+#ifdef ENABLE_ESMTP
+    void libbalsa_identity_set_smtpserver(LibBalsaIdentity*, const gchar*);
+    void libbalsa_identity_set_smtpuser(LibBalsaIdentity*, const gchar*);
+    void libbalsa_identity_set_smtppassphrase(LibBalsaIdentity*, const gchar*);
+#endif
     void libbalsa_identity_set_replyto(LibBalsaIdentity*, const gchar*);
     void libbalsa_identity_set_domain(LibBalsaIdentity*, const gchar*);
     void libbalsa_identity_set_bcc(LibBalsaIdentity*, const gchar*);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]