Updated readme files
authorMegaBrutal <code+git@megabrutal.com>
Sat, 13 Dec 2014 16:44:19 +0000 (17:44 +0100)
committerMegaBrutal <code+git@megabrutal.com>
Sat, 13 Dec 2014 16:44:19 +0000 (17:44 +0100)
modified:   mgsmtp_server_example.ini
modified:   readme.txt
modified:   readme_source.txt

mgsmtp_server_example.ini
readme.txt
readme_source.txt

index 13456c1b320d6f06c78e253930c318c0ec8751ff..258e2c03e79b72c8178315b92bd514ef01a6267b 100644 (file)
@@ -1,5 +1,5 @@
 ; MegaBrutal's SMTP Server (MgSMTP)
-; Copyright (C) 2010-2011 MegaBrutal
+; Copyright (C) 2010-2014 MegaBrutal
 
 ; This is an example configuration file for MgSMTP.
 ; You may inspect it to learn about the configuration options of MgSMTP, and (if
index 4a2403cdcf30a32c18ba2572b3ade382b4d6ba5a..48a2c00240f25e7cac458a82785ed9ff1913e79d 100644 (file)
     V. Managing mailboxes
    VI. Reading your local e-mails
   VII. Running in user mode
- VIII. Service-specific exit codes
-   IX. Disclaimer
+ VIII. Running under Wine
+   IX. Service-specific exit codes
+    X. Disclaimer
 
 
 I. Foreword
 -----------
 
-MgSMTP is a lightweight SMTP server for Windows, with minimal feature support. (However, the list of its features is constantly augmenting.) MgSMTP is suitable for you, if you'd like to run a simple, low-traffic mail server on Windows. You can use it as a relay on your LAN, or a primary or backup MX server for your domain(s). It runs as a Windows service. MgSMTP is a free and open-source software released under the GNU GPL.
+MgSMTP is a lightweight SMTP server for Windows and Wine. MgSMTP is suitable for you, if you'd like to run a simple, low-traffic mail server on Windows. You can use it as a relay on your LAN, or a primary or backup MX server for your domain(s). It runs as a Windows service. MgSMTP is a free and open-source software released under the GNU GPL.
 
 Common uses of MgSMTP:
 - As an SMTP relay on a Windows desktop OS to accept e-mails from your applications, other computers, devices on your LAN.
@@ -40,11 +41,12 @@ http://sourceforge.net/project/project_donations.php?group_id=371997
 II. Features
 ------------
 
-As of now, MgSMTP only supports a very basic set of features. Read mgsmtp_server_example.ini for details. Sadly, MgSMTP still lacks some common features those are widely supported by most mail servers. As of yet, MgSMTP doesn't support SSL/TLS, and doesn't utilize any SPAM-prevention techniques.
+As of now, MgSMTP only supports a relatively small set of features. Read mgsmtp_server_example.ini for details. Sadly, MgSMTP still lacks some common features those are widely supported by most mail servers. As of yet, MgSMTP doesn't support SSL/TLS, and doesn't utilize any SPAM-prevention techniques.
 
 Supported features:
 - Mail routing table
 - Mail forwarding/remailing
+- Aliases, plus aliases
 - User authentication (AUTH LOGIN)
 - ACLs
 - Domain-specific mailboxes
@@ -70,11 +72,11 @@ To install:
 
 2. Make a configuration file ("mgsmtp_server.ini") and create a mailbox for "postmaster". (See below.)
 
-3. Open up a command-line in the target directory. Type: "mgsmtp /INSTALL" to register MgSMTP as a Windows service.
+3. Open up a command-line in the target directory. Type: "mgsmtp /INSTALL" to register MgSMTP as a Windows service. If you have a 64-bit operating system and would prefer to use the 64-bit binary, use "mgsmtp64 /INSTALL".
 
 4. Type "net start MgSMTP" to start the service.
 
-If you get an error message at the last step, see the service-specific exit codes below. Also don't forget to inspect your log file (smtp.log by default)!
+If you get an error message at the last step, see the service-specific exit codes below. Also don't forget to inspect your log file (smtp.log by default)! Additionally, you can check mgsmtp_stdout.log (in %SYSTEMROOT%\System32 or %SYSTEMROOT%\SysWOW64, depending on your architecture).
 
 
 To uninstall:
@@ -83,7 +85,7 @@ To uninstall:
 
 2. Stop the MgSMTP service. (You can do this by issuing the "net stop MgSMTP" command.)
 
-3. Type "mgsmtp /UNINSTALL" to unregister the MgSMTP service.
+3. Type "mgsmtp /UNINSTALL" or "mgsmtp64 /UNINSTALL" to unregister the MgSMTP service.
 
 You have successfully uninstalled MgSMTP. You may safely remove its subdirectory if you want.
 
@@ -115,7 +117,8 @@ To add a new mailbox:
 1. Locate the "mail" directory. If you've never run MgSMTP before, you should create that directory. It must be a subdirectory of the directory where mgsmtp.exe is located.
 
 2. Create an empty file with the name of the desired mailbox in the "mail" directory. There are several methods, e.g. you can use the "touch" command (though you need the appropriate GnuWin32 package for that), or Notepad. For example, you'd like to create a mailbox named "postmaster". Open up a command-line, go to the "mail" directory, and type:
-notepad postmaster
+notepad postmaster.
+(Don't forget about the dot to indicate you don't want your filename to have any extension!)
 
 A Notepad will open, and it'll notify you that the given file doesn't exist, and ask you whether you'd like to create that file. Click Yes, and close the Notepad. A 0-byte file should show up in the directory.
 
@@ -146,7 +149,7 @@ NOTE: Instead of renaming the mailbox, you should consider adding an alias for i
 To add aliases and setting the quota of a mailbox:
 
 See the example configuration file to see how to adjust the settings of existing mailboxes.
-NOTE: It's best to add aliases by editing the configuration file! Avoid creating hardlinks or symlinks for mailboxes (even though theoretically it wouldn't break MgSMTP)! If you need aliases for domain-specific mailboxes those are in a different domain, you can still use the "RewriteTo" feature.
+NOTE: If possible, add aliases by editing the configuration file, instead of creating hardlinks or symlinks for mailboxes. (Though there were cases when I had to use links, and it worked fine.) If you need aliases for domain-specific mailboxes those are in a different domain, you can still use the "RewriteTo" feature.
 
 
 VI. Reading your local e-mails
@@ -157,7 +160,7 @@ inbox-path=C:\Program Files\MgSMTP\mail\postmaster
 
 If you'd like to use multiple mailboxes with Alpine on the same computer, under the same Windows user account, you can use multiple configuration files, each can be supplied with the "-p" command-line switch. You may create distinct shortcuts to start Alpine with different configuration files. Alpine also has an option to use alternate sender addresses.
 
-I don't know about any other mail client that is able to read e-mails from mailboxes directly, and runs on Windows. So it really seems Alpine is the only option. (But if you know about such a client, please tell me!)
+I don't know about any other GUI mail client that is able to read e-mails from mailboxes directly, and runs on Windows. So it really seems Alpine is the only option. (But if you know about such a client, please tell me!) On the command-line, you may have some Unix tools ported through Cygwin, GnuWin32, MinGW, but I didn't use any of them extensively.
 
 If you'd like to read your mailboxes on a remote machine, or with other mail clients than Alpine, you need to install a POP3 or IMAP server, and configure it to operate with your mailboxes. Honestly, I don't know about any softwares those may work like that on Windows. Probably later I'll implement a software named "MgPOP3" (or something like that) as MgSMTP's POP3 counterpart service. Though personally I don't need such a software, because I'm fine with Alpine, so I won't be in hurry with a POP3 implementation.
 
@@ -176,10 +179,40 @@ First, I don't recommend running MgSMTP in user mode, because in that case, you
 4. To stop MgSMTP, hit CTRL-C at the command-line. You should get your prompt back.
 
 
-VIII. Service-specific exit codes
----------------------------------
+VIII. Running under Wine
+-----------------------
 
-If MgSMTP fails to start up, you may see service-specific exit codes either on the command-line (if you've tried to start the service with the "net" command) or in the system logs. PowerShell may also show the service-specific exit code when you use the "Start-Service" command, however I'm not sure.
+Since I basically quit using Windows and became a massive Ubuntu user in the last 2 years, I needed to look for a solution to continue running MgSMTP (since it's mine, of course I insist to use it :p). Unfortunately, I didn't have time to port MgSMTP to Linux, thus I use it with Wine. I've even made some modifications to the code to make it more compatible with Wine. Even though you have many mail server alternatives for Linux, if you still insist to use MgSMTP, and accept the resource-overhead that comes with running it under Wine, there's nothing holding you back.
+
+Here are some tips for running MgSMTP under Wine:
+
+- As you know, in the Unix world, only root processes can bind to ports below 1024. The standard SMTP port (25) is in this range. Still, you are not advised to run MgSMTP or Wine as root. The workaround for this is to create a system account dedicated for MgSMTP (e.g. "mgsmtp", also consider adding it to group "mail"). Set up MgSMTP to listen on a higher port (e.g. 2500), and then forward port 25 to port 2500. You can use iptables:
+iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j REDIRECT --to-port 2500
+
+The drawback of port forwarding is that it won't apply to the local machine, so applications running on the actual machine have to be configured to connect on port 2500. But other machines on your network will be able to connect your server on port 25.
+
+- It is also advised to isolate MgSMTP in a chroot jail, or even better, in a container (e.g. LXC). By using the latter, you will have a dedicated IP for MgSMTP with a separate iptables, thus you'll be able to connect that IP on port 25 from your host.
+
+- I personally suggest to install MgSMTP under /opt, e.g. /opt/mgsmtp, and it's also fine to set this directory as the home directory for your "mgsmtp" account. Thus your wineprefix will be /opt/mgsmtp/.wine, and Wine will see your home as Z:\opt\mgsmtp\.
+
+- Good idea to symlink or bind mount /var/mail to MgSMTP's mail directory, or link individual mailbox files to/from there, so the system will be aware of your mailboxes.
+
+- Wine has an inconvenient feature. It only runs services when other, non-service applications are running under the same wineprefix. When all non-service applications quit, Wine will kill all Windows services, including MgSMTP. I've searched for the reason and I've only found, Wine is not designed to run permanent Windows services. Live with it! The solution is to always keep an application open with Wine. I always open a cmd.exe for this purpose, and a screen is ideal to keep it alive.
+
+Example for MgSMTP installation under Wine:
+$ sudo su - mgsmtp
+$ screen
+$ wineconsole cmd
+> mgsmtp /INSTALL
+> net start MgSMTP
+
+Detach from screen. MgSMTP will continue to run in the background. Next time you want to start MgSMTP, you won't need "net start MgSMTP": since MgSMTP registers itself as an auto-start service, Wine will automatically start it when you open a cmd. Just remember to start cmd in a screen, so it is kept alive. Also advised to keep a separate wineprefix for MgSMTP (if you've created a separate Unix account to run it, then this condition is automatically fulfilled).
+
+
+IX. Service-specific exit codes
+-------------------------------
+
+If MgSMTP fails to start up, you may see service-specific exit codes either on the command-line (if you've tried to start the service with the "net" command) or in the system logs.
 
 Here are the meanings of these service specific exit codes:
 
@@ -192,11 +225,11 @@ Here are the meanings of these service specific exit codes:
 4: You've attempted to start too many delivery threads. The maximum number of delivery threads is 36. See the explanation in the example configuration file.
 
 
-IX. Disclaimer
---------------
+X. Disclaimer
+-------------
 
 MegaBrutal's SMTP Server (MgSMTP)
-Copyright (C) 2010-2012 MegaBrutal
+Copyright (C) 2010-2014 MegaBrutal
 
 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 
@@ -205,4 +238,4 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
 You should have received a copy of the GNU Affero General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
-~~~ By MegaBrutal ~~~
\ No newline at end of file
+~~~ By MegaBrutal ~~~
index b8b9650eaee2fb81f186b45e0aaed01fa4a1371c..2eae15bcec6c24d8c6feb1d2d9555936d9f5f7eb 100644 (file)
@@ -1,8 +1,11 @@
 MegaBrutal's SMTP Server (MgSMTP)
-Copyright (C) 2010-2012 MegaBrutal
+Copyright (C) 2010-2014 MegaBrutal
 
 
-This is the source code for MgSMTP version 0.9r. View the changelog to be informed about the advances made since the previous version. Versions prior to 0.9i were private, their changes were not noted.
+This is the source code for MgSMTP. View the changelog to be informed about the advances made since the previous release, and todo to get a view of the project's plans for the future. Versions prior to 0.9i were private, their changes were not noted.
+
+You can check out the program's source code with Git:
+git clone git://git.megabrutal.com/mgsmtp.git
 
 
 For source files those implement core features of MgSMTP, the GNU Affero General Public License applies:
@@ -31,13 +34,13 @@ I've used and modified the unit, "comparewild.pas", originally published by Thom
 See license.txt and license_lesser.txt, and license_gpl-2.0.txt to read the mentioned licenses.
 
 
-Compiling this source is really easy. You need the FPC (Free Pascal Compiler) installed on your computer. Supporting environmental variables (such as the compiler's directory in PATH) should be set up as well. I suggest you to use the most recent stable version of FPC to compile MgSMTP. I used 2.4.0 when released this package. To actually compile the source code, open up a command-line, and issue the following command:
+Compiling this source is really easy. You need the FPC (Free Pascal Compiler) installed on your computer. Supporting environmental variables (such as the compiler's directory in PATH) should be set up as well. If you want to compile for 64-bit architecture as well, you also need to install the i386-win32 to x86_64-win64 cross compiler package. To actually compile the source code, open up a command-line, and issue the following command:
 
-fpc MgSMTP.pas
+buildall.bat
 
-Magic happens! FPC will compile the entire source code in a few seconds. You should get an MGSMTP.EXE as a result. Please read the other README file on instructions how to install it.
+Magic happens! The batch file will compile the entire source code in a few seconds. You should get an mgsmtp.exe and an mgsmtp64.exe as a result, for Win32 and Win64 respectively.
 
 The mgsmtp_tests.zip package contains some test programs I used. If you do changes to this software, they may come handy for debugging.
 
 
-~~~ By MegaBrutal ~~~
\ No newline at end of file
+~~~ By MegaBrutal ~~~