Description: Make the -f/--from option interpret '<>' as an empty address.
Author: Martin Lambers <marlam@marlam.de>
Origin: upstream, http://msmtp.git.sourceforge.net/git/gitweb.cgi?p=msmtp/msmtp;a=commitdiff;h=72dd9a20
Bug-Debian: http://bugs.debian.org/612679
Last-Update: 2011-03-04
diff --git a/src/msmtp.c b/src/msmtp.c
index dc48ac5..7faf790 100644
--- a/src/msmtp.c
+++ b/src/msmtp.c
@@ -2720,7 +2720,16 @@ int msmtp_cmdline(msmtp_cmdline_conf_t *conf, int argc, char *argv[])
                 else
                 {
                     free(conf->cmdline_account->from);
-                    conf->cmdline_account->from = xstrdup(optarg);
+                    /* Accept '<>' to mean an empty from address, to fix Debian
+                     * bug 612679. */
+                    if (strcmp(optarg, "<>") == 0)
+                    {
+                        conf->cmdline_account->from = xstrdup("");
+                    }
+                    else
+                    {
+                        conf->cmdline_account->from = xstrdup(optarg);
+                    }
                     conf->cmdline_account->mask |= ACC_FROM;
                 }
                 break;
