Skip to content

Rework authentication, server probing and the wizard

Albrecht Dreß requested to merge rework-auth into master

This patch aims at a unification of the mail (POP3, IMAP, SMTP) server configurations, adds the capability of server probing, and simplifies the initial server setup in the wizard. This includes preferring implicit TLS over STARTTLS (see issue #55 (closed)). This wizard tries to guess servers from DNS SRV records (RFC 6186) or from "typical" names derived from the email address.

  • libnetclient:
    • net-client.h: add auth modes enum (none; user/pass; Kerberos; more to come); add probing error code
    • net-client-utils.[ch]: define probe results struct; add helper functions net_client_host_reachable(), net_client_host_only(), net_client_auth_anonymous_token()
    • net-client-pop.[ch]: do not export POP auth modes; replace net_client_pop_allow_auth() by net_client_pop_set_auth_mode(); add net_client_pop_probe(); add SASL "ANONYMOUS" support
    • net-client-smtp.[hc]: do not export SMTP auth modes; replace net_client_smtp_allow_auth() by net_client_smtp_set_auth_mode(); add net_client_smtp_probe(); be more strict checking the RFC 5321 server response codes
    • README: update testing comments re. INetSim
  • libbalsa/imap:
    • imap_private.h: _ImapMboxHandle: add auth_mode, remove enable_anonymous
    • auth-cram.c, auth-gssapi.c: change "auth" signal value
    • imap-handle.[ch]: remove IMAP_OPT_ANONYMOUS; add imap_handle_set_auth_mode() and imap_server_probe()
    • imap-auth.c; rework authentication code; change "auth" signal value
    • imap_tst.c: use imap_handle_set_auth_mode() instead of imap_handle_set_option()
  • libbalsa:
    • imap-server.c: replace imap_handle_set_option() by imap_handle_set_auth_mode()
    • mailbox_pop3.c: replace net_client_pop_allow_auth() by net_client_pop_set_auth_mode()
    • smtp-server.c: set log domain to libbalsa-server
    • server.[ch]: implement libbalsa_server_[gs]et_auth_mode(); remove deprecated libbalsa_server_[gs]et_try_anonymous(); store auth mode in the config, clean deprecated keys; update libbalsa_server_get_auth() cb function; set log domain to libbalsa-server
    • server-config.c: refactor for auth modes; add probe button and callbacks
  • libinit_balsa:
    • assistant_page_server.[ch]: add wizard page for configuring the mail server based upon the best guess from the user's mail address
    • assistant_page_user.[ch]: remove all server-related settings
    • assistant_init.c: add new wizard page; fix extremely wide wizard pages
    • Makefile.am, meson.build: add server page sources

Signed-off-by: Albrecht Dreß albrecht.dress@netcologne.de

Merge request reports