Blat Changelog

What's new in Blat 3.2.22

Jul 22, 2019
  • Added new command line options -msgid and -addch2bin. The -msgid option takes a string which will be used in the Message-ID: header instead of the string created by Blat. The string will work best when enclosed by quotation marks ("). This request came from Christophe Ross on SourceForge.net, for use in sending control messages. For example:
  • -msgid "ThisIsAUniqueMsgId"
  • Heiko Mück, also on SourceForge.net, requested the ability to add charset="utf-8" to the Content-Type: header for binary attachments. This request allows him to be certified with his recipient. It seems to me his recipient might be receiving a mixture of ASCII and UTF-8 files from different locations, and want some to force senders to use UTF-8 for binary attachments (XML files).

New in Blat 3.2.19 (Nov 20, 2017)

  • Added -MDN option that allows Blat to be used for sending Message. Disposition Notifications in response to incoming emails through a third party email client. Supported MDN types are defined in RFCs 2298, 3798, and 8098. The defined types are: displayed, dispatched, processed, deleted, denied, and failed. When -MDN option is used with any of these six values, the message headers will indicate "MDN-sent-automatically" along with the requested MDN type, as part of a multipart MIME message. This option will not work with attachments or embedded files.
  • When using -priority with a zero value, Blat will set message headers "Priority: non-urgent" and "Importance: low". Blat has for years set these message headers "Priority: normal" and "Importance: normal" whenever priority was defined to be zero. Nissl Reinhard indicated Microsoft Outlook 2013 has been treating Blat messages as normal priority instead of the intended low priority. This change should help Outlook 2013 identify low priority messages properly.

New in Blat 3.2.17 (Jul 31, 2017)

  • Fixed -profile option that could cause the program to crash when using an improperly initialized variable.

New in Blat 3.2.16 (Jul 31, 2017)

  • Added a feature to allow users to specify an attachment's content description. Someone in Europe requested special Content-Description: values for their project, so now users may give a content description with the -attach options by including the description between <> characters after the attachment filename. For example: -attacht "*.txt<NASCAR>" Filenames may not have < or > characters, which is why the program looks for these two characters to identify content descriptions. I must stress this is only for attachments.

New in Blat 3.2.15 (Jul 31, 2017)

  • Missed some edits that use the Buf class where earlier versions used _TCHA array.

New in Blat 3.2.14 (Jul 31, 2017)

  • Vishnu Raju reported a string overflow when processing the profile option, leading to a program crash. I changed the string processing so this cannot occur again.

New in Blat 3.2.13 (Jul 31, 2017)

  • If an error is encountered with the server, and the connection is closed by the server, do not attempt to continue sending commands. If try count is not exhausted, then attempt to reestablish a connection.

New in Blat 3.2.12 (Jan 21, 2016)

  • Added a new command line option -IMAF to Ignore Missing Attachment Files. If Blat is told to attach files to the outgoing message, and if the search criteria fails to find a file, Blat normally stops to allow the user to fix their problem with the requested attachment filename. This new option will tell Blat to continue with the process of sending the email even if the requested attachment filename cannot be found. Blat will still log a message that the requested filename was not found, but Blat will not stop when this option is used.
  • Corrected UTF-8 text conversion to Unicode. Some valid values were being flagged as invalid. This was found when saving a Chinese text file as Unicode and as UTF-8, then comparing the UTF-8 conversion to the original Unicode file saved from Notepad.
  • Correctly handle empty Unicode files that contain only the BOM.
  • Corrected the help text for IMAP UserID and IMAP Password.

New in Blat 3.2.11 (Dec 1, 2015)

  • Alain Loubert found a problem with processing a plain text file for the message body, resulting in a UTF-8 byte order marker (BOM) being sent as part of the message. I fixed this oversight and added more test cases to my validation batch file.

New in Blat 3.2.10 (Dec 1, 2015)

  • R Massey found a problem with processing a subject file that resulted in garbled subject text. This was exposed as a problem with the most recent changes, but there was a latent bug in the source code for a while which actually caused problems for R Massey

New in Blat 3.2.9 (Dec 1, 2015)

  • If the message body is from keyboard input, and if the user enters Ctrl-Z without anything else before it, then a carriage return / line feed will be the message body. This forces the program to add attachments properly.
  • Checking the message body for Unicode was causing every other character to be lost. This should be fixed now. At the same time, Unicode files without a Byte Order Marker (BOM) should be properly handled. Version 3.2.6 was an attempt to fix this last piece, but it broke non-Unicode file handling.

New in Blat 3.2.8 (Dec 1, 2015)

  • When impersonating (-f option) and the message content is formatted, it was possible to get two Date: header lines in outgoing email

New in Blat 3.2.7 (Dec 1, 2015)

  • Look for non-ASCII hyphen (hex code 0x2013) in the first position of command line options, and replace it with ASCII hyphen (hex code 0x002D).

New in Blat 3.2.6 (Dec 1, 2015)

  • When checking file content for Unicode, if the second byte of every pair is binary zero, then strip the binary zeroes before proceeding. It is possible to create a Unicode file with the echo command such that a Unicode Byte Order Marker (BOM) is not present in the file. Without the BOM, Blat was not properly handling these Unicode files.

New in Blat 3.2.5 (Dec 1, 2015)

  • After closing the server connection, clear the authenticated user flag to force reauthentication.

New in Blat 3.2.4 (Feb 28, 2015)

  • Changed X- header processing to use Buf definition rather than a fixed array. The change is made to organization and aheaders, to prevent memory overruns.
  • If using alternate text, such as when sending plain text and HTML, and if that alternate text is Unicode, be sure to set the charset for the alternate text section and set Content-Transfer-Encoding: 7BIT or 8BIT as needed and available.
  • If the message body charset is UTF-8 or UTF-7, and MIME is expected, set
  • Content-Transfer-Encoding: 7BIT or 8BIT as needed and available instead of setting Content-Transfer-Encoding: quoted-printable. The Unicode message body can then be sent as-is, if 8-bit is allowed, or sent as UTF-7 if 8-bit is not available from the server.
  • Ensure message headers are properly sent when sending multiple attachments across multiple messages, and the charset is UTF-8 or UTF-7.
  • Ensure the closing boundary marker is sent, when needed.

New in Blat 3.2.3 (Nov 4, 2014)

  • Added -logcmds option to write the command line arguments to the log, or to the screen, when also using -log option.
  • RFC 6152 spells out that SMTP clients and servers must use "8BITMIME" when support for 8-bit octects is requested and/or supported. However, some SMTP software is responding with "250-8 BITMIME" instead, with an embedded space in violation of RFC 6152. "8 BITMIME" is now accepted as if it were "8BITMIME".
  • If UTF-8 is selected with -charset option, and neither 8BITMIME nor BINARYMIME are not supported by the server, then UTF-7 will be used instead.

New in Blat 3.2.2 (Nov 4, 2014)

  • Fixed message body handling for Unicode / UTF-8.
  • Fixed the -af option to read Unicode / UTF-8 files. The change was in a routine common to several options.
  • Fixed a variable initialization in the sockets code.
  • Fixed attachment filename encoding for UTF-8 where the name does not contain Unicode characters, but also is not strictly US ASCII.
  • LOG does not require a filename. If no filename is given, then Blat will write everything to the stdout (screen). Fixed.

New in Blat 3.2.1 (Jun 7, 2014)

  • Completely removed "reply-type=original" from the source, so it cannot be added to any message headers. No reference to this text was found in any RFC at ietf.org.
  • Add the whole server name/address to the Message-ID header. Before, only the domain portion of the server name was added to the header. In testing a multithreaded program, the routine that attempted to identify the domain was causing a crash. The crash condition goes away if I just use the server name as given by the user.
  • When checking user input for Unicode, the buffer length should already be set, therefore set the buffer length only if not already set. This allows users to send binary files as their message body like older versions.

New in Blat 3.2.0 (Dec 28, 2013)

  • First attempt to make Blat.dll thread safe, meaning that a multithreaded program that uses Blat.dll should be able to send emails with each thread without stomping on each other. One caveat, if logging is desired, each thread must provide a unique filename for the log file, so that the threads do not corrupt each other's log entries. To make this thread safe version, I took all of the global variables and made a structure of these, which a pointer to the structure being passed to all routines. Each thread calling Blat.dll will cause a new structure to be allocated, initialized, and used for that thread's process. Some features of this change have not been tested because I do not have the GSS library, nor have a need to use that library for my home testing. The person who originally requested a thread safe version of Blat.dll should have the means to test this change, and I will attempt to contact that person to shake it out.

New in Blat 3.1.2 (Dec 28, 2013)

  • Changed the MultiByte to Unicode support calls to use CP_ACP instead of CP_OEMCP, because the latter was not working for some folks using Cyrillic code pages natively
  • Changed the ordering of attachments so that embedded attachments come first, inline attachments are second, text attachments are third, and binary attachments are last. It was reported that the prior ordering did not work for some users, and the new ordering now works for the user who reported an issue
  • LOG does not require a filename. If no filename is given, then Blat will write everything to the stdout (screen)
  • Fixed the Try count INFINITE to work as intended
  • Removed some code that attempted to use the shortest encoded attachment name that spanned multiple lines. The change returns the encoded lines back to the same as done with versions 3.0.0 through 3.0.4
  • Found UTF-7 encoding was adding an extra hyphen in some cases

New in Blat 3.1.1 (Feb 28, 2013)

  • Fixed a problem with parsing the command line and email addresses that have
  • an ampersand (&) or a percent sign (%) by themselves, not using HTML
  • formatting.

New in Blat 3.1.0 (Feb 4, 2013)

  • Added support for Blat.wcx in Total Commander
  • Blat 64-bit includes GSS encryption support once again.
  • Added more support for HTML in email addresses, such as in place of spaces, or < and > in place of < and >, respectively. This should make the email parser more compatible with web servers. I do not know if there is currently a problem, but I saw a change from someone else that made a quick effort to support in email addresses, so I took that idea and expanded it.
  • The ability to have multiple -body options used for each session was an undocumented "feature" in versions 2.6.2 through 2.7.6, but this was dropped when version 3.0.0 was developed to support Unicode. A user on SourceForge.net complained that this "feature" was missing from version 3.x, so I added this back in and now it is being documented in this Change log.
  • Replace the user's login password in blat's log file with "*****" when using -debug. -superdebug is not effected, because this mode will write the individual bytes in HEX mode, which the user can then validate if their login credentials are being rejected.
  • Fixed inline attachments to remove "reply-type=original", making the headers look like they did with Blat version 2.6.1. The test message received by Windows Live Mail looks as expected -- inlined text attachments are viewed as if part of the original message.
  • RFC 2046 says that if "Content-Type:" is message/rfc822, then only 7BIT, 8BIT, and BINARY are permitted encoding types. If an attachment is found to have this content type defined, then the attachment will be treated as a text file, and the encoding will be either 7BIT or 8BIT. However, the content of the attachment will not be validated for RFC 822 compliance.
  • Fixed a missing terminator byte for text attachments that sometimes allowed text attachments to be longer than expected, and/or incorrectly converted
  • to UTF-8.

New in Blat 3.0.7 (Aug 1, 2012)

  • Removed a line of debug code that printed command line arguments to the
  • screen, always.

New in Blat 3.0.6 (Jul 10, 2012)

  • Added error messages for attachment problems. These include: no file was found for a given search string, a name that matches the search string does not appear to be an actual file, a file that is larger than 4 GB, a file that cannot be opened, and a file that cannot be read. These extra messages should help people understand why their attachment(s) did not get sent, or why Blat exits with error code 12
  • Add more intelligence for checking UTF-8 byte sequences when the UTF-8 Byte Order Marker (BOM) is not present. This helps reduce the likelihood of incorrectly marking the charset as "UTF-8" or not
  • Forgot to properly set charset= in headers when Blat determines the message body is UTF/Unicode. Blat will now set charset= to UTF-8/UTF-7 as needed
  • Fixed options file parsing that I broke in 3.0.5, trying to support UTF-8 and Unicode files that may not have a BOM

New in Blat 3.0.5 (Jul 10, 2012)

  • Text attachments will be sent in their entirety, even if the message is supposed to be multipart. This change allows UTF/Unicode files to be processed correctly so that all characters of the file should be received and decoded without issue.
  • Extensive changes related to how Unicode is handled versus 7-/8-bit characters in English, European, and some other languages. These changes include fixes to salutations, postscripts, the subject line, text attachments, and attachment file names. Additional changes identify 7-bit data for text messages and text attachments.

New in Blat 3.0.4 (Jul 10, 2012)

  • If 32-bit Unicode code is run with Windows 9x/ME, exit with error code 14 because Unicode is not supported with Windows earlier than Windows 2000.
  • Try to support non-ANSI computer names, as found with a Russian version of Windows 7.

New in Blat 3.0.3 (Jul 10, 2012)

  • Changed how the blat log file is opened, to create this file as UTF-8 when Blat is compiled with Microsoft Visual Studio 2005 or newer. When compiled with Visual Studio 2003, or earlier, Unicode strings will be converted to UTF-8 before being written to the log. If the log is created, the first three bytes will be a UTF-8 marker. Testing with Visual C++ 6.0 in Unicode showed that VC could not write Unicode strings correctly, which required that strings be converted to UTF-8 before writing to the log.
  • Fixed yEnc encoding to work properly with binary files. One line of code needed to be moved about eight (8) lines lower.

New in Blat 3.0.2 (Apr 10, 2012)

  • Changed subject handling to use Buf class, and to convert to UTF-8 right away, if necessary.
  • Added "*** Warning ***" to certain messages related to authentication and message size. Added "*** Error ***" to additional messages related to
  • authentication.
  • Changed error messages related to opening / reading files to more accurately tell what the problem is. Previously, these messages simply said "Error reading ...".
  • Fixed a potential crash with the network connection code when an error occurs with the network.
  • Fixed -tf/-cf/-bf option to permit Unicode file content.

New in Blat 3.0.1 (Apr 10, 2012)

  • When printing messages to a log, or to the screen, convert UTF-8 strings to Unicode when possible before writing to the log or screen. This allows the user's strings to appear as readable text to that user, hopefully.
  • [*] Removed dependance on MSVCRT.DLL and MSVCR100.DLL. The program size is larger, but Blat now does not need these .dll files to be distributed.
  • Blat 32-bit is being built with Microsoft Visual C++ 6.0, and should still run under Windows 98 and Windows 2000.
  • Blat 64-bit is being built with Visual Studio 2010, and should run under any Windows 64-bit edition.
  • Blat 64-bit does not include GSS encryption support.
  • Dropped the "w/GSS encryption" version suffix.
  • ix base64 encoding of message headers to issue a line break on the nearest
  • space character to a 72 character line length. Before this change, some
  • Unicode strings were not interpreted correctly by some email clients. With this change, email clients like Thunderbird can decode the headers properly.
  • Fixed the message output for blat.dll to use a caller's print function when it is available.
  • Fixed blat.dll functions printDLLW(), printDLLA(), BlatA(), BlatW(), SendA(), and SendW() to correctly convert from/to Unicode strings.

New in Blat 3.0.0 (Feb 23, 2012)

  • Allow Unicode domain names, which will be made compliant with RFC 5890.
  • Converted the source code to use Unicode throughout. As a result, I added
  • both MBCS and Unicode interfaces for the .DLL. Developers will need to
  • adapt or include blatdll.h into their projects so they can call the .DLL
  • properly. Blatdll.h is included in the release package.
  • Blat will write to its log file in UTF-8 format when possible. This will
  • allow the log file to show Unicode filenames instead of showing a series
  • of question marks (?). The log file can still be opened with Notepad
  • without any issues. Thanks to Thomas Beutlich for this suggestion.
  • Unicode filenames will be converted to UTF-8 before being included into
  • the message body and/or message headers.
  • When storing login and password registry keys, Unicode values will be
  • converted to UTF-8 before encoding to base64. This makes Unicode login
  • and password values compliant with RFC 4616. Existing keys from Blat 2.xx
  • should continue to work just fine.
  • Blat can be compiled as either 32-bit or 64-bit. The 64-bit version will
  • look for its registry keys first under SOFTWARE\Wow6432Node\Public Domain
  • before looking under SOFTWARE\Public Domain. This allows users to keep
  • their existing profiles should they change from using 32-bit Blat version
  • to the 64-bit version.
  • The version of DLLs that are required for Blat will be included with the
  • release package. For example, building Blat with Visual Studio 2010 means
  • that MSVCR100.DLL will be called, and thus I will be including the required
  • version with the release package.
  • Allow HTML in salutations.
  • Keep the server connection open until the email has been sent to all
  • recipients. Previously, the server connection was closed after each
  • message, even when sending to multiple recipients.
  • Changed how the command line is processed in processOptions(), so that only
  • options will have forward slashes (/) changed to hyphens (-) automatically.
  • This feature was introduced in version 2.5.

New in Blat 2.7.7 (Feb 23, 2012)

  • Abort the program if an attachment is not found. The return code is 12.
  • Aligned the help text for -level option

New in Blat 2.7.6 (Nov 4, 2011)

  • Make sure all uses of strncpy() properly terminate the target string, to eliminate a potential memory overrun.
  • Attempt to fix a potential problem with time zone adjustments in the Date: header for locations that do not have daylight savings time.
  • Fixed a memory leak in gensock_connect(), introduced at version 2.6.0.

New in Blat 2.7.5 (Sep 17, 2011)

  • Fixed a problem with looking for default extension types. The instruction ordering was backwards, causing a crash if the file type was not listed in our source file (filetype.cpp).

New in Blat 2.7.4a (Sep 17, 2011)

  • Removed first attempt at wide char/unicode for the time being. I do not
  • have any way to test it.
  • Added X-MimeOLE: header for Blat with its version number when adding header
  • X-MSMail-Priority.
  • Fixed the help text for spelling error and alignment.

New in Blat 2.7.4 (Sep 17, 2011)

  • First attempt at making the code compatible with wide character / Unicode compiles.
  • Small changes for encoding headers when 8-bit characters are used.

New in Blat 2.7.3 (Sep 17, 2011)

  • OpenWatcom v1.8 can now build Blat after making changes to makefile.w32 and
  • some of the source files.
  • I made some preliminary changes for compiling as 64-bit with Visual Studio
  • 2005, but there needs to be more changes so VS 2k5 will build in 64-bit
  • mode. For now, the changes do not affect the 32-bit builds. When I get
  • the 64-bit build working, Blat will identify itself as "a Win64 (AMD64)
  • SMTP mailer" instead of "a Win32 SMTP mailer". I am running Vista 64-bit
  • so I can test Blat when I have it building as 64-bit. The goal is to have
  • both 32-bit and 64-bit versions available to choose from.
  • Fixed a memcpy() bug in options.cpp that I introduced with version 2.7.2; I
  • had used an ampersand (&) with the first argument when I should not have.
  • Removed ampersands from the fifth (5th) argument to RegQueryValueEx() in
  • regs.cpp. These ampersands have existed from before I took on the source.

New in Blat 2.7.2 (Sep 17, 2011)

  • When delaying between messages, and if POP3 access is requested, then delay
  • after the POP3 access before sending the first SMTP message. Some service
  • providers require a delay after POP3 access before they will acknowledge
  • and allow SMTP access. This time delay is unknown, so a little testing is
  • required to find what delay value works and what does not.
  • Use "strncpy" instead of "memcpy" to avoid potential page faults in
  • gensock.cpp and options.cpp.

New in Blat 2.7.1 (Sep 17, 2011)

  • Allow -log to be used without a filename. When no filename was specified before, this could have caused problems with Blat.
  • Force the -contenttype option to be available for all builds *except* LITE.
  • If the body filename is not specified with the -bodyf option, allow Blat to continue without crashing.

New in Blat 2.7.0 (Sep 17, 2011)

  • Added "-nomd5" option to disable CRAM-MD5 authentication. This is for
  • users who know their SMTP server/service provider has a flawed CRAM-MD5
  • implementation.
  • Added "-contentType " option so users can specify the ContentType
  • header for attachments that do not have a registered content type for the
  • extension. For example: -contenttype "text/calendar"
  • Removed an extra "m" in the word "comments" associated with the -comment
  • help text.
  • If the POP3 server name has not been specified, and POP3 access is
  • requested, then use the SMTP server name as the POP3 server name. In some
  • cases this is true, but most cases I have seen these functions are handled
  • by different servers and using the SMTP server name as the POP3 server name
  • would fail the POP3 access. Using POP3 access without specifying the POP3
  • server name should be used carefully.
  • When an error message is written to the log, preface it with
  • "*** Error ***" so these messages can be found more easily.
  • Allow "-mps" / "-multipart" option to be used without a specified size,
  • and to use the SMTP server's maximum message size to be the guide for
  • breaking up attachments for multiple part messages.
  • Changed "ISO-8859-1" to "iso-8859-1".
  • Changed base64 encoding and quoted encoding to use lower case 'b' and 'q'
  • respectively, even though the RFC that I read originally had upper case.
  • This was causing some email clients and/or servers to have problems with
  • encoded headers.

New in Blat 2.6.3 (Sep 17, 2011)

  • Added "-pwd" option for -password. It was pointed out that this was
  • mentioned in text somewhere.
  • Changed the way email addresses are encoded for headers to encode only the
  • name, not the email address itself. This was causing some servers to have
  • problems, where the server was expecting the email address itself to be in
  • the clear.
  • When closing the POP3 session, make sure to send QUIT to the server before
  • disconnecting, and wait for a possible response.

New in Blat 2.6.2 (Mar 3, 2008)

  • Add -overwritelog option to delete an existing log file and start writing a new log. This is used with the -log option
  • Add -bodyF option to specify a filename that contains the message body. This could be used in an options file to specify a default text file
  • Use MSVCRT.DLL instead of MSVCRT71.DLL
  • Allow command line -t/-to options to override and eliminate -t/-to settings from a default options file. This change also effects -c/-cc, -b/-bcc, -tf, -cf, and -bf. Previously, if any of these were specified in the options file, users could not override
  • Allow zero length attachments to be sent, as a notification that such files were created by some other activity
  • Changed the method of checking Windows version. The new method was found at Microsoft's MSDN website
  • Checking for a message body file has been improved to not leave files locked. Files that have been opened will be closed. This was overlooked before
  • Fix memory leak, by removing the last allocated block of memory