-
Notifications
You must be signed in to change notification settings - Fork 3
Mail Settings
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.
The following properties must be specified in kustvakt.conf (or kusvakt-test.conf for testing).
mail.enabled = true
mail.sender = [email protected]
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
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
.
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
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
- Importing Kustvakt to Eclipse
- Installing Lombok
- Setting annotation processors
- Setting a test environment
- HTTP Basic Authentication
- OAuth2 authorization scopes
- OAuth2 authorization request
- OAuth2 token request
- OAuth2 token revocation
- OAuth2 client registration
- OAuth2 client info
- OAuth2 client deregistration
- OAuth2 client secret reset
- Plugin registration
- Plugin list (marketplace)
- Plugin installation
- Plugin uninstallation
- Installed plugin list
- VC creation and update
- VC deletion
- VC list
- VC info
- VC KoralQuery
- VC statistics
- VC statistics with KoralQuery