Set up SMTP email service
Hubs software needs to send out emails with magic links to verify that your visitors are real people and *not* sentient AI bots here to destroy humanity. 🤖
If there are emails that need to be sent, there needs to be a controlling entity that does the work of sending the emails around. You will control that email service.
💡 Tip: Do not be confused that there are 2 types of email when setting up Hubs.
- Your admin email is the main email account you’ve been using to set up accounts. It will control your Hubs. To help you, we’ve tried to refer to your controlling email as your admin email. Your admin email could be hosted nearly anywhere (work email, home email, etc.). We used gmail in our testing.
- This set of instructions (Set up SMTP email service) is about setting up the magic link emails. These are the automatic emails sent via SMTP services when a user tries to log into Hubs.
You can pick any email service that provides SMTP. These instructions will use Scaleway.
Scaleway offers a free service for 300 emails maximum per month. (See our FAQs if you need more than 300 emails per month.) We find this reasonable. Additionally, Scaleway is based in France, has a satisfactory Privacy Policy, and has an environmentally-friendly approach.)
Part 1 Set up an account at Scaleway
1. Go to Scaleway. Select Get started.
2. At New to Scalway, select Sign up.
3. At Personal, enter your first name, last name, email address, select I accept Scaleway’s Terms of Services and Scaleway’s Data Protection Agreement. The FriendlyCaptcha should already say I am human. Select Create account.
You do not need to select these options, Open in Gmail or Open in Outlook. Notification to check your email:
4. Check your email. Within the confirmation email, select Confirm my email address.
Scaleway account registration email:
5. You may close the previous window at Scaleway. In the window that opened from the email confirmation link, you are taken to the Scaleway Console page, Enter your billing page.
Enter your street address, postal code, city. Select your Country, and then select your Region from the drop down menus. Select add billing address.
6. To use SMTP services from Scaleway, you must validate a payment method. Scaleway only has a pay by credit card option. For Enter your billing information, enter your credit card number, expiration date, CVV or CVC, Name on card, and select Add credit card.
There will be a notification that your account is free, however, Scaleway will charge you a one (1) euro charge that you will need to use to verify the billing connection between Scaleway and your payment source.
This is an example Mastercard credit card confirmation screen.
Note: Scaleway requests Enter the 4-digit code included in the temporary one euro charge ID. It will be similar to this format: SCW* C-7699. This can be a problematic step. In our testing, it worked fine for one user, showing up immediately in a text alert and also as a pending charge at the credit card account site. The four digit code in this example was 4550.
Text:
Pending charge at credit card site:
If the 4-digit code does not show on your transaction, you may need to contact your bank or credit card company.
7. At the Welcome to Scaleway question box, What will you be using Scaleway for pop up, our advice is to answer: select Other, enter text Sending magic link emails. Select Start exploring.
Part 2 Connect Scaleway to Porkbun
1. At the Scaleway Console, Organization Dashboard, you will be offered more options to further verify your account. This is optional.
2. In the Scaleway Console menu, in Products, Managed Services, select Transactional Email. 💡Tip: We had to scroll down to find this.
3. Select Add domain.
4. At Add a New Domain
a. For Enter domain name, enter your porkbun domain. For example: mycoolhubs.space
The domain can only contain alphanumeric characters, dots, and dashes.
b. At Estimated monthly cost, this would be your estimated number of emails beyond 300 transactional emails.
🤔 Advice: You can enter zero here OR whatever you think you’ll need beyond 300 emails.
Select the checkbox for I have read and accept Scaleway’s antispam policy. Select Validate domain name.
Part 3 Domain verification and adding A Records
In this step, you will add in the SPF, DKIM, MX, and DMARC records between Scaleway and Porkbun.
1. Log into Porkbun.com, if you are not already logged in. Under ACCOUNT, select Domain Management.
2. For your domain, select Details.
3. Select DNS Records (the active link is the little edit symbol).
Your DNS Records popup, the top will look like this:
At the bottom of the popup, you should have 2 existing default records, possibly with the word “pixie” in them.
4. Delete any records that have “pixie” in them. Select the trashcan icon. Porkbun will not need them.
5. Now, you will copy and paste from Scaleway to Porkbun.
a. Scaleway’s Type is Porkbun’s Type
b. Scaleway’s Name is Porkbun’s Host
c. Scaleway’s Value is Porkbun’s Answer
d. You will cut and paste entries for each of 4 entries: 1 for SPF, 1 for DKIM, 1 for MX, and 1 for DMARC.
💡 Tip: You may want to have 3 screens simultaneously open on your computer: 1. These instructions 2. Scaleway 3. Porkbun
i. SPF
- At Porkbun, from the Type menu, select TXT 💡Tip: be sure to change from CNAME to TXT.
- At Scaleway, there is no entry to copy this time At Porkbun, leave Host blank.
- At Scaleway, copy the Value data. 🤔 Advice: we think it is the upper Value as you should have no SPF Name yet. At Porkbun, paste it into Answer.
- Leave TTL as 600.
- For Notes:💡This is optional. We used Scaleway SPF entry
- Select Add.
- Once you do this, the record should appear down below on the popup.
ii. DKIM
- At Porkbun, from the Type menu, select TXT
- At Scaleway, copy the Name data. At Porkbun, paste it into Host.
- At Scaleway, copy the Value data. At Porkbun, paste it into Answer.
- Leave TTL as 600.
- For Notes:💡This is optional. We used Scaleway DKIM entry
- Select Add
iii. MX
- At Porkbun, from the Type menu, select MX
- At Scaleway, there is no Name data. Leave Host blank.
- At Scaleway, copy the Value data. At Porkbun, paste it into Answer.
- Leave TTL as 600.
- For Notes:💡This is optional. We used Scaleway MX entry
- Select Add.
iv. DMARC
- At Porkbun, from the Type menu, select TXT
- At Scaleway, copy the Name data. At Porkbun, paste it into Host.
- At Scaleway, copy the Value data. At Porkbun, paste it into Answer.
- Leave TTL as 600.
- For Notes:💡This is optional. We used Scaleway DMARC entry
- Select Add.
e. WARNING: In our testing, we found that Porkbun added an extra domain name to the end of the DKIM record, Host field.
For example, we found that Porkbun did this: 7yadyayayayayayaydydyaady._domainkey.mycoolhubs.space.mycoolhubs.space
This link will not work.
We tested this and found that it is best to make sure that the domain is only listed ONE TIME at most inside a link. Porkbun is going to add it on the end automatically for you.
For example, if Scaleway gives you this link: 7yadyayayayayayaydydyaady._domainkey.mycoolhubs.space
To delete the extra domain (the mycoolhubs.space part) at the end of the link, at that entry, select the edit pencil.
In the Host field, delete all of the text after domainkey. You can either cut and paste the Scaleway text like this into the host field (notice no domain is after domainkey):
7yadyayayayayayaydydyaady._domainkey
Alternatively, you may have to use your keyboard arrowkeys to move to where the domain text is and then use delete on your keyboard.
Select the disk to save.
Porkbun will then add your domain on the end automatically once you’ve added it. That is fine.
The final displayed result at Porkbun will be:
7yadyayayayayayaydydyaady._domainkey.mycoolhubs.space
7. Once your 4 entries are in, the lower part of the page will look similar to this below. 💡 Tip: We added ‘Notes’ to our entries. We found that it helped to keep track of what each entry was.
8. Back at Scaleway, select the checkbox for I have added these DNS records to my DNS zone. Select Verify domain. Scaleway says “The verification of your domain might take 48 hours.” We found that it was quick.
9. Check your email. Scaleway sends you an email with the status of your domain. Your domain will be either verified or not verified.
Example email:
a. At Scaleway, on the Transactional Email page, you may have a red dot for your domain name with a popup that says Your domain is unverified. Check your email for more details.
i. If you see a notification that your DKIM entry “missing or incorrect DNS records on your domain”, you may check that you entered the data correctly at Porkbun.
ii. Also, make sure you carefully follow the steps within these instructions at Step 3, f.
iii. If you’ve cleared up any problems, just refresh this page at Scaleway and the red dot should turn into a green dot.
b. If you have a green dot next to your domain name, it is verified. You will be notified by email as well.
Part 4 Generate SMTP API token
1. At Transactional Email. Select your domain (the one you purchased at Porkbun. You will arrive at the Email activity tab.
2. Select the Overview tab. a. At SMTP configuration, these listed items listed below are shown. Copy and save the server, default port, and username somewhere securely.
i. Server - copy and save
ii. TLS connection ports - ignore
iii. Default ports - copy and save 2587
🤔 Advice: When collecting email parameters: check what ports your email provider supports for SMTP. The standard ports are 25, 465 and 587, but your Kubernetes provider may block those ports as a spam-fighting measure. If your email provider supports non-standard ports, use one of them. (For Scaleway, use port 2587.)
iv. Username - copy and save v. For Password, select Generate an API key for your IAM application.
3. For Identify and Access Management, select Create an application.
4. For Create an Application, Enter a name and optional description.
a. 🤔 Advice: For Name, we used MyHubsCE.
b. 🤔 Advice: For Description, we used Our Hubs SMTP application.
c. For key value tags and attach a policy, skip this.
d. Select Create application.
5. At Identity and Access Management (IAM), your application should be listed. Select the Policies tab.
6. Leave the three default policies there. Select Create policy.
7. At Create A Policy, enter a name and optional description.
a. 🤔 Advice: For Name, we used MyHubsCEPolicy.
b. 🤔 Advice: For Description, we used Our Hubs SMTP policy.
c. For key value tags, skip this.
d. For Select a principal, Principal Type, select the drop down arrow and select Application, then at Select or type an application, select whatever name you created for your application (in these instructions, Part 4, Step 4). For our example, we selected MyHubsCE.
e. Select Add rules.
8. At Create rules, Rule #1, Scope, select Access to resources. At Select or Type Project name, select All current and future projects. Select Validate.
9. At Create Rules, Rule #1, Permission sets, in the Products Menu, select Managed Services, in the Permission sets, select TransactionalEmailFullAccess.
🤔 Advice: Be careful to select TransactionalEmailFullAccess!! There are other accesses that look very similar, but won’t work!
Select Validate.
10. At Create a Policy, Create rules, Rule#1, select Create policy.
11. At MyHubsCEPolicy, select Back to Policies.
12. Select the API keys tab.
13. Select Generate an API key.
14. At the Generate an API key popup,
a. For Select API key bearer, Select An application.
b. Select your named application from the dropdown menu.
c. For the Optional description. Enter any text here.
🤔 Advice: We entered Our Hubs CE SMTP API token.
d. For Expiration, the default should be Never. Leave it on that setting.
e. For Will this API key be used for Object Storage, select No, skip for now (default). Select Generate API key.
15. At Credentials Usage, Copy and save your Access Key ID and Secret Key somewhere securely. Select Close.
Result:
Yay! You’ve done it! Your new API key will be assigned to your domain.
Return to the Beginner’s Guide
Sources
How to generate API keys for API and SMTP sending with IAM
How to create an IAM application