summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--commands/compose/send.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/commands/compose/send.go b/commands/compose/send.go
index 356b0c7..2c2e294 100644
--- a/commands/compose/send.go
+++ b/commands/compose/send.go
@@ -93,8 +93,11 @@ func SendMessage(aerc *widgets.Aerc, args []string) error {
 		switch scheme {
 		case "smtp":
 			host := uri.Host
+			serverName := uri.Host
 			if !strings.ContainsRune(host, ':') {
 				host = host + ":587" // Default to submission port
+			} else {
+				serverName = host[:strings.IndexRune(host, ':')]
 			}
 			conn, err = smtp.Dial(host)
 			if err != nil {
@@ -108,7 +111,9 @@ func SendMessage(aerc *widgets.Aerc, args []string) error {
 						"Add smtp-starttls=yes")
 					return 0, err
 				}
-				if err = conn.StartTLS(&tls.Config{}); err != nil {
+				if err = conn.StartTLS(&tls.Config{
+					ServerName: serverName,
+				}); err != nil {
 					return 0, err
 				}
 			} else {
@@ -121,10 +126,15 @@ func SendMessage(aerc *widgets.Aerc, args []string) error {
 			}
 		case "smtps":
 			host := uri.Host
+			serverName := uri.Host
 			if !strings.ContainsRune(host, ':') {
 				host = host + ":465" // Default to smtps port
+			} else {
+				serverName = host[:strings.IndexRune(host, ':')]
 			}
-			conn, err = smtp.DialTLS(host, &tls.Config{})
+			conn, err = smtp.DialTLS(host, &tls.Config{
+				ServerName: serverName,
+			})
 			if err != nil {
 				return 0, err
 			}
b60999c ^

8126d82 ^
d394fd1 ^






8126d82 ^
d394fd1 ^
b60999c ^
8126d82 ^
b60999c ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50




                

                                 
                                          

 
                                                              
 
                                    
 




















                                                              

 
                                                                            






                                                        
                                               
                                     
         
                                     
 
+0100

Add some command line fixes, fix related bugs' href='/ahoang/chawan/commit/src/main.nim?id=0cdcb6b2646e6753b99e66a974040fc6d71d7dfd'>0cdcb6b2 ^




c73367b5 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
         

               

                      
 
             
                    
                   
 
            





                                           


                                                                             

                                                         

                                                                                  









                      
                      

                       



                           











                                                         

                                                     
               











                                                     

                     






                       

       
                  


                  




                                                      
                                            
0700
committer  Kartik Agaram <vc@akkartik.com>  2019-09-20 11:25:59 -0700

5683' href='/akkartik/mu/commit/html/084emit-hex-array.subx.html?h=main&id=4a4a392dc7c81b301ad6b760525c5549f2f6644c'>4a4a392d ^
8aeb85f0 ^
999c529c ^
ec73ed12 ^
999c529c ^

fa786ea7 ^
999c529c ^
9a777801 ^
999c529c ^



d3a9db3a ^
999c529c ^
ec73ed12 ^
999c529c ^



d3a9db3a ^
999c529c ^
ec73ed12 ^
999c529c ^

775f77c3 ^
999c529c ^



ec73ed12 ^
999c529c ^
ec73ed12 ^
999c529c ^







4a4a392d ^



1
2
3
4
5