@@ -83,10 +83,10 @@ fn parse_xml(in_emailaddr: &str, xml_raw: &str) -> Result<LoginParam, Error> {
83
83
buf. clear ( ) ;
84
84
}
85
85
86
- if moz_ac. out . mail_server . is_empty ( )
87
- || moz_ac. out . mail_port == 0
88
- || moz_ac. out . send_server . is_empty ( )
89
- || moz_ac. out . send_port == 0
86
+ if moz_ac. out . imap . server . is_empty ( )
87
+ || moz_ac. out . imap . port == 0
88
+ || moz_ac. out . smtp . server . is_empty ( )
89
+ || moz_ac. out . smtp . port == 0
90
90
{
91
91
Err ( Error :: IncompleteAutoconfig ( moz_ac. out ) )
92
92
} else {
@@ -130,37 +130,37 @@ fn moz_autoconfigure_text_cb<B: std::io::BufRead>(
130
130
131
131
match moz_ac. tag_server {
132
132
MozServer :: Imap => match moz_ac. tag_config {
133
- MozConfigTag :: Hostname => moz_ac. out . mail_server = val,
134
- MozConfigTag :: Port => moz_ac. out . mail_port = val. parse ( ) . unwrap_or_default ( ) ,
135
- MozConfigTag :: Username => moz_ac. out . mail_user = val,
133
+ MozConfigTag :: Hostname => moz_ac. out . imap . server = val,
134
+ MozConfigTag :: Port => moz_ac. out . imap . port = val. parse ( ) . unwrap_or_default ( ) ,
135
+ MozConfigTag :: Username => moz_ac. out . imap . user = val,
136
136
MozConfigTag :: Sockettype => {
137
137
let val_lower = val. to_lowercase ( ) ;
138
138
if val_lower == "ssl" {
139
- moz_ac. out . mail_security = Socket :: SSL ;
139
+ moz_ac. out . imap . security = Socket :: SSL ;
140
140
}
141
141
if val_lower == "starttls" {
142
- moz_ac. out . mail_security = Socket :: STARTTLS ;
142
+ moz_ac. out . imap . security = Socket :: STARTTLS ;
143
143
}
144
144
if val_lower == "plain" {
145
- moz_ac. out . mail_security = Socket :: Plain ;
145
+ moz_ac. out . imap . security = Socket :: Plain ;
146
146
}
147
147
}
148
148
_ => { }
149
149
} ,
150
150
MozServer :: Smtp => match moz_ac. tag_config {
151
- MozConfigTag :: Hostname => moz_ac. out . send_server = val,
152
- MozConfigTag :: Port => moz_ac. out . send_port = val. parse ( ) . unwrap_or_default ( ) ,
153
- MozConfigTag :: Username => moz_ac. out . send_user = val,
151
+ MozConfigTag :: Hostname => moz_ac. out . smtp . server = val,
152
+ MozConfigTag :: Port => moz_ac. out . smtp . port = val. parse ( ) . unwrap_or_default ( ) ,
153
+ MozConfigTag :: Username => moz_ac. out . smtp . user = val,
154
154
MozConfigTag :: Sockettype => {
155
155
let val_lower = val. to_lowercase ( ) ;
156
156
if val_lower == "ssl" {
157
- moz_ac. out . send_security = Socket :: SSL ;
157
+ moz_ac. out . smtp . security = Socket :: SSL ;
158
158
}
159
159
if val_lower == "starttls" {
160
- moz_ac. out . send_security = Socket :: STARTTLS ;
160
+ moz_ac. out . smtp . security = Socket :: STARTTLS ;
161
161
}
162
162
if val_lower == "plain" {
163
- moz_ac. out . send_security = Socket :: Plain ;
163
+ moz_ac. out . smtp . security = Socket :: Plain ;
164
164
}
165
165
}
166
166
_ => { }
@@ -314,9 +314,9 @@ mod tests {
314
314
</webMail>
315
315
</clientConfig>" ;
316
316
let res =
parse_xml ( "[email protected] " , xml_raw
) . expect ( "XML parsing failed" ) ;
317
- assert_eq ! ( res. mail_server , "outlook.office365.com" ) ;
318
- assert_eq ! ( res. mail_port , 993 ) ;
319
- assert_eq ! ( res. send_server , "smtp.office365.com" ) ;
320
- assert_eq ! ( res. send_port , 587 ) ;
317
+ assert_eq ! ( res. imap . server , "outlook.office365.com" ) ;
318
+ assert_eq ! ( res. imap . port , 993 ) ;
319
+ assert_eq ! ( res. smtp . server , "smtp.office365.com" ) ;
320
+ assert_eq ! ( res. smtp . port , 587 ) ;
321
321
}
322
322
}
0 commit comments