mutt stable branch with some hacks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add $imap_login variable to specify which user to authenticate as ($imap_user controls which user's mail gets accessed). Currently this can't be specified interactively, since I can't think of a way to do it that wouldn't annoy users where login == user (the default value of $imap_login).

+68 -23
+33 -7
account.c
··· 1 1 /* 2 - * Copyright (C) 2000-3 Brendan Cully <brendan@kublai.com> 2 + * Copyright (C) 2000-5 Brendan Cully <brendan@kublai.com> 3 3 * 4 4 * This program is free software; you can redistribute it and/or modify 5 5 * it under the terms of the GNU General Public License as published by ··· 26 26 #include "account.h" 27 27 #include "url.h" 28 28 29 - /* mutt_account_match: compare account info (host/port/user) */ 29 + /* mutt_account_match: compare account info (host/port/user/login) */ 30 30 int mutt_account_match (const ACCOUNT* a1, const ACCOUNT* a2) 31 31 { 32 32 const char* user = NONULL (Username); 33 + const char* login = NONULL (Username); 33 34 34 35 if (a1->type != a2->type) 35 36 return 0; ··· 39 40 return 0; 40 41 41 42 #ifdef USE_IMAP 42 - if (a1->type == M_ACCT_TYPE_IMAP && ImapUser) 43 - user = ImapUser; 43 + if (a1->type == M_ACCT_TYPE_IMAP) 44 + { 45 + if (ImapUser) 46 + user = ImapUser; 47 + if (ImapLogin) 48 + login = ImapLogin; 49 + } 44 50 #endif 45 51 46 52 #ifdef USE_POP ··· 126 132 url->pass = account->pass; 127 133 } 128 134 129 - /* mutt_account_getuser: retrieve username into ACCOUNT, if neccessary */ 135 + /* mutt_account_getuser: retrieve username into ACCOUNT, if necessary */ 130 136 int mutt_account_getuser (ACCOUNT* account) 131 137 { 132 138 char prompt[SHORT_STRING]; ··· 156 162 return 0; 157 163 } 158 164 159 - /* mutt_account_getpass: fetch password into ACCOUNT, if neccessary */ 165 + int mutt_account_getlogin (ACCOUNT* account) 166 + { 167 + /* already set */ 168 + if (account->flags & M_ACCT_LOGIN) 169 + return 0; 170 + #ifdef USE_IMAP 171 + else if (account->type == M_ACCT_TYPE_IMAP) 172 + { 173 + if (ImapLogin) 174 + strfcpy (account->login, ImapLogin, sizeof (account->login)); 175 + else 176 + strfcpy (account->login, ImapUser, sizeof (account->login)); 177 + } 178 + #endif 179 + 180 + account->flags |= M_ACCT_LOGIN; 181 + 182 + return 0; 183 + } 184 + 185 + /* mutt_account_getpass: fetch password into ACCOUNT, if necessary */ 160 186 int mutt_account_getpass (ACCOUNT* account) 161 187 { 162 188 char prompt[SHORT_STRING]; ··· 174 200 else 175 201 { 176 202 snprintf (prompt, sizeof (prompt), _("Password for %s@%s: "), 177 - account->user, account->host); 203 + account->login, account->host); 178 204 account->pass[0] = '\0'; 179 205 if (mutt_get_password (prompt, account->pass, sizeof (account->pass))) 180 206 return -1;
+8 -5
account.h
··· 1 1 /* 2 - * Copyright (C) 2000-3 Brendan Cully <brendan@kublai.com> 2 + * Copyright (C) 2000-5 Brendan Cully <brendan@kublai.com> 3 3 * 4 4 * This program is free software; you can redistribute it and/or modify 5 5 * it under the terms of the GNU General Public License as published by ··· 32 32 }; 33 33 34 34 /* account flags */ 35 - #define M_ACCT_PORT (1<<0) 36 - #define M_ACCT_USER (1<<1) 37 - #define M_ACCT_PASS (1<<2) 38 - #define M_ACCT_SSL (1<<3) 35 + #define M_ACCT_PORT (1<<0) 36 + #define M_ACCT_USER (1<<1) 37 + #define M_ACCT_LOGIN (1<<2) 38 + #define M_ACCT_PASS (1<<3) 39 + #define M_ACCT_SSL (1<<4) 39 40 40 41 typedef struct 41 42 { 42 43 char user[64]; 44 + char login[64]; 43 45 char pass[64]; 44 46 char host[128]; 45 47 unsigned short port; ··· 51 53 int mutt_account_fromurl (ACCOUNT* account, ciss_url_t* url); 52 54 void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url); 53 55 int mutt_account_getuser (ACCOUNT* account); 56 + int mutt_account_getlogin (ACCOUNT* account); 54 57 int mutt_account_getpass (ACCOUNT* account); 55 58 void mutt_account_unsetpass (ACCOUNT* account); 56 59
+1
globals.h
··· 57 57 WHERE char *ImapDelimChars INITVAL (NULL); 58 58 WHERE char *ImapHeaders; 59 59 WHERE char *ImapHomeNamespace INITVAL (NULL); 60 + WHERE char *ImapLogin INITVAL (NULL); 60 61 WHERE char *ImapPass INITVAL (NULL); 61 62 WHERE char *ImapUser INITVAL (NULL); 62 63 #endif
+9 -1
init.h
··· 851 851 ** only subscribed folders or all folders. This can be toggled in the 852 852 ** IMAP browser with the \fItoggle-subscribed\fP function. 853 853 */ 854 + { "imap_login", DT_STR, R_NONE, UL &ImapLogin, UL 0 }, 855 + /* 856 + ** .pp 857 + ** Your login name on the IMAP server. 858 + ** .pp 859 + ** This variable defaults to the value of \fIimap_user\fP. 860 + */ 854 861 { "imap_pass", DT_STR, R_NONE, UL &ImapPass, UL 0 }, 855 862 /* 856 863 ** .pp ··· 889 896 { "imap_user", DT_STR, R_NONE, UL &ImapUser, UL 0 }, 890 897 /* 891 898 ** .pp 892 - ** Your login name on the IMAP server. 899 + ** The name of the user whose mail you intend to access on the IMAP 900 + ** server. 893 901 ** .pp 894 902 ** This variable defaults to your user name on the local machine. 895 903 */
+17 -10
mutt_sasl.c
··· 334 334 335 335 callback = mutt_sasl_callbacks; 336 336 337 - callback->id = SASL_CB_AUTHNAME; 337 + callback->id = SASL_CB_USER; 338 338 callback->proc = mutt_sasl_cb_authname; 339 339 callback->context = account; 340 340 callback++; 341 341 342 - callback->id = SASL_CB_USER; 342 + callback->id = SASL_CB_AUTHNAME; 343 343 callback->proc = mutt_sasl_cb_authname; 344 344 callback->context = account; 345 345 callback++; ··· 450 450 return SASL_OK; 451 451 } 452 452 453 - /* mutt_sasl_cb_authname: callback to retrieve authname or user (mutt 454 - * doesn't distinguish, even if some SASL plugins do) from ACCOUNT */ 453 + /* mutt_sasl_cb_authname: callback to retrieve authname or user from ACCOUNT */ 455 454 static int mutt_sasl_cb_authname (void* context, int id, const char** result, 456 455 unsigned* len) 457 456 { ··· 468 467 id == SASL_CB_AUTHNAME ? "authname" : "user", 469 468 account->host, account->port)); 470 469 471 - if (mutt_account_getuser (account)) 472 - return SASL_FAIL; 473 - 474 - *result = account->user; 475 - 470 + if (id == SASL_CB_AUTHNAME) 471 + { 472 + if (mutt_account_getlogin (account)) 473 + return SASL_FAIL; 474 + *result = account->login; 475 + } 476 + else 477 + { 478 + if (mutt_account_getuser (account)) 479 + return SASL_FAIL; 480 + *result = account->user; 481 + } 482 + 476 483 if (len) 477 484 *len = strlen (*result); 478 485 ··· 489 496 return SASL_BADPARAM; 490 497 491 498 dprint (2, (debugfile, 492 - "mutt_sasl_cb_pass: getting password for %s@%s:%u\n", account->user, 499 + "mutt_sasl_cb_pass: getting password for %s@%s:%u\n", account->login, 493 500 account->host, account->port)); 494 501 495 502 if (mutt_account_getpass (account))