After sending the "\r\n.\r\n" after the mail payload, smtp_send_email was not waiting for the mail server to complete post-processing and respond with "250", but was sending "QUIT\r\n" immediately and dropping the connection. Mail server may kill the transaction if it can't send the "250" (socket closed). The changes proposed completes the mail transaction by reading for the 250 and in smtp_disconnect steps through a proper quit sequence by waiting for the 221 server response. I discovered this by including the --debug option in services.conf sendmailpath, which invoked logging in smtp_send and that slowed it down enough for the mail server to return the 250 and complete the transaction.
About
Anope is an open source set of IRC Services. It is highly modular, with a vast number of configurable parameters, and is the most used IRC services package. There are also many modules on the modsite to add additional features. It runs on Linux, BSD, and Windows, and supports many modern IRCds, including InspIRCd, UnrealIRCd, and ircd-hybrid. For more details, credits, command line options, and contact information see docs/README.
Installation
Linux/BSD
Download the latest release off of the releases page.
$ ./Config
$ cd build
$ make
$ make install
Now change to the directory where you installed Anope to, e.g. $ cd ~/services/
Windows
Download the latest release off of the releases page and run the installer.
Configuration
Copy conf/example.conf to conf/services.conf
$ cp conf/example.conf conf/services.conf
Edit services.conf, configuring the uplink, serverinfo, and protocol module configurations. Example link blocks for popular IRCds are included in the the example.conf documentation. The Anope wiki is also a good source of information. Our support channel is located at #anope on irc.anope.org.
Note that the example configuration file includes other example configuration files. If you want to modify the other example configuration files, copy them (e.g. modules.example.conf to modules.conf) and modify the include directive in services.conf to include the new file.
Running
Run $ ./bin/services to start Anope. If asked to provide logs for support, use the --support flag, e.g.: $ ./bin/services --support
Installing extra modules
Extra modules, which are usually modules which require extra libraries to use, such as m_mysql, can be enabled with the ./extras command from the source directory. Then re-run Config, make and make install again. Third party modules can be installed by placing them into the modules/third directory.