{"thread":{"id":"14169","subject":"commit 'git-send-email: add support for TLS via Net::SMTP::SSL' causes warnings","startedAt":"2008-06-26T20:19:51Z","lastAt":"2008-06-26T21:03:21Z","messageCount":4,"participants":["Kevin Ballard","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"81318","messageId":"DF091369-1771-4405-8705-BDBC59C7E48A@sb.org","threadId":"14169","inReplyTo":null,"subject":"commit 'git-send-email: add support for TLS via Net::SMTP::SSL' causes warnings","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-06-26T20:19:51Z","receivedAt":"2008-06-26T20:19:51Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"Your recent commit to next (f6bebd1) causes warnings when no form of  \nencryption is specified. Specifically, lines 755 and 765 reference  \n$smtp_encryption, but when no encryption is given at all this variable  \nis undefined.\n\n-Kevin Ballard\n\n-- \nKevin Ballard\nhttp://kevin.sb.org\nkevin@sb.org\nhttp://www.tildesoft.com\n"},{"id":"81320","messageId":"1214512599-88902-1-git-send-email-kevin@sb.org","threadId":"14169","inReplyTo":"DF091369-1771-4405-8705-BDBC59C7E48A@sb.org","subject":"[PATCH] git-send-email: Fix warning triggered by f6bebd12 when no encryption is set","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-06-26T20:36:39Z","receivedAt":"2008-06-26T20:36:39Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"---\n git-send-email.perl |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 60a6551..b93cd40 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -299,6 +299,8 @@ sub read_config {\n \t\t\t$smtp_encryption = $enc;\n \t\t} elsif (Git::config_bool(@repo, \"$prefix.smtpssl\")) {\n \t\t\t$smtp_encryption = 'ssl';\n+\t\t} else {\n+\t\t\t$smtp_encryption = '';\n \t\t}\n \t}\n }\n-- \n1.5.6.1.180.g7b731\n"},{"id":"81323","messageId":"200806262248.02866.trast@student.ethz.ch","threadId":"14169","inReplyTo":"DF091369-1771-4405-8705-BDBC59C7E48A@sb.org","subject":"Re: commit 'git-send-email: add support for TLS via Net::SMTP::SSL' causes warnings","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-06-26T20:48:00Z","receivedAt":"2008-06-26T20:48:00Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Kevin Ballard wrote:\n> Your recent commit to next (f6bebd1) causes warnings when no form of  \n> encryption is specified. Specifically, lines 755 and 765 reference  \n> $smtp_encryption, but when no encryption is given at all this variable  \n> is undefined.\n\nSorry for the oversight on my part, and thanks for the fix! :-)\n\n- Thomas\n\n-- \nThomas Rast\ntrast@student.ethz.ch\n\n"},{"id":"81325","messageId":"200806262303.23269.trast@student.ethz.ch","threadId":"14169","inReplyTo":"200806262248.02866.trast@student.ethz.ch","subject":"Re: commit 'git-send-email: add support for TLS via Net::SMTP::SSL' causes warnings","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-06-26T21:03:21Z","receivedAt":"2008-06-26T21:03:21Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"I wrote:\n> \n> and thanks for the fix\n\nWell, actually at second glance your fix is wrong.  Putting it in\nread_config() means it will be executed the first time around already,\nwhen we read the identity's settings.  So with the patch,\n$smtp_encryption is set to '' during identity parsing, and any value\nset in the global [sendemail] section never takes effect.\n\nLet's do the following instead.  Sorry for all the noise.\n\n-- 8< --\ngit-send-email: prevent undefined variable warnings if no encryption is set\n\nWith the previous patch, not configuring any encryption (either on or\noff) would leave $smtp_encryption undefined.  We simply set it to the\nempty string in that case.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n git-send-email.perl |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 7630720..edb12c2 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -313,6 +313,9 @@ foreach my $setting (values %config_bool_settings) {\n \t${$setting->[0]} = $setting->[1] unless (defined (${$setting->[0]}));\n }\n \n+# 'default' encryption is none -- this only prevents a warning\n+$smtp_encryption = '' unless (defined $smtp_encryption);\n+\n # Set CC suppressions\n my(%suppress_cc);\n if (@suppress_cc) {\n-- \n1.5.6.1.187.g35a8\n"}]}