X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/a39bd74d3e942db1b465cae643e1a4766ffb304e..e498ab40197936833f696439e78c5cb08e5180cb:/src/src/functions.h diff --git a/src/src/functions.h b/src/src/functions.h index 7195afa88..ebbdc55e2 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2014 */ +/* Copyright (c) University of Cambridge 1995 - 2016 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -39,21 +39,22 @@ extern uschar * tls_cert_subject(void *, uschar * mod); extern uschar * tls_cert_subject_altname(void *, uschar * mod); extern uschar * tls_cert_version(void *, uschar * mod); +extern uschar * tls_cert_der_b64(void * cert); extern uschar * tls_cert_fprt_md5(void *); extern uschar * tls_cert_fprt_sha1(void *); extern uschar * tls_cert_fprt_sha256(void *); extern int tls_client_start(int, host_item *, address_item *, transport_instance * -#ifdef EXPERIMENTAL_DANE +# ifdef EXPERIMENTAL_DANE , dns_answer * -#endif +# endif ); extern void tls_close(BOOL, BOOL); extern int tls_export_cert(uschar *, size_t, void *); extern int tls_feof(void); extern int tls_ferror(void); -extern void tls_free_cert(void *); +extern void tls_free_cert(void **); extern int tls_getc(void); extern int tls_import_cert(const uschar *, void **); extern int tls_read(BOOL, uschar *, size_t); @@ -70,7 +71,7 @@ extern uschar * tls_field_from_dn(uschar *, const uschar *); extern BOOL tls_is_name_for_cert(const uschar *, void *); # ifdef EXPERIMENTAL_DANE -extern int tlsa_lookup(const host_item *, dns_answer *, BOOL, BOOL *); +extern int tlsa_lookup(const host_item *, dns_answer *, BOOL); # endif #endif /*SUPPORT_TLS*/ @@ -84,8 +85,6 @@ extern int acl_eval(int, uschar *, uschar **, uschar **); extern tree_node *acl_var_create(uschar *); extern void acl_var_write(uschar *, uschar *, void *); -extern uschar *auth_b64encode(uschar *, int); -extern int auth_b64decode(uschar *, uschar **); extern int auth_call_pam(const uschar *, uschar **); extern int auth_call_pwcheck(uschar *, uschar **); extern int auth_call_radius(const uschar *, uschar **); @@ -99,11 +98,17 @@ extern int auth_get_no64_data(uschar **, uschar *); extern uschar *auth_xtextencode(uschar *, int); extern int auth_xtextdecode(uschar *, uschar **); +extern uschar *b64encode(uschar *, int); +extern int b64decode(uschar *, uschar **); +extern void bits_clear(unsigned int *, size_t, int *); +extern void bits_set(unsigned int *, size_t, int *); + extern void cancel_cutthrough_connection(const char *); extern int check_host(void *, const uschar *, const uschar **, uschar **); extern uschar **child_exec_exim(int, BOOL, int *, BOOL, int, ...); extern pid_t child_open_uid(const uschar **, const uschar **, int, uid_t *, gid_t *, int *, int *, uschar *, BOOL); +extern BOOL cleanup_environment(void); extern uschar *cutthrough_finaldot(void); extern BOOL cutthrough_flush_send(void); extern BOOL cutthrough_headers_send(void); @@ -118,13 +123,14 @@ extern int dcc_process(uschar **); #endif extern void debug_logging_activate(uschar *, uschar *); +extern void debug_logging_stop(void); extern void debug_print_argv(const uschar **); extern void debug_print_ids(uschar *); extern void debug_print_string(uschar *); extern void debug_print_tree(tree_node *); extern void debug_vprintf(const char *, va_list); -extern void decode_bits(unsigned int *, unsigned int *, - int, int, uschar *, bit_table *, int, uschar *, int); +extern void decode_bits(unsigned int *, size_t, int *, + uschar *, bit_table *, int, uschar *, int); extern address_item *deliver_make_addr(uschar *, BOOL); extern void deliver_init(void); extern void delivery_log(int, address_item *, int, uschar *); @@ -136,9 +142,6 @@ extern void deliver_succeeded(address_item *); extern uschar *deliver_get_sender_address (uschar *id); -#ifdef WITH_OLD_DEMIME -extern int demime(uschar **); -#endif extern BOOL directory_make(const uschar *, const uschar *, int, BOOL); #ifndef DISABLE_DKIM extern BOOL dkim_transport_write_message(address_item *, int, int, @@ -149,6 +152,7 @@ extern dns_address *dns_address_from_rr(dns_answer *, dns_record *); extern int dns_basic_lookup(dns_answer *, const uschar *, int); extern void dns_build_reverse(const uschar *, uschar *); extern void dns_init(BOOL, BOOL, BOOL); +extern BOOL dns_is_aa(const dns_answer *); extern BOOL dns_is_secure(const dns_answer *); extern int dns_lookup(dns_answer *, const uschar *, int, const uschar **); extern void dns_pattern_init(void); @@ -159,10 +163,13 @@ extern void dscp_list_to_stream(FILE *); extern BOOL dscp_lookup(const uschar *, int, int *, int *, int *); extern void enq_end(uschar *); -extern BOOL enq_start(uschar *); -#ifdef EXPERIMENTAL_EVENT +extern BOOL enq_start(uschar *, unsigned); +#ifndef DISABLE_EVENT extern uschar *event_raise(uschar *, const uschar *, uschar *); +extern void msg_event_raise(const uschar *, const address_item *); #endif +extern uschar ehlo_response(uschar *, size_t, uschar); +extern const uschar * exim_errstr(int); extern void exim_exit(int); extern void exim_nullstd(void); extern void exim_setugid(uid_t, gid_t, BOOL, uschar *); @@ -174,6 +181,7 @@ extern int exp_bool(address_item *addr, extern BOOL expand_check_condition(uschar *, uschar *, uschar *); extern uschar *expand_string(uschar *); /* public, cannot make const */ extern const uschar *expand_cstring(const uschar *); /* ... so use this one */ +extern uschar *expand_hide_passwords(uschar * ); extern uschar *expand_string_copy(const uschar *); extern int_eximarith_t expand_string_integer(uschar *, BOOL); extern void modify_variable(uschar *, void *); @@ -197,9 +205,10 @@ extern void host_build_hostlist(host_item **, const uschar *, BOOL); extern ip_address_item *host_build_ifacelist(const uschar *, uschar *); extern void host_build_log_info(void); extern void host_build_sender_fullhost(void); -extern BOOL host_find_byname(host_item *, const uschar *, int, const uschar **, BOOL); +extern BOOL host_find_byname(host_item *, const uschar *, int, + const uschar **, BOOL); extern int host_find_bydns(host_item *, const uschar *, int, uschar *, uschar *, - uschar *, uschar *, uschar *, const uschar **, BOOL *); + uschar *, const dnssec_domains *, const uschar **, BOOL *); extern ip_address_item *host_find_interfaces(void); extern BOOL host_is_in_net(const uschar *, const uschar *, int); extern BOOL host_is_tls_on_connect_port(int); @@ -210,6 +219,9 @@ extern int host_nmtoa(int, int *, int, uschar *, int); extern uschar *host_ntoa(int, const void *, uschar *, int *); extern int host_scan_for_local_hosts(host_item *, host_item **, BOOL *); +extern uschar *imap_utf7_encode(uschar *, const uschar *, + uschar, uschar *, uschar **); + extern void invert_address(uschar *, uschar *); extern int ip_addr(void *, int, const uschar *, int); extern int ip_bind(int, int, uschar *, int); @@ -225,6 +237,8 @@ extern int ip_tcpsocket(const uschar *, uschar **, int); extern int ip_unixsocket(const uschar *, uschar **); extern int ip_streamsocket(const uschar *, uschar **, int); +extern int ipv6_nmtoa(int *, uschar *); + extern uschar *local_part_quote(uschar *); extern int log_create(uschar *); extern int log_create_as_exim(uschar *); @@ -253,7 +267,9 @@ struct mime_boundary_context; extern int mime_acl_check(uschar *acl, FILE *f, struct mime_boundary_context *, uschar **, uschar **); extern int mime_decode(const uschar **); +extern ssize_t mime_decode_base64(FILE *, FILE *, uschar *); extern int mime_regex(const uschar **); +extern void mime_set_anomaly(int); #endif extern uschar *moan_check_errorcopy(uschar *); extern BOOL moan_skipped_syntax_errors(uschar *, error_block *, uschar *, @@ -265,7 +281,7 @@ extern BOOL moan_to_sender(int, error_block *, header_line *, FILE *, BOOL); extern void moan_write_from(FILE *); extern FILE *modefopen(const uschar *, const char *, mode_t); -extern void open_cutthrough_connection( address_item * addr ); +extern int open_cutthrough_connection( address_item * addr ); extern uschar *parse_extract_address(uschar *, uschar **, int *, int *, int *, BOOL); @@ -297,13 +313,14 @@ extern BOOL readconf_depends(driver_instance *, uschar *); extern void readconf_driver_init(uschar *, driver_instance **, driver_info *, int, void *, int, optionlist *, int); extern uschar *readconf_find_option(void *); -extern void readconf_main(void); -extern void readconf_print(uschar *, uschar *, BOOL); +extern void readconf_main(BOOL); +extern void readconf_print(uschar *, uschar *, BOOL no_labels); extern uschar *readconf_printtime(int); extern uschar *readconf_readname(uschar *, int, uschar *); extern int readconf_readtime(const uschar *, int, BOOL); -extern void readconf_rest(); +extern void readconf_rest(void); extern uschar *readconf_retry_error(const uschar *, const uschar *, int *, int *); +extern void readconf_save_config(const uschar *); extern void read_message_body(BOOL); extern void receive_bomb_out(uschar *, uschar *); extern BOOL receive_check_fs(int); @@ -354,9 +371,9 @@ extern int search_findtype_partial(const uschar *, int *, const uschar **, i extern void *search_open(uschar *, int, int, uid_t *, gid_t *); extern void search_tidyup(void); extern void set_process_info(const char *, ...) PRINTF_FUNCTION(1,2); -extern void sha1_end(sha1 *, const uschar *, int, uschar *); -extern void sha1_mid(sha1 *, const uschar *); -extern void sha1_start(sha1 *); +extern void sha1_end(hctx *, const uschar *, int, uschar *); +extern void sha1_mid(hctx *, const uschar *); +extern void sha1_start(hctx *); extern int sieve_interpret(uschar *, int, uschar *, uschar *, uschar *, uschar *, address_item **, uschar **); extern void sigalrm_handler(int); @@ -369,13 +386,13 @@ extern int smtp_sock_connect(host_item *, int, int, uschar *, extern int smtp_feof(void); extern int smtp_ferror(void); extern uschar *smtp_get_connection_info(void); -extern BOOL smtp_get_interface(uschar *, int, address_item *, BOOL *, +extern BOOL smtp_get_interface(uschar *, int, address_item *, uschar **, uschar *); extern BOOL smtp_get_port(uschar *, address_item *, int *, uschar *); extern int smtp_getc(void); extern int smtp_handle_acl_fail(int, int, uschar *, uschar *); extern void smtp_log_no_mail(void); -extern void smtp_message_code(uschar **, int *, uschar **, uschar **); +extern void smtp_message_code(uschar **, int *, uschar **, uschar **, BOOL); extern BOOL smtp_read_response(smtp_inblock *, uschar *, int, int, int); extern void smtp_respond(uschar *, int, BOOL, uschar *); extern void smtp_notquit_exit(uschar *, uschar *, uschar *, ...); @@ -390,7 +407,9 @@ extern int spam(const uschar **); extern FILE *spool_mbox(unsigned long *, const uschar *); #endif extern BOOL spool_move_message(uschar *, uschar *, uschar *, uschar *); -extern BOOL spool_open_datafile(uschar *); +extern uschar *spool_fname(const uschar *, uschar *, uschar *, uschar *); +extern uschar *spool_sname(const uschar *, uschar *); +extern int spool_open_datafile(uschar *); extern int spool_open_temp(uschar *); extern int spool_read_header(uschar *, BOOL, BOOL); extern int spool_write_header(uschar *, int, uschar **); @@ -402,7 +421,9 @@ extern uschar *string_append(uschar *, int *, int *, int, ...); extern uschar *string_append_listele(uschar *, uschar, const uschar *); extern uschar *string_append_listele_n(uschar *, uschar, const uschar *, unsigned); extern uschar *string_base62(unsigned long int); -extern uschar *string_cat(uschar *, int *, int *, const uschar *, int); +extern uschar *string_cat(uschar *, int *, int *, const uschar *); +extern uschar *string_catn(uschar *, int *, int *, const uschar *, int); +extern int string_compare_by_pointer(const void *, const void *); extern uschar *string_copy_dnsdomain(uschar *); extern uschar *string_copy_malloc(const uschar *); extern uschar *string_copylc(const uschar *); @@ -412,12 +433,22 @@ extern BOOL string_format(uschar *, int, const char *, ...) ALMOST_PRINTF(3,4 extern uschar *string_format_size(int, uschar *); extern int string_interpret_escape(const uschar **); extern int string_is_ip_address(const uschar *, int *); +#ifdef SUPPORT_I18N +extern BOOL string_is_utf8(const uschar *); +#endif extern uschar *string_log_address(address_item *, BOOL, BOOL); extern uschar *string_nextinlist(const uschar **, int *, uschar *, int); extern uschar *string_open_failed(int, const char *, ...) PRINTF_FUNCTION(2,3); extern const uschar *string_printing2(const uschar *, BOOL); extern uschar *string_split_message(uschar *); extern uschar *string_unprinting(uschar *); +#ifdef SUPPORT_I18N +extern uschar *string_address_utf8_to_alabel(const uschar *, uschar **); +extern uschar *string_domain_alabel_to_utf8(const uschar *, uschar **); +extern uschar *string_domain_utf8_to_alabel(const uschar *, uschar **); +extern uschar *string_localpart_alabel_to_utf8(const uschar *, uschar **); +extern uschar *string_localpart_utf8_to_alabel(const uschar *, uschar **); +#endif extern BOOL string_vformat(uschar *, int, const char *, va_list); extern int strcmpic(const uschar *, const uschar *); extern int strncmpic(const uschar *, const uschar *, int); @@ -452,10 +483,13 @@ extern void tree_walk(tree_node *, void (*)(uschar*, uschar*, void*), void *) #ifdef WITH_CONTENT_SCAN extern void unspool_mbox(void); #endif +#ifdef SUPPORT_I18N +extern void utf8_version_report(FILE *); +#endif extern int verify_address(address_item *, FILE *, int, int, int, int, uschar *, uschar *, BOOL *); -extern int verify_check_dnsbl(const uschar **); +extern int verify_check_dnsbl(int, const uschar **, uschar **); extern int verify_check_header_address(uschar **, uschar **, int, int, int, uschar *, uschar *, int, int *); extern int verify_check_headers(uschar **);