Email Server LANMailServer

IMAP, POP3, and SMTP for Local Networks with Autoresponder and Email Distribution Groups

 

Online help for LANMailServer

Email Server for Local Networks POP3 IMAP4 IMAP with Autoresponder, SMTP Relay Server, Email Distribution Groups, OAuth2 Support
 
 

Click on "Local Email Accounts" in the Configuration menu to create, modify, or delete new local mailboxes.

To create a new email account, click "Add." To modify an existing account, select the email account in the list and click "Modify." To delete an email account, select the account and click "Delete."

 

In the Shareware version, a maximum of 2 local email accounts can be created.

In custom applications/scripts, email accounts can be created or modified via the JSON API.

 

General Tab

 

Account Name to Be Used as the Part Before "@" in the Local Email AddressEnter a unique name for the email account. The email account name must not contain spaces, special characters, or umlauts.
This email account name simultaneously forms the part before the "@" symbol for the local email address, e.g., meier.
This account name is also necessary for retrieving emails with an email program.

 

PasswordEnter a password for the email account. This password must be communicated to the email account holder. It is also necessary for retrieving emails with an email program.

 

The Email Account Holder Is PostmasterThis option should only be activated if the mailbox owner is to be the Postmaster. A Postmaster receives undeliverable emails from all email accounts.
Only one email account can be defined as Postmaster at a time.

 

Archive All Incoming/Outgoing Emails of This Email AccountActivate this option to add all emails received or sent through this email account to the Email Archive. Emails in the archive can be searched.

 

Deny Sending Emails to the InternetOnce this setting is activated, sending emails to the internet is not allowed, and only emails to local LANMailServer email accounts can be sent.

If the autoresponder or forwarding is used, emails will also not be sent to the internet.

Note: The SMTP error 521 5.7.1 User <email-address> not local; no forwarding address is returned if an attempt is made to send an email to the internet.

 

Save Emails Sent via SMTP in INBOX.SENT Folder (Not Recommended!)Saves all emails sent via the LANMailServer SMTP server in the INBOX.SENT/Sent Items folder, similar to how Microsoft 365/Office 365 stores them.

Each email is stored on the server, delaying email acceptance and consuming a significant amount of storage space over time.

This option is not recommended.

If emails are sent only using email programs like Microsoft Outlook or Thunderbird with IMAP4 access, these email programs automatically save a copy in the Sent Items/INBOX.SENT, and no additional storage is required during SMTP access.

If you use programs such as SuperMailer, BirthdayMailer, MailboxFetcher, or FollowUpMailer for SMTP sending, activating this option allows permanent storage of each sent email.

 

This Email Account Should Be an E-Invoice Mailbox (EN16931/XRechnung Only)Enable this option only if you want to receive e-invoices (EN16931/XRechnung). The attachments of incoming emails are examined, which can be very time-consuming if the emails contain large attachments.

Incoming emails are checked for attachments in the XML format ZUGFeRD DIN EN16931 or XRechnung, as well as PDF/A attachments with XML attachments in the ZUGFeRD DIN EN16931 or XRechnung format. LANMailServer does not validate the XML data but checks for specific details that should be present in every e-invoice or e-credit note.

If an email with an e-invoice is detected, it can be forwarded locally or to the internet. Alternatively, non-detected emails can be forwarded locally or to the internet.

 

Forward All Emails Received by This Account to This Email Address

 

-- not available if it is an e-invoice mailbox --

 

Specify a name for a local email account or an internet email address. If this field is filled in, emails intended for the local email account are automatically forwarded to the specified local email account or external internet email address. It is also possible to specify a group name; in this case, the email is forwarded to all email accounts in the group.

Activate the setting "Leave a Copy of the Forwarded Email in This Local Email Account" to additionally store the forwarded email in this mailbox. If this setting is deactivated, no copy will be left in this email account. Be mindful of storage space when using this function. If this local email account is never accessed and emails are not deleted, large amounts of data could accumulate.

 

Activating/Deactivating Forwarding via Email

Each local user can activate or deactivate forwarding via email themselves. It is not possible to activate or deactivate forwarding through an external mailbox.

Deactivating Forwarding via Email

The local user must send an email with the subject LMS Forwarding off to their own local email address. Upon successful deactivation, a confirmation email will be sent to the local user.

Note: The term LMS must be specified in uppercase letters. For the terms Forwarding off or Forwarding off, case sensitivity is ignored. The format of the email does not matter, and the email body is ignored.

 

Activating Forwarding via Email

The local user must send an email with the subject LMS Forwarding on <email-address> to their own local email address. Upon successful activation, a confirmation email will be sent to the local user, which will, of course, be forwarded to the specified email address. A valid internal or external email address must be provided for <email-address>.

Note: The term LMS must be specified in uppercase letters. For the terms Forwarding on, case sensitivity is ignored.

Option: Leave a Copy of the Forwarded Email in This Local Email Account

If the checkbox is selected in the email account, a copy will be left in the account; otherwise, no copy will remain.
With LMS Forwarding with local Copy on <email-address>, this option can be activated via email. With LMS Forwarding without local Copy on <email-address>, this option can be deactivated via email.

 

 

Send SMS on Receiving an Email to:

 

-- not available if it is an e-invoice mailbox --

 

 

Activate this setting and enter a valid mobile number.

Note:
For SMS sending, you must correctly enter the access data for the SMSout.de service in the LANMailServer configuration.

 


Autoresponder Tab

Using the autoresponder, you can automatically send a reply email to the sender of an email. As soon as LANMailServer receives an email in the local email account, including from external email accounts, LANMailServer automatically sends an email with the specified text.

Activate Autoresponder for This Email AccountEnable this setting to activate the autoresponder function. Afterward, please specify the text for the automatic reply email.

Activating the Autoresponder via Email (not available in the Shareware version)

Each local user can activate or deactivate the autoresponder via email and also define the email subject and content of the autoresponder text. It is not possible to activate or deactivate the autoresponder through an external mailbox. The autoresponder function can only be permanently activated, not for a specific time period.

Deactivate the Autoresponder via Email

The local user must send an email with the subject LMS Autoresponder off to their own local email address. Upon successful deactivation of the autoresponder, a confirmation email will be sent to the local user.

Note: The term LMS must be specified in uppercase letters. For the term Autoresponder off, case sensitivity is ignored. The email format does not matter, and the email body is ignored.

 

Activate the Autoresponder via Email

The local user must send a plain text email with the subject LMS Autoresponder on to their own local email address. After the term LMS Autoresponder on, the email subject for the autoresponder email can be specified. If no subject is provided, incoming emails will automatically be answered with "Re: Subject of the incoming email." The email body can contain the text to be sent as the automatic reply to the incoming email. After activation of the autoresponder or in the event of an error, an email will be sent to the local user.

Note: The term LMS must be specified in uppercase letters. For the term Autoresponder on, case sensitivity is ignored.

 

 

Activate the Autoresponder Permanently or for a Specific Time PeriodSelect "Permanently" to activate the autoresponder indefinitely. Alternatively, choose the time period during which the autoresponder should automatically send reply emails.

 

Email Subject (Leave Blank to Automatically Use "Re: Email Subject")Leave this field blank so that LANMailServer automatically replies with the email subject "Re: <Subject of the Incoming Email>." Enter text to use only this text as the email subject.

 

Text to Be Sent as a Reply to Each EmailEnter text to be sent as a reply email. You can use placeholders in the text, which can be inserted via the context menu (right mouse click). The following placeholders are available:

[SUBJECT] - Inserts the email subject at this point in the email text
[MAILDATE] - Inserts the email date at this point in the email text
[FROM] - Inserts the sender's email address at this point in the email text
[TO] - Inserts the recipient's email address at this point in the email text
[DATE_SHORT] - Inserts the current date (short format) at this point in the email text
[DATE_LONG] - Inserts the current date (long format) at this point in the email text
[TIME_SHORT] - Inserts the current time (short format) at this point in the email text
[TIME_LONG] - Inserts the current time (long format) at this point in the email text

 

Optional, Alternative Domain for Reply EmailOptionally, a domain other than the one configured can be specified for the reply email. The automatic reply will be sent with this domain.

Note: Some email servers do not allow sending with external domains.

 

Forward All Emails Received by This Account to This Email AddressForwarding is only performed if the autoresponder is activated. If a time period is defined, forwarding will occur only during the specified period.

Specify one or more local email account names or email addresses, separated by semicolons.

Activate the setting "Leave a Copy of the Forwarded Email in This Local Email Account" to additionally store the forwarded email in this mailbox. If this setting is deactivated, no copy will be left in this email account.

 


External Accounts Tab

On this tab, you can specify external email accounts, i.e., email accounts hosted by an email provider. These email accounts are regularly checked by LANMailServer (see Configuration Menu - Program Configuration under Local Email Accounts) for new incoming emails. Emails are retrieved and then transferred to the local email mailbox so that they can be accessed and responded to like local emails.

 

Outgoing Mail Tab

On this tab, choose whether the settings from the program preferences for sending emails to the internet should be used. A different SMTP server or a different username for SMTP authentication can be specified, or alternatively, emails can be stored in a local folder, uploaded via HTTP POST to a web server, or sent via a PHP script through a web server.

Alternative SMTP Server

SMTP Authentication Basic/Standard 

Use "Modern Authentication" OAuth2 instead of BASIC/Standard Authentication for accessing mailboxes or sending emails

 

Optionally Overwrite Sender Email Address with This Email Address for All EmailsEnter a valid email address in the field; this email address will overwrite the sender email address of every email sent to the internet. It is also possible to use the placeholder %localpart%, as explained in the LANMailServer settings.

 

S/MIME and DomainKeyNotes on S/MIME and DomainKey can be found in the LANMailServer settings.

 

Limit Email Size toUsing this option, the maximum size of an email to be sent for this user can be limited. If a limit for the SMTP server has already been set in the program settings, the size value specified here cannot exceed that value.

 

Limit Recipients per Email toLimits the number of recipients per email in case the external SMTP server has a limit on the number of recipients. This will result in a single email being split into multiple emails for sending.

e.g.,

If an email needs to be sent to 250 recipients as CCs and the external SMTP server has a limit of 2 recipients per email, LANMailServer will split the email into 125 individual emails, each with 2 recipients, and send them to the external SMTP server.

This setting can also be used to bypass the GoogleMail error "451-4.3.0 Multiple destination domains per transaction is unsupported." Specify a limitation of 1 in such cases. Emails with recipients from different destination domains will be individually sent to the GoogleMail server.

 

 

Save in a Folder

Instead of sending emails via SMTP, emails can be stored in a local folder and used by custom software. Adequate storage space must be available; if saving fails, the email will be considered not sent, and further attempts to save will be made.

 

Transmit via HTTP Post

Sends emails via HTTP Post to a custom script or software running on a web server. A variable name must be specified, and the custom script or software must evaluate this variable. The email is considered sent if HTTP error code 200 is returned. Other error codes result in a repeated upload via HTTP POST.

Note: To store data in a local folder, it is recommended to save directly to the folder, as this reduces unnecessary overhead.

Example PHP script for accepting the data and saving it in a directory:

<?php
 function SetHTTPResponseCode($httpStatusCode, $httpStatusMsg){
   if($httpStatusCode > 0){
       $phpSapiName    = substr(php_sapi_name(), 0, 3);
       if ($phpSapiName == 'cgi' || $phpSapiName == 'fpm') {
          @header('Status: '.$httpStatusCode.' '.$httpStatusMsg);
       } else {
          $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? 
                            $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
          @header($protocol.' '.$httpStatusCode.' '.$httpStatusMsg);
       }
   }
 }

 $UploadVar = 'rfc822data';
 $DestPath = 'd:/xampp/'; // Save folder

 if(isset($_FILES[$UploadVar])){
   $target_file = $DestPath  .  basename($_FILES[$UploadVar]['name']);
   if(!move_uploaded_file(
      $_FILES[$UploadVar]['tmp_name'], $target_file)){
     SetHTTPResponseCode(500, 'Can't save to ' . $target_file);
   }else
     SetHTTPResponseCode(200, 'OK');
 }else{
  SetHTTPResponseCode(403, $UploadVar . ' not found.');
 }
    
?>

 

Transmit via Webspace/Own Server

Emails are sent via HTTP POST to a provided PHP script, which then sends the email to the recipient. PHP5 or newer is required.

Note: Due to the overhead of the HTTP protocol, this method should only be used if sending emails via SMTP in your own network is not possible.

Click on "Perform Upload of PHP Scripts" to transfer the scripts via FTP/SFTP to the webspace. The script call will be tested in the process; in the event of an error, the directory on the webspace or the HTTP(s) call must be corrected. Providing the script password is necessary to secure the script call; the password should be very long.

Note: The scripts must not be deleted or moved on the webspace. You can always re-upload the scripts to the webspace by clicking "Perform Upload of PHP Scripts" and carrying out the upload.

The script on the webspace will send emails using PHP mail() (default). Alternatively, you can specify an SMTP server with SMTP authentication to send emails via this SMTP server.

When LANMailServer is to send an email, the email is transferred as a file via FTP/SFTP, after which this file is sent via a script call. Sending is therefore not possible through a simple HTTP(s) call of the script, even with knowledge of the script password.

 

OAuth2 Clients Tab

You can create one or more OAuth2 clients for each local email account to enable OAuth2 authentication, provided the email program allows configurable endpoints. Client IDs and client secrets are automatically and uniquely generated and cannot be modified. Using the access scope, you can restrict later access via POP3, IMAP, or SMTP. With the "Copy URLs" function, you can directly copy the endpoints. In the program settings, the HTTP-API/OAuth2 server must be activated; otherwise, OAuth2 authentication will not be available.

OAuth2 Endpoints and Parameters

 

See Also

Query Emails in External Mailboxes

LANMailServer Settings

 

 

 

Manual last updated: Fri, 4 Apr 2025 10:59:06 +0100

Manual as complete RSS feed: Manual as RSS feed

Manual localized with Microsoft Copilot

Erstellt mit RSSWriter https://www.rsswriter.de