@@ -305,16 +305,18 @@ func (m *Manager) Update(id int, inbox imodels.Inbox) (imodels.Inbox, error) {
305305 switch current .Channel {
306306 case "email" :
307307 var currentCfg struct {
308- AuthType string `json:"auth_type"`
309- OAuth map [string ]string `json:"oauth"`
310- IMAP []map [string ]interface {} `json:"imap"`
311- SMTP []map [string ]interface {} `json:"smtp"`
308+ AuthType string `json:"auth_type"`
309+ OAuth map [string ]string `json:"oauth"`
310+ IMAP []map [string ]any `json:"imap"`
311+ SMTP []map [string ]any `json:"smtp"`
312+ EnablePlusAddressing bool `json:"enable_plus_addressing"`
312313 }
313314 var updateCfg struct {
314- AuthType string `json:"auth_type"`
315- OAuth map [string ]string `json:"oauth"`
316- IMAP []map [string ]interface {} `json:"imap"`
317- SMTP []map [string ]interface {} `json:"smtp"`
315+ AuthType string `json:"auth_type"`
316+ OAuth map [string ]string `json:"oauth"`
317+ IMAP []map [string ]any `json:"imap"`
318+ SMTP []map [string ]any `json:"smtp"`
319+ EnablePlusAddressing bool `json:"enable_plus_addressing"`
318320 }
319321
320322 if err := json .Unmarshal (current .Config , & currentCfg ); err != nil {
@@ -496,15 +498,15 @@ func (m *Manager) encryptInboxConfig(config json.RawMessage) (json.RawMessage, e
496498 return config , nil
497499 }
498500
499- var cfg map [string ]interface {}
501+ var cfg map [string ]any
500502 if err := json .Unmarshal (config , & cfg ); err != nil {
501503 return nil , fmt .Errorf ("unmarshalling config: %w" , err )
502504 }
503505
504506 // Encrypt SMTP passwords
505- if smtpSlice , ok := cfg ["smtp" ].([]interface {} ); ok {
507+ if smtpSlice , ok := cfg ["smtp" ].([]any ); ok {
506508 for i , smtpItem := range smtpSlice {
507- if smtpMap , ok := smtpItem .(map [string ]interface {} ); ok {
509+ if smtpMap , ok := smtpItem .(map [string ]any ); ok {
508510 if password , ok := smtpMap ["password" ].(string ); ok && password != "" {
509511 encrypted , err := crypto .Encrypt (password , m .encryptionKey )
510512 if err != nil {
@@ -517,9 +519,9 @@ func (m *Manager) encryptInboxConfig(config json.RawMessage) (json.RawMessage, e
517519 }
518520
519521 // Encrypt IMAP passwords
520- if imapSlice , ok := cfg ["imap" ].([]interface {} ); ok {
522+ if imapSlice , ok := cfg ["imap" ].([]any ); ok {
521523 for i , imapItem := range imapSlice {
522- if imapMap , ok := imapItem .(map [string ]interface {} ); ok {
524+ if imapMap , ok := imapItem .(map [string ]any ); ok {
523525 if password , ok := imapMap ["password" ].(string ); ok && password != "" {
524526 encrypted , err := crypto .Encrypt (password , m .encryptionKey )
525527 if err != nil {
@@ -532,7 +534,7 @@ func (m *Manager) encryptInboxConfig(config json.RawMessage) (json.RawMessage, e
532534 }
533535
534536 // Encrypt OAuth fields if present
535- if oauthMap , ok := cfg ["oauth" ].(map [string ]interface {} ); ok {
537+ if oauthMap , ok := cfg ["oauth" ].(map [string ]any ); ok {
536538 fields := []string {"client_secret" , "access_token" , "refresh_token" }
537539 for _ , fieldName := range fields {
538540 if fieldValue , ok := oauthMap [fieldName ].(string ); ok && fieldValue != "" {
@@ -559,15 +561,15 @@ func (m *Manager) decryptInboxConfig(config json.RawMessage) (json.RawMessage, e
559561 return config , nil
560562 }
561563
562- var cfg map [string ]interface {}
564+ var cfg map [string ]any
563565 if err := json .Unmarshal (config , & cfg ); err != nil {
564566 return nil , fmt .Errorf ("unmarshalling config: %w" , err )
565567 }
566568
567569 // Decrypt SMTP passwords
568- if smtpSlice , ok := cfg ["smtp" ].([]interface {} ); ok {
570+ if smtpSlice , ok := cfg ["smtp" ].([]any ); ok {
569571 for i , smtpItem := range smtpSlice {
570- if smtpMap , ok := smtpItem .(map [string ]interface {} ); ok {
572+ if smtpMap , ok := smtpItem .(map [string ]any ); ok {
571573 if password , ok := smtpMap ["password" ].(string ); ok && password != "" {
572574 decrypted , err := crypto .Decrypt (password , m .encryptionKey )
573575 if err != nil {
@@ -580,9 +582,9 @@ func (m *Manager) decryptInboxConfig(config json.RawMessage) (json.RawMessage, e
580582 }
581583
582584 // Decrypt IMAP passwords
583- if imapSlice , ok := cfg ["imap" ].([]interface {} ); ok {
585+ if imapSlice , ok := cfg ["imap" ].([]any ); ok {
584586 for i , imapItem := range imapSlice {
585- if imapMap , ok := imapItem .(map [string ]interface {} ); ok {
587+ if imapMap , ok := imapItem .(map [string ]any ); ok {
586588 if password , ok := imapMap ["password" ].(string ); ok && password != "" {
587589 decrypted , err := crypto .Decrypt (password , m .encryptionKey )
588590 if err != nil {
@@ -595,7 +597,7 @@ func (m *Manager) decryptInboxConfig(config json.RawMessage) (json.RawMessage, e
595597 }
596598
597599 // Decrypt OAuth fields if present
598- if oauthMap , ok := cfg ["oauth" ].(map [string ]interface {} ); ok {
600+ if oauthMap , ok := cfg ["oauth" ].(map [string ]any ); ok {
599601 fields := []string {"client_secret" , "access_token" , "refresh_token" }
600602 for _ , fieldName := range fields {
601603 if fieldValue , ok := oauthMap [fieldName ].(string ); ok && fieldValue != "" {
0 commit comments