Source
static int smtp_parse_mailbox(const char *mailbox, char *error, size_t max_error_len, zbx_vector_ptr_t *mailaddrs)
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/* number of characters per line when wrapping Base64 data in Email */
/* number of characters per "encoded-word" in RFC-2047 message header */
/* multiple 'encoded-word's should be separated by <CR><LF><SPACE> */
/* separator for multipart mixed messages */
extern char *CONFIG_SSL_CA_LOCATION;
/* SMTP security options */
/******************************************************************************
* *
* Purpose: Encode a string into a base64 string as required by rfc2047. *
* Used for encoding e-mail headers. *
* *
* Parameters: src - [IN] a null-terminated UTF-8 string to encode *
* p_base64 - [OUT] a pointer to the encoded string *
* *
* Comments: Based on the patch submitted by *
* Jairo Eduardo Lopez Fuentes Nacarino *
* *
******************************************************************************/
static void str_base64_encode_rfc2047(const char *src, char **p_base64)
{
const char *p0; /* pointer in src to start encoding from */
const char *p1; /* pointer in src: 1st byte of UTF-8 character */