BILLmanager Documentation

Configuring a mail server

In order to send and receive emails, BILLmanager has a module which connects to external mail servers. Also, the billing system can use local or external mail server.

BILLmanager will check a local mail server during setup. If no servers are found, BILLmanager will install EximPostfix or Sendmail, depending on the package manager of the operating system. 

BILLmanager does not perform any additional configuration of a local mail server. A server administrator should configure the local MTA.

Outgoing email server


Setting up a local server

By default, the billing panel tries to send notifications through a local mail server. It calls the 'sendmail -t' command and passes the email generated by the system.

Setting up an external server

Navigate to "integrations" → "Mail gateways" → "Add". The new gateway wizard consists of two steps:

Step 1 - Add a new gateway. Select a gateway. In our example, we'll choose "External mail server".

Step 2 - Gateway parameters. Enter parameters to connect to the remote SMTP server.

The mailbox specified in the provider configuration form will be displayed in the "from" header. 

The mailbox specified in the mail gateway configuration form will be displayed in the "sender" header. 

How emails are sent

BILLmanager generates an email based on the EJS-template and adds information about it into the 'notifytask' table of the database. 

The email file is kept in the '/usr/local/mgr5/var/notify/<date>/<email idnetifier>' directory. 

The cron job  'BILLmanager set ntemail messages' is executed every minute.  The data from the 'notifytask' table are passed to the mail server, and the system sends the email. The system clears the table and deletes the email file. 

Incoming email server


When receiving an email from the gateway, the billing system checks the mailbox the email was sent from.

If the mailbox is already registered in the billing system as a client's email, the email is associated with that client and is sent to the "Tickets" module to the department specified in the gateway configuration form. 


Note

If per-incident support is set up, and the client doesn't have support incidents, the email won't be redirected to  "Tickets". He will receive the insufficient incidents notification.

If the email is sent from an unknown mailbox, it will be forwarded to the "Incoming emails" module where staff members can sort them manually. 

What emails are sent to BILLmanager

The billing system checks all unread emails. BILLmanager will receive the emails if the mailbox specified in the gateway configuration form, is displayed in the 'TO' heading of the incoming email. If the email was sent to the mailbox for which the gateway is not configured, it won't be redirected to the billing system. Empty emails are ignored as well.  

Example: in BILLmanager the gateway for incoming emails is configured for  ''support@company.NET'. Only emails sent to support@company.net will be forwarded to the billing system.  If you set up the mailbox ''support@company.COM'' as an alias for support@company.net, the emails sent to support@company.com won't be received by the billing panel, because the gateway is not configured for that mailbox. If the email is sent both to support@company.net and support@company.com, the billing system will accept this email. 

Local server

To receive emails from the local mail server,  you need to add a new gateway "External mail server" and connect it to 'localhost'.

External server

To connect an external server, navigate to "integrations" → "Mail gateways" → "Add". The new gateway wizard consists of two steps:

Step 1. Add a new gateway. Select a gateway - "External mail server". 

Step 2. Gateway parameters. Enter parameters to connect to the remote POP3 or IMAP server:

Once in several minutes, BILLmanager connects to the server to receive unread emails, and mark them as read. 

Note

If you work with a POP3 server, emails may not be marked as unread (depending on the mail server settings).

We recommend that you can select "Delete email from server" in the "When a new email arrives " field.


Logging


Local server

You can find the log of the ''local mail server'' in the '/usr/local/mgr5/var/gwlocalmail.log' file. 

To view more detailed information,  add the following record into the '/usr/local/mgr5/etc/debug.conf' file:

gwlocalmail.notify 9
or
gwlocalmail.* 9

External server

You can find the log of the '''external mail server''' in the '/usr/local/mgr5/var/gwremotemail.log' file.

To view more detailed information,  add the following record into the '/usr/local/mgr5/etc/debug.conf' file:

gwremotemail.notify 9
or 
gwremotemail.* 9