             init = (field) ->
                 state[field] = ''
             init field for field in @_accountFields
-            state.smtpPort = 587
+            state.smtpPort = 465
+            state.smtpSSL  = true
+            state.smtpTLS  = false
             state.imapPort = 993
+            state.imapSSL  = true
+            state.imapTLS  = false
             state.newMailboxParent = null
             state.tab = null
 

                            valueLink: @linkState('smtpPort'),
                            type: 'text',
                            className: 'form-control'
                    getError 'smtpServer'
                    getError 'smtpPort'
                div className: 'form-group',

                    infos.imapPort   = '993'
                if not infos.smtpServer?
                    infos.smtpServer = ''
                    infos.smtpPort   = '465'
                switch infos.imapPort
                    when '993'
                        infos.imapSSL = true
                        infos.imapTLS = false
                    else
                        infos.imapSSL = false
                        infos.imapTLS = false
                switch infos.smtpPort
                    when '465'
                        infos.smtpSSL = true
                        infos.smtpTLS = false
                    when '587'
                        infos.smtpSSL = false
                        infos.smtpTLS = true
                    else
                        infos.smtpSSL = false
                        infos.smtpTLS = false
                @setState infos

    _onServerParam: (target, server, type) ->
        if (server is 'imap' and @state.imapManualPort) or
        (server is 'smtp' and @state.smtpManualPort)
            # port has been set manually, don't update it
            return
        if server is 'smtp'
            if type is 'ssl' and target.checked
                @setState smtpPort: 465
            else if type is 'tls' and target.checked
                @setState smtpPort: 587
        else
            if target.checked
                @setState imapPort: 993
            else
                @setState imapPort: 143

    _onIMAPPort: (ev) ->
        port = ev.target.value.trim()
        infos =
            imapPort: port
        switch port
            when '993'
                infos.imapSSL = true
                infos.imapTLS = false
            else
                infos.imapSSL = false
                infos.imapTLS = false
        @setState infos

    _onSMTPPort: (ev) ->
        port = ev.target.value.trim()
        infos = {}
        switch port
            when '465'
                infos.smtpSSL = true
                infos.smtpTLS = false
            when '587'
                infos.smtpSSL = false
                infos.smtpTLS = true
            else
                infos.smtpSSL = false
                infos.smtpTLS = false
        console.log port, infos
        @setState infos

    componentWillReceiveProps: (props) ->

        # prevents the form from changing during submission
        if not props.isWaiting
            # display the account values
