aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fix: must init raw pointer *bodyPartHEADmastersaturneric2024-12-011-1/+1
|
* feat: remember boundary from parsingsaturneric2024-11-282-5/+9
|
* Fix a test failure in pathTest::testGenerate (#312)Jan Engelhardt2024-06-112-38/+11
| | | | | | | | | | | | | | | * Fix a test failure in testNewFromString Fixes an oversight in d296c2d1. * Fix a test failure in pathTest::testGenerate Partially revert v0.9.2-183-g9b65b4de. As per RFC 5322 §3.4.1, an email address must always have a @. As per RFC 5321 §4.1.2, a path is similar to an email address (always @), with "" (<>) being the only other special value. Fixes #294, #301.
* contrib: update utfcpp to v4.0.5 (#309)Jan Engelhardt2024-06-111-1/+1
| | | | Download a new version from https://github.com/nemtrif/utfcpp/ which explicitly supports C++17.
* build: resolve a -Wunused-function compiler warning (#308)Jan Engelhardt2024-06-111-2/+8
| | | | | | | | | posixSocket.cpp:67:7: warning: ‘char* {anonymous}::vmime_strerror_r_result(int, char*)’ defined but not used [-Wunused-function] 67 | char* vmime_strerror_r_result(int /* res */, char* buf) { It is to be expected that one of the two r_result functions is going unused, depending on whichever platform we are currently building on.
* asciiPercent computation: another potential multiplication overflow (#307)Jan Engelhardt2024-05-212-7/+5
| | | | | | | | | | | | | | | | | | | | | | | * build: resolve a -Wconversion compiler warning wordEncoder.cpp:312:91: warning: conversion from ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} to ‘double’ may change value [-Wconversion] 312 | buffer.length() == 0 ? 1 : static_cast<double>(asciiCount) / buffer.length(); | ~~~~~~~~~~~~~^~ * wordEncoder: replace value 100 for asciiPercent asciiPercent is a ratio, and not counting in units of hundredths anymore. The maximum value therefore should be 1 not 100. * vmime: avoid integer multiply wraparound in text::createFromString The change from commit v0.9.2-194-gb447adbe needs to be applied to one more function that replicates the same code. (If the input string is 42949673 characters long or larger, there will be integer overflow on 32-bit platforms when multiplying by 100. Switch that one computation to floating point.)
* vmime: prevent loss of a space during text::createFromString (#306)Jan Engelhardt2024-05-212-61/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` mailbox(text("Test München West", charsets::UTF_8), "[email protected]").generate(); ``` produces ``` =?us-ascii?Q?Test_?= =?utf-8?Q?M=C3=BCnchen?= =?us-ascii?Q?West?= <[email protected]> ``` The first space between ``Test`` and ``München`` is encoded as an underscore along with the first word: ``Test_``. The second space between ``München`` and ``West`` is encoded with neither of the two words and thus lost. Decoding the text results in ``Test MünchenWest`` instead of ``Test München West``. This is caused by how ``vmime::text::createFromString()`` handles transitions between 7-bit and 8-bit words: If an 8-bit word follows a 7-bit word, a space is appended to the previous word. The opposite case of a 7-bit word following an 8-bit word *misses* this behaviour. When one fixes this problem, a follow-up issue appears: ``text::createFromString("a b\xFFc d")`` tokenizes the input into ``m_words={word("a "), word("b\xFFc ", utf8), word("d")}``. This "right-side alignment" nature of the whitespace is a problem for word::generate(): As per RFC 2047, spaces between adjacent encoded words are just separators but not meant to be displayed. A space between an encoded word and a regular ASCII text is not just a separator but also meant to be displayed. When word::generate() outputs the b-word, it would have to strip one space, but only when there is a transition from encoded-word to unencoded word. word::generate() does not know whether d will be encoded or unencoded. The idea now is that we could change the tokenization of ``text::createFromString`` such that whitespace is at the *start* of words rather than at the end. With that, word::generate() need not know anything about the next word, but rather only the *previous* one. Thus, in this patch, 1. The tokenization of ``text::createFromString`` is changed to left-align spaces and the function is fixed to account for the missing space on transition. 2. ``word::generate`` learns how to steal a space character. 3. Testcases are adjusted to account for the shifted position of the space. Fixes: #283, #284 Co-authored-by: Vincent Richard <[email protected]>
* Fixes/comments for guessBestEncoding (#304)Jan Engelhardt2024-05-211-4/+6
| | | | | | | | | | | * tests: add case for getRecommendedEncoding * vmime: avoid integer multiply wraparound in wordEncoder::guessBestEncoding If the input string is 42949673 characters long or larger, there will be integer overflow on 32-bit platforms when multiplying by 100. Switch that one computation to floating point. * vmime: update comment in wordEncoder::guessBestEncoding
* vmime: avoid changing SEVEN_BIT when encoding::decideImpl sees U+007F (#303)Jan Engelhardt2024-05-211-1/+1
| | | | | | | | | | * vmime: avoid changing SEVEN_BIT when encoding::decideImpl sees U+007F Do not switch to QP/B64 when encountering U+007F. U+007F is part of ASCII just as much as U+0001 is. --------- Co-authored-by: Vincent Richard <[email protected]>
* Resolve compiler warnings (#302)Jan Engelhardt2024-05-214-23/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * build: replace class noncopyable by C++11 deleted function declaration C++11 is mandatory since commit v0.9.2-48-g8564b2f8, therefore we can exercise the =delete keyword in class declarations to prohibit copying. * build: resolve -Woverloaded-virtual warnings context.hpp:109:26: warning: "virtual vmime::context& vmime::context::operator=(const vmime::context&)’ was hidden [-Woverloaded-virtual=] 109 | virtual context& operator=(const context& ctx); | ^~~~~~~~ generationContext.hpp:153:28: note: by ‘vmime::generationContext& vmime::generationContext::operator=(const vmime::generationContext&)’ 153 | generationContext& operator=(const generationContext& ctx); | ^~~~~~~~ AFAICS, there is no point in having "virtual" on an assignment operator. Any derived classes' operator= has different signature anyway. It is also the only class with a virtual operator=, so that's an indicator for oddness as well. * build: resolve -Wdeprecated-declarations warnings encoding.cpp: In static member function "static const vmime::encoding vmime::encoding::decideImpl(std::__cxx11::basic_string<char>::const_iterator, std::__cxx11::basic_string<char>::const_iterator)": encoding.cpp:161:29: warning: "std::binder2nd<_Operation> std::bind2nd(const _Operation&, const _Tp&) [with _Operation = less<unsigned char>; _Tp = int]" is deprecated: use "std::bind" instead [-Wdeprecated-declarations] 161 | std::bind2nd(std::less<unsigned char>(), 127) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++11 is mandatory, so just use a lambda already.
* Fix OpenSSL initialization #299 (#300)Ján Osuský2024-03-041-3/+11
|
* url: strip leading slash from url-path (#298)Jan Engelhardt2024-03-041-5/+12
|
* url: repair off-by-one bug in extractHost (#297)Jan Engelhardt2024-03-041-1/+1
| | | | | | `hostPart[len]` is pointing to `]`, but we need to check the char after that. Fixes: v0.9.2-187-g874a1d8c
* url: add remark to documentation about hardcoded // substring (#293)Jan Engelhardt2024-01-301-1/+4
|
* url: support IPv6 literals (RFC 2732) (#292)Jan Engelhardt2024-01-304-13/+75
|
* Fixed use of old API (#287).vincent-richard2024-01-011-1/+2
|
* Add parsing feedback via parsingContext (#280)bmagistro2023-12-3154-77/+112
| | | | | | | | | | * Add parsing feedback via parsingContext Changes the parsing context to be modifiable to be able to provide feedback on the parsing. This allows the user to check if header recovery was necessary, for example, while parsing the current message. Signed-off-by: Ben Magistro <[email protected]> Co-authored-by: Vincent Richard <[email protected]>
* Configurable email add domain (#287)bmagistro2023-12-314-12/+69
| | | | | | * Allow appending of local hostname to be configured via parsing context Signed-off-by: Ben Magistro <[email protected]> Co-authored-by: Vincent Richard <[email protected]>
* Avoid generating illegal Envelope-From with sendmail:// transport (#285)Jan Engelhardt2023-12-311-1/+1
| | | | | | When the ``sender`` function argument is the empty object, vmime would still attempt to use it at ``sender.getEmail().generate()``, but that produces just ``@``. As sendmail is called with ``-f @``, this shows up in postfix's logs as ``<""@>``.
* Build: add FreeBSD & libc++ compilation support (#288)Jan Engelhardt2023-12-312-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | * build: add FreeBSD compilation support * build: unbreak compilation with clang libc++ unary_function is obsolete with C++11 and removed in C++17. gnu-gcc-libstdc++ still has the class, but llvm-clang-libc++ does not, and there is a compile error. vmime should have just stopped using unary_function with commit v0.9.2-48-g8564b2f8. $ cat x.cpp $ clang++ -std=c++17 -stdlib=libc++ -c x.cpp In file included from x.cpp:1: In file included from /usr/local/include/vmime/net/transport.hpp:34: In file included from /usr/local/include/vmime/net/service.hpp:36: In file included from /usr/local/include/vmime/net/session.hpp:40: In file included from /usr/local/include/vmime/utility/url.hpp:30: /usr/local/include/vmime/propertySet.hpp:339:33: error: no template named /'unary_function' in namespace 'std'; did you mean '__unary_function'? class propFinder : public std::unary_function <shared_ptr <property>, bool> { ~~~~~^~~~~~~~~~~~~~ __unary_function
* Make default context thread_local (#286)bmagistro2023-12-312-3/+10
| | | | | | * Make default context thread_local Signed-off-by: Ben Magistro <[email protected]> Co-authored-by: Vincent Richard <[email protected]>
* Build: add Solaris compilation support (#282)Jan Engelhardt2023-11-091-0/+5
|
* Added utility function to convert byteArray to HEX string. Useful for ↵Frode Roxrud Gill2022-03-131-0/+15
| | | | printing fingerprint digests etc.
* Added support for digest algorithm SHA256Frode Roxrud Gill2022-03-133-3/+14
|
* Fixed possible recursion crash when parsing mailbox groups.vincent-richard2022-01-256-20/+39
|
* Fixed Cppcheck issues.Vincent Richard2021-11-252-5/+13
|
* #268 Code style fixes + moved specific bits to IMAP namespaceVincent Richard2021-11-2516-684/+787
|
* Implemented IMAP SEARCHJacek Piszczek2021-10-2913-10/+803
|
* fixed coding styleibanic2021-05-161-2/+4
|
* Prevent accessing empty bufferibanic2021-05-151-0/+4
|
* #261 Workaround for bad SEARCH response with AOL IMAP servervincent-richard2021-05-111-2/+12
|
* SMTP/DSN refactoring.vincent-richard2021-04-0313-66/+265
|
* Merge pull request #256 from jacadcaps/IMAP.PEEKVincent Richard2021-03-313-2/+8
|\ | | | | IMAP PEEK support.
| * IMAP PEEK supportJacek Piszczek2021-03-243-2/+8
| |
* | Merge pull request #258 from jacadcaps/processFetchResponseVincent Richard2021-03-311-0/+15
|\ \ | | | | | | Process Message-ID and In-Reply-To in ENVELOPE.
| * | Fixed buildJacek Piszczek2021-03-251-1/+4
| | |
| * | Added missing includesJacek Piszczek2021-03-241-0/+2
| | |
| * | Process Message-ID and In-Reply-To in EVELOPEJacek Piszczek2021-03-241-0/+10
| |/
* | Fixed parsing of IMAP astring.vincent-richard2021-03-241-88/+49
| |
* | Merge pull request #257 from jacadcaps/defaultCertificateVerifierVincent Richard2021-03-244-0/+118
|\ \ | | | | | | Improved certificate verification.
| * | Improved certificate verificationJacek Piszczek2021-03-244-0/+118
| |/
* | Merge pull request #255 from jacadcaps/weak_ptr-checksVincent Richard2021-03-247-23/+95
|\ \ | | | | | | Weak ptr checks + forced socket disconnections.
| * | CosmeticsJacek Piszczek2021-03-241-1/+1
| | |
| * | Ensure disconnect() method always disconnect the underlying sockets.Jacek Piszczek2021-03-247-24/+96
| |/ | | | | | | Added additional checks after weak pointer locks.
* | Merge pull request #253 from jacadcaps/MessageParserVincent Richard2021-03-161-1/+10
|\ \ | | | | | | Default missing Content-Type to text/plain.
| * | Default missing Content-Type to Text/Plain as per ↵Jacek Piszczek2021-03-161-1/+10
| |/ | | | | | | https://tools.ietf.org/html/rfc2045#section-5.2
* | Merge pull request #254 from jacadcaps/MessageParserDateVincent Richard2021-03-161-1/+7
|\ \ | | | | | | Workaround a RECEIVED message field missing actual date info.
| * | Workaround a RECEIVED message field missing actual date info.Jacek Piszczek2021-03-161-1/+7
| |/
* | Merge pull request #252 from jacadcaps/replyToVincent Richard2021-03-151-1/+1
|\ \ | | | | | | Fixed an ENVELOPE ReplyTo handling regression.
| * | Fixed an ENVELOPE ReplyTo handling regressionJacek Piszczek2021-03-151-1/+1
| |/