Improve registrar/url interaction. Fix SMTP URLs to comply to draft-earhart-url…
…-smtp-00. Minor fix in maidag (url mode). * include/mailutils/registrar.h (MU_RECORD_DEFAULT) (MU_RECORD_LOCAL): New flags. (_mu_record) <flags,url_may_have,url_must_have>: New members. Remove unnecessary externs. (mu_record_set_.*): Remove all protos. (mu_record_check_url, mu_registrar_test_local_url): New protos. * include/mailutils/sys/url.h (_mu_url) <flags>: New member. (MU_URL_USER, MU_URL_SECRET, MU_URL_AUTH) (MU_URL_HOST, MU_URL_PORT, MU_URL_PATH) (MU_URL_PARAM, MU_URL_QUERY) (MU_URL_CRED, MU_URL_INET, MU_URL_ALL): New flags. (mu_url_get_flags, mu_url_has_flag): New protos. * libmailutils/base/registrar.c (mu_record_set_.*): Remove all. (mu_record_check_url): New function. (mu_registrar_test_local_url): New function. * libmailutils/base/url.c (mu_url_copy0): Copy flags. (mu_url_parse): Use flags intead of inspecting each structure member. Set flags. (mu_url_get_flags, mu_url_has_flag): New functions. * libmailutils/diag/errors (MU_ERR_URL_MISS_PARTS) (MU_ERR_URL_EXTRA_PARTS): New error codes. * libmailutils/mailbox/folder.c (mu_folder_create_from_record): Check the URL using mu_record_check_url. * libproto/imap/folder.c (_imap_record, _imaps_record): Initialize new fields. * libproto/maildir/folder.c (_maildir_record): Likewise. * libproto/mbox/folder.c (_mbox_record): Likewise. * libproto/mh/folder.c (_mh_record): Likewise. * libproto/nntp/folder.c (_nntp_record): Likewise. * libproto/pop/folder.c (_pop_record, _pops_record): Likewise. * libproto/mailer/prog.c (_prog_record): Likewise. (_url_prog_init): Remove extra checks, rely on mu_record_check_url. * libproto/mailer/remote.c (_mu_remote_smtp_record) (_mu_remote_sendmail_record,_mu_remote_prog_record): Initialize new fields. * libproto/mailer/sendmail.c (_url_sendmail_init): Remove extra checks, rely on mu_record_check_url. (_sendmail_record): Initialize new fields. * libproto/nntp/url.c (url_nntp_destroy): Remove. (_nntp_url_init): Remove extra checks. * libproto/pop/url.c (url_pop_destroy): Remove. (_url_pop_init, _url_pops_init): Remove extra checks. * libproto/mailer/smtp.c (_url_smtp_init): Remove extra checks. (_smtp_record): Initialize new fields. (smtp_mailer_add_auth_mech): New function. (smtp_open): Allow for auth= part before the host name. * maidag/deliver.c (is_remote_url): New function. (do_delivery): Do not try to switch user privileges if the URL refers to a remote mailbox. * maidag/maidag.c (main): Initialize TLS.
Showing
21 changed files
with
238 additions
and
223 deletions
-
Please register or sign in to post a comment