Search the web
Sign In
New User? Sign Up
gbuffy · GBuffy Tool Discussion
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
[PATCH] read imap pass from .gbuffyrc   Message List  
Reply | Forward Message #115 of 231 |
Hi,

I am still using xbuffy but the follwing patch enhances gbuffy to also
read password from .gbuffyrc for imap connections.

As this is a security problem, one may also want to check permissions
of .gbuffyrc to not be group or world readable; haven't done this but
a fstat(2) call could be added easily in config.c around line 358
(saving then should also take care of permissions).

The patch will hide the password in the Mailbox Configuration Dialog
(displaying ******) and configuring and saving should be working fine too.

--- cut ---
--- config.c.orig Fri Oct 10 21:30:11 2003
+++ config.c Wed Oct 29 11:58:57 2003
@@ -118,6 +118,7 @@
proplist_t ssl = PLMakeString ("ssl");
#endif
proplist_t login = PLMakeString ("login");
+ proplist_t pass = PLMakeString ("pass");
proplist_t newsrc = PLMakeString ("newsrc");
proplist_t tmp;
BOX_INFO *box;
@@ -192,6 +193,12 @@
boxdict = PLInsertDictionaryEntry (boxdict, login, tmp);
PLRelease (tmp);
}
+ if (box->pass && box->pass[0])
+ {
+ tmp = PLMakeString (box->pass);
+ boxdict = PLInsertDictionaryEntry (boxdict, pass, tmp);
+ PLRelease (tmp);
+ }
}
if (box->newsrc && box->newsrc[0])
{
@@ -229,6 +236,7 @@
PLRelease(ssl);
#endif
PLRelease(login);
+ PLRelease(pass);
PLRelease(newsrc);
}

@@ -292,6 +300,7 @@
"mutt");
box->server = configure_load_string (boxdict, "server");
box->login = configure_load_string (boxdict, "login");
+ box->pass = configure_load_string (boxdict, "pass");
if (box->type == GB_NNTP)
box->newsrc = configure_load_path_with_default (boxdict, "newsrc",
"~/.newsrc");
#ifdef HAVE_SSL
--- gbconfig.c.orig Fri Oct 10 09:06:53 2003
+++ gbconfig.c Wed Oct 29 11:58:57 2003
@@ -39,6 +39,8 @@
static GtkWidget *PortLabel;
static GtkWidget *LoginEntry;
static GtkWidget *LoginLabel;
+static GtkWidget *PassEntry;
+static GtkWidget *PassLabel;
static GtkWidget *NewsrcEntry;
static GtkWidget *NewsrcLabel;

@@ -117,6 +119,12 @@
gtk_widget_show (LoginEntry);
gtk_entry_set_text (GTK_ENTRY (LoginEntry),
box->login ? box->login : NONULL (Username));
+
+ gtk_widget_show (PassLabel);
+ gtk_widget_show (PassEntry);
+ gtk_entry_set_visibility (GTK_ENTRY (PassEntry), FALSE);
+ gtk_entry_set_text (GTK_ENTRY (PassEntry),
+ box->pass ? box->pass : "");
}
else
{
@@ -128,6 +136,8 @@
gtk_widget_hide (PortEntry);
gtk_widget_hide (LoginLabel);
gtk_widget_hide (LoginEntry);
+ gtk_widget_hide (PassLabel);
+ gtk_widget_hide (PassEntry);
gtk_widget_hide (NewsrcLabel);
gtk_widget_hide (NewsrcEntry);
}
@@ -170,6 +180,7 @@
if (box->type == GB_IMAP || box->type == GB_NNTP)
{
box->login = strdup (gtk_entry_get_text (GTK_ENTRY (LoginEntry)));
+ box->pass = strdup (gtk_entry_get_text (GTK_ENTRY (PassEntry)));
box->server = strdup (gtk_entry_get_text (GTK_ENTRY (ServerEntry)));
if (box->type == GB_NNTP)
box->newsrc = strdup (gtk_entry_get_text (GTK_ENTRY (NewsrcEntry)));
@@ -219,6 +230,11 @@
gtk_widget_show (LoginLabel);
gtk_widget_show (LoginEntry);
gtk_entry_set_text (GTK_ENTRY (LoginEntry), NONULL (Username));
+ gtk_widget_show (PassLabel);
+ gtk_widget_show (PassEntry);
+ gtk_entry_set_visibility (GTK_ENTRY (PassEntry), FALSE);
+ gtk_entry_set_text (GTK_ENTRY (PassEntry),
+ box->pass ? box->pass : "");
}
else
{
@@ -230,6 +246,8 @@
gtk_widget_hide (PortEntry);
gtk_widget_hide (LoginLabel);
gtk_widget_hide (LoginEntry);
+ gtk_widget_hide (PassLabel);
+ gtk_widget_hide (PassEntry);
gtk_widget_hide (NewsrcLabel);
gtk_widget_hide (NewsrcEntry);
}
@@ -249,6 +267,8 @@
{
if (box->login)
gtk_entry_set_text (GTK_ENTRY (LoginEntry), box->login);
+ if (box->pass)
+ gtk_entry_set_text (GTK_ENTRY (PassEntry), box->pass);
if (box->server)
gtk_entry_set_text (GTK_ENTRY (ServerEntry), box->server);
#ifdef HAVE_SSL
@@ -648,6 +668,14 @@
GTK_EXPAND | GTK_FILL, GTK_EXPAND, 0, 5);
LoginEntry = gtk_entry_new ();
gtk_table_attach (GTK_TABLE (table), LoginEntry, 1, 3, row - 1, row,
+ GTK_EXPAND | GTK_FILL, GTK_EXPAND, 0, 5);
+ row++;
+
+ PassLabel = gtk_label_new ("Password:");
+ gtk_table_attach (GTK_TABLE (table), PassLabel, 0, 1, row - 1, row,
+ GTK_EXPAND | GTK_FILL, GTK_EXPAND, 0, 5);
+ PassEntry = gtk_entry_new ();
+ gtk_table_attach (GTK_TABLE (table), PassEntry, 1, 3, row - 1, row,
GTK_EXPAND | GTK_FILL, GTK_EXPAND, 0, 5);
row++;

--- GBuffy.orig Wed Oct 29 12:04:40 2003
+++ GBuffy Wed Oct 29 12:06:43 2003
@@ -59,9 +59,19 @@
title = Tuna;
path = "~/Mail/tuna";
command = "rxvt -rv -e mutt -f =tuna";
+ },
+ {
+ type = imap;
+ title = INBOX;
+ path = "/var/mail/username";
+ login = username;
+ pass = "dummy";
+ command = "";
+ ssl = 1;
+ port = 143;
}
);
vertical = false;
polltime = 10;
maildir = "/home/blong/Mail";
-}
\ No newline at end of file
+}
--- cut ---


PS: the freebsd port section on the homepage seems to need updating.

--
Greetings

Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT
56 69 73 69 74 http://www.zabbadoz.net/



Wed Oct 29, 2003 1:24 pm

bzeeb@...
Send Email Send Email

Forward
Message #115 of 231 |
Expand Messages Author Sort by Date

Hi, I am still using xbuffy but the follwing patch enhances gbuffy to also read password from .gbuffyrc for imap connections. As this is a security problem,...
Bjoern A. Zeeb
bzeeb@...
Send Email
Oct 29, 2003
1:25 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help