{"thread":{"id":"24974","subject":"[PATCH v2 0/3] Add support for SMTP server options","startedAt":"2010-09-04T19:55:25Z","lastAt":"2010-09-05T07:15:23Z","messageCount":7,"participants":["Pascal Obry","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":2,"patchTotal":3},"messages":[{"id":"149862","messageId":"1283630128-3472-1-git-send-email-pascal@obry.net","threadId":"24974","inReplyTo":null,"subject":"[PATCH v2 0/3] Add support for SMTP server options","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-09-04T19:55:25Z","receivedAt":"2010-09-04T19:55:25Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"I'm not familiar at all with Perl so comments on style or usage most\nwelcomed. This patch is to introduce a way to pass specific options to the\nSMTP server used by git-send-email.\n\nI need that to be able to use different SMTP account (wanadoo, gmail...) on\nsome Git repositories to send over proper identity.\n\nThis is v2 of the patch thanks to Junio and AEvar for the initial review\nand help.\n\nThe two first patches are really code clean-up found while working on this\nnew feature. The last patch is the actual implementation of this new\nfeature.\n\nPascal Obry (3):\n  Minor indentation fix.\n  Remove @smtp_host_parts variable as not used.\n  New send-email option smtpserveroption.\n\n Documentation/git-send-email.txt |    8 ++++++++\n git-send-email.perl              |   12 +++++++++---\n 2 files changed, 17 insertions(+), 3 deletions(-)\n\n-- \n1.7.2.2.277.gb49c4\n"},{"id":"149863","messageId":"1283630128-3472-2-git-send-email-pascal@obry.net","threadId":"24974","inReplyTo":"1283630128-3472-1-git-send-email-pascal@obry.net","subject":"[PATCH v2 1/3] Minor indentation fix.","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-09-04T19:55:26Z","receivedAt":"2010-09-04T19:55:26Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"---\n git-send-email.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 6dab3bf..0063606 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -212,7 +212,7 @@ my %config_settings = (\n     \"smtpserverport\" => \\$smtp_server_port,\n     \"smtpuser\" => \\$smtp_authuser,\n     \"smtppass\" => \\$smtp_authpass,\n-\t\"smtpdomain\" => \\$smtp_domain,\n+    \"smtpdomain\" => \\$smtp_domain,\n     \"to\" => \\@to,\n     \"cc\" => \\@initial_cc,\n     \"cccmd\" => \\$cc_cmd,\n-- \n1.7.2.2.277.gb49c4\n"},{"id":"149864","messageId":"1283630128-3472-3-git-send-email-pascal@obry.net","threadId":"24974","inReplyTo":"1283630128-3472-1-git-send-email-pascal@obry.net","subject":"[PATCH v2 2/3] Remove @smtp_host_parts variable as not used.","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-09-04T19:55:27Z","receivedAt":"2010-09-04T19:55:27Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"---\n git-send-email.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 0063606..39cb5af 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -189,7 +189,7 @@ sub do_edit {\n # Variables with corresponding config settings\n my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);\n my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);\n-my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts, $smtp_domain);\n+my ($identity, $aliasfiletype, @alias_files, $smtp_domain);\n my ($validate, $confirm);\n my (@suppress_cc);\n my ($auto_8bit_encoding);\n-- \n1.7.2.2.277.gb49c4\n"},{"id":"149865","messageId":"1283630128-3472-4-git-send-email-pascal@obry.net","threadId":"24974","inReplyTo":"1283630128-3472-1-git-send-email-pascal@obry.net","subject":"[PATCH v2 3/3] New send-email option smtpserveroption.","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-09-04T19:55:28Z","receivedAt":"2010-09-04T19:55:28Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"The new command line parameter --smtp-server-option or default\nconfiguration sendemail.smtpserveroption can be used to pass\nspecific options to the SMTP server. Update the documentation\naccordingly.\n---\n Documentation/git-send-email.txt |    8 ++++++++\n git-send-email.perl              |    8 +++++++-\n 2 files changed, 15 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex c283084..ed30be8 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -157,6 +157,14 @@ user is prompted for a password while the input is masked for privacy.\n \t`/usr/lib/sendmail` if such program is available, or\n \t`localhost` otherwise.\n \n+--smtp-server-option=<options>::\n+\tIf set, specifies the outgoing SMTP server option to use.\n+\tDefault value can be specified by the 'sendemail.smtpserveroption'\n+\tconfiguration option.\n++\n+The --smtp-server-option option must be repeated for each option you want\n+to pass to the server.\n+\n --smtp-server-port=<port>::\n \tSpecifies a port different from the default port (SMTP\n \tservers typically listen to smtp port 25, but may also listen to\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 39cb5af..47989fe 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -60,6 +60,7 @@ git send-email [options] <file | directory | rev-list options >\n     --envelope-sender       <str>  * Email envelope sender.\n     --smtp-server       <str:int>  * Outgoing SMTP server to use. The port\n                                      is optional. Default 'localhost'.\n+    --smtp-server-option    <str>  * Outgoing SMTP server option to use.\n     --smtp-server-port      <int>  * Outgoing SMTP server port.\n     --smtp-user             <str>  * Username for SMTP-AUTH.\n     --smtp-pass             <str>  * Password for SMTP-AUTH; not necessary.\n@@ -188,7 +189,8 @@ sub do_edit {\n \n # Variables with corresponding config settings\n my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);\n-my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);\n+my ($smtp_server, $smtp_server_port, @smtp_server_options);\n+my ($smtp_authuser, $smtp_encryption);\n my ($identity, $aliasfiletype, @alias_files, $smtp_domain);\n my ($validate, $confirm);\n my (@suppress_cc);\n@@ -210,6 +212,7 @@ my %config_bool_settings = (\n my %config_settings = (\n     \"smtpserver\" => \\$smtp_server,\n     \"smtpserverport\" => \\$smtp_server_port,\n+    \"smtpserveroption\" => \\@smtp_server_options,\n     \"smtpuser\" => \\$smtp_authuser,\n     \"smtppass\" => \\$smtp_authpass,\n     \"smtpdomain\" => \\$smtp_domain,\n@@ -279,6 +282,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"no-bcc\" => \\$no_bcc,\n \t\t    \"chain-reply-to!\" => \\$chain_reply_to,\n \t\t    \"smtp-server=s\" => \\$smtp_server,\n+\t\t    \"smtp-server-option=s\" => \\@smtp_server_options,\n \t\t    \"smtp-server-port=s\" => \\$smtp_server_port,\n \t\t    \"smtp-user=s\" => \\$smtp_authuser,\n \t\t    \"smtp-pass:s\" => \\$smtp_authpass,\n@@ -1015,6 +1019,8 @@ X-Mailer: git-send-email $gitversion\n \t\t}\n \t}\n \n+\tunshift (@sendmail_parameters, @smtp_server_options);\n+\n \tif ($dry_run) {\n \t\t# We don't want to send the email.\n \t} elsif ($smtp_server =~ m#^/#) {\n-- \n1.7.2.2.277.gb49c4\n"},{"id":"149867","messageId":"4C82A78C.6090602@obry.net","threadId":"24974","inReplyTo":"1283630128-3472-4-git-send-email-pascal@obry.net","subject":"Re: [PATCH v2 3/3] New send-email option smtpserveroption.","fromName":"Pascal Obry","fromEmail":"pascal.obry@gmail.com","sentAt":"2010-09-04T20:09:48Z","receivedAt":"2010-09-04T20:09:48Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Le 04/09/2010 21:55, Pascal Obry a écrit :\n> +--smtp-server-option=<options>::\n\nshould be:               ^\n                         option\n\nWill issue another patch set (waiting for feedback on v2).\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"149870","messageId":"AANLkTinvos_65kb2uO9bTpRAaCeN+N63-KsMmARadt=3@mail.gmail.com","threadId":"24974","inReplyTo":"1283630128-3472-4-git-send-email-pascal@obry.net","subject":"Re: [PATCH v2 3/3] New send-email option smtpserveroption.","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-04T20:35:43Z","receivedAt":"2010-09-04T20:35:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Sep 4, 2010 at 19:55, Pascal Obry <pascal@obry.net> wrote:\n\nLooks good, but tests are always nice :)\n\n> +       unshift (@sendmail_parameters, @smtp_server_options);\n> +\n\nIt just seems iffy to not be able to provide options without having\nthe sendmail_parameters. Or maybe all usecases for this involve a\nprogram that takes sendmail-like arguments, so this isn't an issue.\n"},{"id":"149960","messageId":"4C83438B.4010701@obry.net","threadId":"24974","inReplyTo":"AANLkTinvos_65kb2uO9bTpRAaCeN+N63-KsMmARadt=3@mail.gmail.com","subject":"Re: [PATCH v2 3/3] New send-email option smtpserveroption.","fromName":"Pascal Obry","fromEmail":"pascal.obry@gmail.com","sentAt":"2010-09-05T07:15:23Z","receivedAt":"2010-09-05T07:15:23Z","isPatch":true,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Ævar,\n\n>> +       unshift (@sendmail_parameters, @smtp_server_options);\n>> +\n> \n> It just seems iffy to not be able to provide options without having\n> the sendmail_parameters. Or maybe all usecases for this involve a\n> program that takes sendmail-like arguments, so this isn't an issue.\n\nAs far as I understand sendmail_parameters is always used and set:\n\n\tmy @sendmail_parameters = ('-i', @recipients);\n\nThis is even documented:\n\n--smtp-server=<host>::\n\tIf set, specifies the outgoing SMTP server to use (e.g.\n\t`smtp.example.com` or a raw IP address).  Alternatively it can\n\tspecify a full pathname of a sendmail-like program instead;\n\tthe program must support the `-i` option.  Default value can\n\tbe specified by the 'sendemail.smtpserver' configuration\n\toption; the built-in default is `/usr/sbin/sendmail` or\n\t`/usr/lib/sendmail` if such program is available, or\n\t`localhost` otherwise.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"}]}