Internal SMTP server and mailboxes

ADR has no built-in message editor, but it has internal SMTP server, and you can configure your mail client to work with ADR as described in "Configuring Mail Client" article.

Besides providing for connection of your mail client with ADR, the internal mail server has one more important function - supporting mailing lists. Mailing lists are set up through configuring mailboxes on the "Mailboxes" tab in ADR settings.

ADR mailbox is not a message storage. When a mailbox is set up, mailing lists and plugins are linked to it. When a message gets into the mailbox, it is delivered using mailing lists linked to that mailbox and is processed by the relevant plugins. All the resulting messaged are placed in the OutBox folder.

Several mailboxes were set up along with setting up ADR. Feel free to send messages using that lists - they contain our test addresses.

The simplest mailbox is called "simple", it contains only one mailing list. A message sent to the address simple@localhost (if you have changed local domain of the mail server, change the address respectively, too) will be multiplied as specified in the list stored in simple.lst file. ADR support not only lists with emails, ADR can create lists with SQL transaction on fly. See “Mailing list formats” to learn more and sqlmail mailbox.

Normally, when mail client sends message using a mailing list, the list address is to be typed in "To:" field. ADR can replace this address with the address of actual recipient, if the relevant option is enabled. Withname mailbox contains withname.lst list, where e-mail addresses are in standard form. When you use this list with the relevant option enabled, the recipient will see his/her real name in the "To:" field.

A more complex example is sendnum. It contains a list and a plugin - user's mail processing program. When you send mail to sendnum@localhost, each message to be sent using the sendnum.lst list will be processed by the sendnum.exe (or sendnum.dll) program. This program searches for %SENDNUM% sequence in the message body and replaces it with the first line from file sendnum.dat. After that, the first line of sendnum.dat file is deleted. For example, this plugin is helpful when you need to send new serial numbers to your users. You have to create sendnum.lst containing addresses of your users and sendnum.dat containing the list of serial numbers. And the work that could take days will be done in a few minutes! sendnum.exe is distributed with sources in C language, and you can easily modify it to expand capabilities of this plugin.

The xray example contains a mailing list and XRay plugin, which is distributed with Delphi sources. This plugin is designed for cuting out some lines from messages header (kludges), the beginnings of lines are specified in XRay.CFG file. E.g., you can cut lines with your mailer identifier (X-Mailer) or message path in your internal mail system. AdKludge plugin solve inverse problem. It add service lines (kludges) from file AdKludge.CFG to message header. This plugin and it’s Delphi v3 source code are placed in “plugins” subdirectory of Advanced Direct Remailer.

The realname example designed for personified delivery works in a similar way. File realname.dat contains e-mail addresses and real names of the recipients. Plugin searches for %REALNAME% sequence in the message and replaces it with real name of the recipient. If realname.dat contains no name corresponding to the e-mail address, the default name set after single @ symbol in realname.dat is used. For example, in a message starting with the following line:

Hello, %REALNAME%!

the line will be replaced with:

Hello, John Smith!

The same plugin can be used for some other purposes - e.g. to send serial numbers or other personified information to your users.

If your mailbox is linked to several mailing lists (m1.txt, m2.txt, m3.txt) and several plugins (e1.exe, e2.exe, e3.exe), the system will work as follows. The program will create a message for the first address from m1.txt. Then it will launch e1.exe, with message file name and its path as the first parameter in command prompt. When e1.exe finishes processing the message, e2.exe will be launched with the message name in the command prompt, and then - e3.exe will be launched. After the message is processed by all the plugins, it is placed in the end of the queue in the OutBox folder. It will be sent when its turn comes. After the first message is moved to the OutBox folder, a message for the second address in the m1.txt will be created, etc. Having sent messages to all the addresses in m1.txt the program starts processing the list  m2.txt, and then - m3.txt.

Plugin can delete a message passed to it for processing if it considers it undeliverable. For example, if there are no more serial numbers in the list. Executable files (.exe and .com), special Dynamic Link Libraries (.dll) and batch files (.bat) can be plugins.

ADR messages format is very simple, so you or your programmers can easily create new message processing programs.

About DLL versions of plugins, Program overview, Information for programmers, About FromSQL plugin