summaryrefslogtreecommitdiff
path: root/alpine/mailcmd.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2014-03-09 14:26:50 -0600
committerEduardo Chappa <chappa@washington.edu>2014-03-09 14:26:50 -0600
commite9554c597f7f33c6ebebaa47087b4db878a59913 (patch)
tree9b8ff514f4db831a456185034cc614cf712b43e2 /alpine/mailcmd.c
parentac368b05842ee45ed29cd997840eb788649da268 (diff)
downloadalpine-e9554c597f7f33c6ebebaa47087b4db878a59913.tar.xz
* Forwarding messages with attachments of content-type multipart,
failed when attempting to sign it, with and "Error writing pipe" error. * Using a .pinerc file outside the home directory made Alpine not find the .alpine-smime directory with certificates. * Configuration screen for S/MIME adds ability to manage certificates. (currently available to users who manage certificates in directories, not in containers, which will be available in the next alpha release.)
Diffstat (limited to 'alpine/mailcmd.c')
-rw-r--r--alpine/mailcmd.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/alpine/mailcmd.c b/alpine/mailcmd.c
index 1d252a38..a9fca5da 100644
--- a/alpine/mailcmd.c
+++ b/alpine/mailcmd.c
@@ -304,6 +304,46 @@ static ESCKEY_S flag_text_opt[] = {
{-1, 0, NULL, NULL}
};
+void
+alpine_get_password(char *prompt, char *pass, size_t len)
+{
+ int rc, flags;
+ do { /* transform this to a (*pith_)() function */
+ flags = OE_PASSWD | OE_DISALLOW_HELP;
+ pass[0] = '\0';
+ rc = optionally_enter(pass, -FOOTER_ROWS(ps_global), 0, len,
+ prompt, NULL, NO_HELP, &flags);
+ } while (rc!=0 && rc!=1 && rc>0);
+}
+
+int smime_import_certificate(char *filename, char *full_filename, size_t len)
+{
+ int r = 1;
+ static HISTORY_S *history = NULL;
+ static ESCKEY_S eopts[] = {
+ {ctrl('T'), 10, "^T", N_("To Files")},
+ {-1, 0, NULL, NULL},
+ {-1, 0, NULL, NULL}};
+
+ if(F_ON(F_ENABLE_TAB_COMPLETE,ps_global)){
+ eopts[r].ch = ctrl('I');
+ eopts[r].rval = 11;
+ eopts[r].name = "TAB";
+ eopts[r].label = N_("Complete");
+ }
+
+ eopts[++r].ch = -1;
+
+ filename[0] = '\0';
+ full_filename[0] = '\0';
+
+ r = get_export_filename(ps_global, filename, NULL, full_filename,
+ len, "certificate", "IMPORT", eopts, NULL,
+ -FOOTER_ROWS(ps_global), GE_IS_IMPORT, &history);
+
+ return r;
+}
+
/*----------------------------------------------------------------------
The giant switch on the commands for index and viewing