Foilen Cloud
Fran├žais

Emails

Table of Content

Diagram of the Applications

graph LR A[Apache James] --> B[(MariaDB)]

Diagram of the Resources to Create

graph LR EmailDomain -- INSTALLED_ON --> JamesEmailServer EmailDomain -- USES_SMTP --> WebsiteCertificate EmailDomain -- USES_IMAP --> WebsiteCertificate EmailDomain -- USES_POP3 --> WebsiteCertificate EmailDomain -- SEND_THROUGHT --> EmailRelay EmailAccount -- INSTALLED_ON --> EmailDomain EmailRedirection -- INSTALLED_ON --> EmailDomain JamesEmailServer -- RUN_AS --> UnixUser JamesEmailServer -- INSTALLED_ON --> Machine JamesEmailServer -- USES --> MariaDBDatabase JamesEmailServer -- USES --> MariaDBUser JamesEmailServer -- USES_SMTP --> WebsiteCertificate JamesEmailServer -- USES_IMAP --> WebsiteCertificate JamesEmailServer -- USES_POP3 --> WebsiteCertificate

Diagram of the Generated Resources

The JamesEmailServer creates an application which is installed on the chosen Machine and runs as the chosen UnixUser. The database, certificates, accounts and redirections are put in a configuration file in the application and when it changes, the application makes the changes in the database.

graph LR EmailDomain -. MANAGES -.-> Domain EmailDomain -. MANAGES -.-> DnsEntry EmailDomain -. MANAGES -.-> DnsPointer DnsEntry -. MANAGES -.-> Domain DnsPointer -- POINTS_TO --> Machine DnsPointer -. MANAGES -.-> Domain DnsPointer -. MANAGES -.-> DnsEntry A[Application Apache James] A -- RUN_AS --> UnixUser A -- INSTALLED_ON --> Machine

Domain

  1. Go to Foilen Infra in the Plugin tab (https://infra.foilen.com/plugin/list) and click on Email Domain
  2. Choose the owner
  3. Write the domain name
  4. Choose domains for MX, IMAP and POP3 (can be the same domain).
    • Suggestion, all: mail.domain.com
  5. For Installed On Email Server, choose a server.
    • If you are on Foilen Cloud, you can use the shared server foilen_james_server.
  6. For the 3 certificates, click on Create and enter the domain name that has been chosen.
    • If the 3 domains are the same, after having created a certificate, for the 2 others, click on Choose and take the one that has been created.
  7. For Email Relay (Optional), if nothing is chosen, all emails sent by email accounts will be sent by the server itself. Some providers, like Hotmail, might block emails because of their dysfunctional spam filter. To remedy this, it is possible to relay sent emails by AWS SES, Sendgrid or any other provider.
  8. Click on Create

Email Account

An email account allows you to receive and send emails.

  1. Go to Foilen Infra in the Plugin tab (https://infra.foilen.com/plugin/list) and click on Email Account
  2. Choose the owner
  3. Write the account name
    • E.g: *bob"
    • The full username depends on the chosen domain. If the domain is domain.com, then the username for receiving and sending emails is bob@domain.com
  4. Choose a password
  5. For Installed on Domains, choose the domain(s) for this account name.
  6. Click on Create

Redirection to One or More Emails

Warning: Redirections are an important feature, but they might not work well. The reason is that to redirect, the recipient is changed and therefore the email itself is changed. This change invalidates any initial signature on the message, and mail servers often depend on them to categorize spam.

Bad use:

  • Redirection to an email address external to the server.

Good use:

Steps:

  1. Go to Foilen Infra in the Plugin tab (https://infra.foilen.com/plugin/list) and click on Email Redirection
  2. Choose the owner
  3. Write the account name
    • E.g: *bob"
    • The full username depends on the chosen domain. If the domain is domain.com, then the email is bob@domain.com
  4. For Redirect To, choose the email address(es) to send the emails to.
  5. For Installed on Domain, choose the domain(s) for this alias.
  6. Click on Create

Email Account and Redirection for the Same Address

If you create:

This ensures that:

Redirection Catch-all

To avoid that there is someone who sends an email to the wrong address or an old address of a former employee without being answered, it may be good to create a redirection for all addresses that do not have an account and who do not have a specific redirection to one or more internal email addresses. On the other hand, you risk receiving more spam since any test done by spammers will get to you.

Warning: Just like with specific redirects, you should follow best practices to avoid losing emails.

Steps:

  1. Go to Foilen Infra in the Plugin tab (https://infra.foilen.com/plugin/list) and click on Email Redirection
  2. Choose the owner
  3. Leave Account Name empty
  4. For Redirect To, choose the email address(es) to send the emails to.
  5. For Installed on Domain, choose the domain(s) for this alias.
  6. Click on Create