Skip to content

Mail Settings

Eliza Margaretha edited this page Aug 9, 2019 · 2 revisions

** WARNING: Mailing functions are experimental and may change without any notice.

Kustvakt (full version only) supports email notification, for instance to notify users invited to join a user-group. The mail setting in Kustvakt is by default configured for using a mail server at localhost post 25. You can setup such a mail server for example by using Postfix.

Enabling Mail

The following properties must be specified in kustvakt.conf (or kusvakt-test.conf for testing).

mail.enabled = true
mail.sender = noreply@ids-mannheim.de
mail.receiver = test@localhost
mail.address.retrieval = test

You can change mail.sender value to any email address (beware of spams in your mail server configuration).

mail.receiver is an email address used for testing. All mails are to be sent to this email address. Change test to any username available in your system, or create an alias for test@localhost (see Creating email aliases).

mail.address.retrieval determines the method to retrieve user email addresses, for instance by using LDAP. By default and for testing, only the mail.receiver value is used as the email address of all users. For custom implementation, please refer to de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager.getUser(String, String)

To view the mailbox in your system, you can use mailx

$ mailx -u test
s-nail version v14.8.6.  Type ? for help.
"/var/mail/test": 1 messages 0 unread
 O  1 noreply@ids-mannhe Wed Feb 21 18:07   30/1227  Invitation to join

Creating email aliases

Open Postfix main configuration (may required admin privilege).

sudo vi /etc/postfix/main.cf

In main.cf, set

"virtual_alias_maps = hash:/etc/postfix/alias"

Create an alias file:

touch /etc/postfix/alias

In the file, create an alias for test@localhost for a user in your system

sudo vi /etc/postfix/alias
test@localhost username

Create an alias database

sudo postmap /etc/postfix/alias

Restart postfix

sudo /etc/init.d/postfix restart

By default, any emails sent to test@localhost will be available at /var/mail/username.

Customizing SMTP configuration

To connect to an external/remote mail server instead of using local Postfix, copy full/src/main/resources/properties/mail.properties to the full/ folder.

Customize the properties in the file according to your mail server.

mail.host = smtp.host.address
mail.port = 123
mail.connectiontimeout = 3000
mail.auth = true
mail.starttls.enable = true
mail.username = username
mail.password = password

Customizing mail template

Kustvakt uses Apache Velocity as the email template engine and searches for templates located at:

full/src/main/resources/templates.

For instance, the template for email notification of user-group invitation is

full/src/main/resources/templates/notification.vm

You can change the template according to Velocity Template Language.

In kustvakt.conf or kustvakt-test.conf, specify which template should be used.

template.group.invitation = notification.vm

Advanced Setting

Developer Setting

Search services

Metadata services

Authentication and Authorization services

Client services

Super client services

Plugin services

User services

User group services

Virtual corpus services

Virtual corpus access services

Administrative services

Description services

Clone this wiki locally