BILLmanager 6

Configuring a mail server

Using the Connect to external mail servers module, you can configure BILLmanager to send and receive mail messages. The billing platform can use a local mail server. 

If you connect an external mail server, you may need to configure it additionally.

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 additional configuration of a local mail server. A server administrator should configure the local MTA (mail transfer agent).

Outgoing email server

Setting up a local server

By default, the billing platform 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

To configure an external mail server, go to IntegrationMail gatewaysAdd button:

  1. Add a new gateway — select External mail server
  2. Gateway parametersEnter parameters to connect to the remote SMTP server:
    1. Use for — select the type of gateway to use: outgoing messages. It will not be possible to change the gateway type after saving the settings.
    2. Provider — select the provider to which the created gateway will be connected. Changing the provider will not be available after saving the settings.
    3. Notification types that will be sent through this gateway.
    4. Activate after creation — activate the option to enable the gateway after saving the settings.
    5. Email address — specify the user's email address on the external mail server.
      The "from" header will be filled with the mailbox specified in the provider settings. The "sender" header will contain the mailbox specified in the settings of the mail gateway in BILLmanager.
    6. Server address — specify the domain name or IP address of the server to connect to.
    7. Port — specify the port of connection to the server.
    8. Username and Password — specify user data for connecting to the server.
    9. Connection encryption — select the type of encryption for the connection to the server:
      • None;
      • SSL;
      • TLS.

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.

The Google service has a mailing limit when you use the Gmail server.

Incoming email server

When receiving an email from the gateway, the billing platform checks the mailbox the email was sent from:

  • If the mailbox is already registered in the billing platform 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 platform 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 platform. 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 platform.  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 platform, 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 platformwill 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 configure an external mail server, go to IntegrationMail gatewaysAdd button:

  1. Add a new gateway — select External mail server
  2. Gateway parameters. Enter parameters to connect to the remote POP3 or IMAP server:
    1. Use for — select the type of gateway to use: incoming messages. It will not be possible to change the gateway type after saving the settings.
    2. Provider — select the provider to which the created gateway will be connected. Changing the provider will not be available after saving the settings.
    3. Department — select the department to which requests received at the specified mailing address will be assigned.
    4. Send to Abuse — activate this option to make the emails that arrive to the specified email go not to the Requests menu, but to the list of violations. This is the list that will be available to the specified Department.
    5. Activate after creation — activate the option to enable the gateway after saving the settings.
    6. Email address — specify the user's email address on the external mail server.
    7. Server address — specify the domain name or IP address of the server to connect to.
    8. Connection protocol — select a protocol:
      • POP3;
      • IMAP.
    9. Port — specify the port of connection to the server.
    10. Username and Password — specify user data for connecting to the server.
    11. Connection encryption — select the type of encryption for the connection to the server:
      • None;
      • SSL;
      • TLS;
    12. When a new email arrives — select the action when a message is received from the server:
      • do not perform any actions;
      • delete the email from the server.

Work logic

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

When working with a POP3 server, received e-mails may not be marked as read — it depends on the mail server settings.

To prevent repeated receipt of e-mails, it is recommended to select "delete the email from the server" value 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