From 03799e24b23b9a04aee38d40898625a71b92b5e6 Mon Sep 17 00:00:00 2001 From: Antonio Radici Date: Sun, 13 Sep 2009 19:29:42 +0100 Subject: [PATCH 1/1] upstream/544794-smtp-batch.patch: mutt won't ask for a password if smtp_user and smtp_pass are set in .muttrc (Closes: 544794) --- debian/changelog | 2 + .../patches/upstream/544794-smtp-batch.patch | 68 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 debian/patches/upstream/544794-smtp-batch.patch diff --git a/debian/changelog b/debian/changelog index 32f3788..0d19fc6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,8 @@ mutt (1.5.20-3) unstable; urgency=low hightlighting if text_flowed was set to 'yes' (Closes: 533520) + upstream/542817-smimekeys-tmpdir.patch: smime_keys.pl will skip tmpdir if it contains '=' (Closes: 542817) + + upstream/544794-smtp-batch.patch: mutt won't ask for a password if + smtp_user and smtp_pass are set in .muttrc (Closes: 544794) * debian/control: + Standards-Version bumped to 3.8.3 * debian/extra/lib/mailto-mutt: patch from madduck@ to correctly handle the diff --git a/debian/patches/upstream/544794-smtp-batch.patch b/debian/patches/upstream/544794-smtp-batch.patch new file mode 100644 index 0000000..953873c --- /dev/null +++ b/debian/patches/upstream/544794-smtp-batch.patch @@ -0,0 +1,68 @@ +Without this patch mutt fails to send messages and ask for a password even if +smtp_user and smtp_pass are defined in .muttrc, see upstream bug +http://bugs.mutt.org/3289 + +--- a/account.c ++++ b/account.c +@@ -155,6 +155,8 @@ + else if ((account->type == M_ACCT_TYPE_POP) && PopUser) + strfcpy (account->user, PopUser, sizeof (account->user)); + #endif ++ else if (option (OPTNOCURSES)) ++ return -1; + /* prompt (defaults to unix username), copy into account->user */ + else + { +@@ -215,6 +217,8 @@ + else if ((account->type == M_ACCT_TYPE_SMTP) && SmtpPass) + strfcpy (account->pass, SmtpPass, sizeof (account->pass)); + #endif ++ else if (option (OPTNOCURSES)) ++ return -1; + else + { + snprintf (prompt, sizeof (prompt), _("Password for %s@%s: "), +--- a/mutt_sasl.c ++++ b/mutt_sasl.c +@@ -304,7 +304,7 @@ + + snprintf (prompt, sizeof (prompt), "%s: ", interaction->prompt); + resp[0] = '\0'; +- if (mutt_get_field (prompt, resp, sizeof (resp), 0)) ++ if (option (OPTNOCURSES) || mutt_get_field (prompt, resp, sizeof (resp), 0)) + return SASL_FAIL; + + interaction->len = mutt_strlen (resp)+1; +--- a/smtp.c ++++ b/smtp.c +@@ -172,7 +172,7 @@ + progress_t progress; + struct stat st; + int r, term = 0; +- size_t buflen; ++ size_t buflen = 0; + + fp = fopen (msgfile, "r"); + if (!fp) +@@ -454,12 +454,6 @@ + } + + #ifdef USE_SASL +- if (!(conn->account.flags & M_ACCT_PASS) && option (OPTNOCURSES)) +- { +- mutt_error (_("Interactive SMTP authentication not supported")); +- mutt_sleep (1); +- return -1; +- } + return smtp_auth (conn); + #else + mutt_error (_("SMTP authentication requires SASL")); +@@ -603,7 +597,7 @@ + } + } + strfcpy (buf + len, "\r\n", sizeof (buf) - len); +- } while (rc == smtp_ready); ++ } while (rc == smtp_ready && saslrc != SASL_FAIL); + + if (smtp_success (rc)) + { -- 2.43.0