cogAdministration UI for mail configuration and statuses
TypeXAR
Category
Developed by

XWiki Development Team

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Standard

Installable with the Extension Manager

Description

Prior to XWiki 6.4, the Mail configuration was part of the Administration Application.

Allows configuring Mail. For example, the Mail Sender API uses this configuration when sending mail.

To use, go the global Administration page of your wiki and click on the Email categories:

emailcategory.png

Mail Obfuscation

emailgeneral.png

If turned on, the mails are displayed obfuscated, for example in the User's profile page:

emailobfuscateprofile.png

Mail Sending

Mail sending parameters:

emailsend.png

The Additional Properties fields allow passing JavaMail configuration properties. Here are some common ones:

 OptionDescriptionExamples
mail.smtp.localhostLocal host name used in the SMTP HELO or EHLO command. Defaults to InetAddress.getLocalHost().getHostName(). Should not normally need to be set if your JDK and your name service are configured properly.mail.smtp.localhost=yourhostname.com
mail.smtp.authIf true, attempt to authenticate the user using the AUTH command. Defaults to false. If you specify a username and a password, XWiki will set this property automatically for youmail.smtp.auth=true
mail.smtp.starttls.enableIf true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Note that an appropriate trust store must be configured so that the client trusts the server's certificate. Defaults to false. mail.smtp.starttls.enable=true

Note that these configuration options can also have default values configured in XWiki's configuration file.

Using Google SMTP server

For testing purposes, you can use your own GMail account as a SMTP server:

propertyvalue
serversmtp.gmail.com
port587
username[email protected]
passwordyourpassword or yourapppassword
JavaMail propertiesmail.smtp.starttls.enable=true

Google has announced that it’s disabling the Less Secure Apps feature on some Google accounts from May 30th, 2022. If that's the case for you, you need to use an app password by doing the following:

  • Turn on two-factor authentication for your Google account
  • Create an app-specific password for XWiki Mail SMTP in the security settings for your Google account. To do so, select "Other (Custom name)" as the app on the App passwords screen. Then type in "XWiki Mail SMTP" or another name that will help you identify this password in the space provided. Then, click the "Generate" button to create your password.
  • Note: any time you change your main Google account password, it will deactivate your app passwords as well.
  • You can find more details on the Google support site.

Note that if you don't use an app password and one is needed, you should see something similar to the following in the XWiki logs:

ERROR c.x.x.p.m.MailSenderPlugin     - sendEmailFromTemplate: XWiki.SharePage vcontext: org.apache.velocity.VelocityContext@26e308eb
javax.mail.AuthenticationFailedException: 534-5.7.9 Application-specific password required. Learn more at
534 5.7.9 http://support.google.com/accounts/bin/answer.py?answer=185833 r7sm3779883wjw.23 - gsmtp

Never use Gmail in production, in place of a real SMTP server, since this could get your account blocked, and your personal email appears as the sender in Outlook and other email clients.

Mail Sending Status

Display the statuses of all mails sent (when the feature that sent the email has defined that the mail status should be persisted) and allow resending emails that have failed to be sent.

emailstatus.png

Mail Resending Scheduler Job

12.10+ 

Mails that were prepared successfully but that were not sent (for example if the XWiki JVM crashed before they could be sent) can be resent automatically through a Scheduler job:

schedulerjob.png

The job is not scheduled by default so that you can decide how frequently you want to run it. It's also possible to edit the job to decide to resend emails in other send states (like send_error).

You can also decide to not use it and rely on the automatic mail resending feature.

Dependencies

Dependencies for this extension (org.xwiki.platform:xwiki-platform-mail-ui 14.8):

Tags: mail
    

Get Connected