gitlab設置郵件服務器
by Oren Geva
由Oren Geva
如何設置您自己的一次性電子郵件服務器 (How To Setup Your Own Disposable Email Server)
Disposable email services are online services that provide temporary email addresses for registering or signing up on websites that require email verification.
一次性電子郵件服務是一種在線服務,提供臨時電子郵件地址,用于在需要電子郵件驗證的網站上注冊或注冊。
The purpose of these services is that you can avoid exposing your own email address to potential SPAM, especially if you just need the service for a short period of time.
這些服務的目的是可以避免將自己的電子郵件地址暴露給潛在的垃圾郵件,尤其是在短時間內僅需要該服務的情況下。
Disposable email services are also useful in software development and testing, as many software products require email verification themselves. Using real email addresses in the context of software development or testing is cumbersome and annoying. Many teams around the world use temporary disposable email services for testing their own software products.
一次性電子郵件服務在軟件開發和測試中也很有用,因為許多軟件產品本身都需要電子郵件驗證。 在軟件開發或測試的背景下使用真實的電子郵件地址既麻煩又煩人。 世界各地的許多團隊都使用臨時的一次性電子郵件服務來測試自己的軟件產品。
AHEM - Ad Hoc Email is one of these services. You can send an email to an @ahem.email address and check the AHEM mailbox to retrieve and read the email.
AHEM-臨時電子郵件是這些服務之一。 您可以將電子郵件發送到@ ahem.email地址,并檢查AHEM郵箱以檢索和閱讀電子郵件。
Many similar services such as Mailinator, ThrowAwayMail, Temp-Mail and Yopmail are available online to name a few.
網上可以使用許多類似的服務,例如Mailinator , ThrowAwayMail , Temp-Mail和Yopmail 。
Each has their own interpretation of the theme, but one of the things that makes AHEM unique is that AHEM’s code is freely available on GitHub as open source, allowing a user to download and set up their own temporary mail server.
每個人對主題都有自己的解釋,但是使AHEM與眾不同的一件事是AHEM的代碼可以作為開放源代碼在GitHub上免費提供 ,允許用戶下載并設置自己的臨時郵件服務器。
But why would someone want to set up their own disposable mail server? In the context of software testing, while most of the time an online disposable email service is sufficient, on some occasions you might want to host a temporary email server on site:
但是,為什么有人要設置自己的一次性郵件服務器? 在軟件測試的背景下,盡管大多數情況下,在線一次性電子郵件服務就足夠了,但在某些情況下,您可能希望在現場托管一個臨時電子郵件服務器:
- Some organizations block access to disposable emails, or even just unknown websites 一些組織禁止訪問一次性電子郵件,甚至只是未知的網站
- Some QA labs do not offer external Internet access 一些質量檢查實驗室不提供外部Internet訪問
- Some products require multiple or controllable email domains tested 有些產品需要測試多個或可控的電子郵件域
AHEM caters to all these needs and more.
AHEM可以滿足所有這些需求,甚至更多。
To install AHEM, you’ll need a Linux or Windows machine with administrative rights and Node.js version 8.9+ as well as MongoDB installed.
要安裝AHEM ,您需要具有管理權限的Linux或Windows計算機以及Node.js 8.9+版本以及已安裝的MongoDB。
Setting up Node.js, npm and MongoDB is out of the scope of this guide, but in case you’re lost, detailed information on how to set them up can be found on the Node.js download and MongoDB download pages.
設置Node.js,npm和MongoDB不在本指南的范圍內,但是如果您迷路了,可以在Node.js 下載頁面和MongoDB下載頁面上找到有關如何設置它們的詳細信息。
安裝AHEM (Installing AHEM)
The following section details the steps required to install and run AHEM disposable mail server. AHEM can run on any system supporting Node.js.These steps were performed and tested on an Ubuntu Linux server and may need slight modifications to be compatible with other systems.
以下部分詳細介紹了安裝和運行AHEM一次性郵件服務器所需的步驟。 AHEM可以在任何支持Node.js的系統上運行。這些步驟是在Ubuntu Linux服務器上執行和測試的,可能需要稍作修改才能與其他系統兼容。
安裝Angular CLI (Install Angular CLI)
AHEM uses Angular for its front end delivery, so you will need to globally install angular-cli:
AHEM使用Angular進行前端交付,因此您需要全局安裝angular-cli:
npm install -g @angular/cli
同時安裝 (Install Concurrently)
Concurrently is a JavaScript library that allows running multiple scripts concurrently. In this configuration, AHEM uses Concurrently to run both the backend node API and email server, and serve the front end directly via angular-cli:
同時存在一個JavaScript庫,該庫允許同時運行多個腳本。 在此配置中, AHEM使用并發來運行后端節點API和電子郵件服務器,并直接通過angular-cli服務前端:
npm install -g concurrently
克隆AHEM GitHub存儲庫 (Clone the AHEM GitHub Repository)
git clone https://github.com/o4oren/ahem-server.git
在創建的文件夾中安裝依賴項 (Install Dependencies within the Created Folder)
cd ahem-servernpm install
更新配置 (Update Configuration)
A configuration file named properties.json is located in the root of the project. Edit it to suit your preferences.
一個名為properties.json的配置文件位于項目的根目錄中。 編輯它以適合您的喜好。
vim properties.json
The properties.json file will look something like this:
properties.json文件將如下所示:
Here is an explanation of the parameters within the properties file:
這是屬性文件中參數的說明:
serverBaseUri - the base address for your API server.
serverBaseUri -API服務器的基本地址。
mongoConnectUrl - the mongodb connect url.
mongoConnectUrl -mongodb連接網址。
Example: “mongodb://localhost:27017/ahem”.
示例:“ mongodb:// localhost:27017 / ahem”。
appListenPort - the port the node app binds to.
appListenPort-節點應用程序綁定到的端口。
smtpPort - the SMTP server’s port. Note that by default it is set to 2525 — this is done for testing purposes, as on many systems only a system account can listen on port 25. To receive standard SMTP email, change this to 25.
smtpPort -SMTP服務器的端口。 請注意,默認情況下將其設置為2525,這是出于測試目的,因為在許多系統上,只有系統帳戶才能在端口25上偵聽。要接收標準SMTP電子郵件,請將其更改為25。
emailDeleteInterval - The time in seconds between age checks for purging old emails.
emailDeleteInterval-清除舊電子郵件的年齡檢查之間的時間(以秒為單位)。
emailDeleteAge - The max age in seconds above which emails will be deleted.
emailDeleteAge-最大期限 (以秒為單位),超過該期限將刪除電子郵件。
allowedDomains - An array of allowed email domains. These domains will be allowed by the server as RCPT TO: entries. This also makes the server not act as an open relay. Format: [“my.domain.com”, “my.second-domain.com”].
allowedDomains-允許的電子郵件域的數組。 服務器將允許這些域作為RCPT TO:條目。 這也使服務器不能充當開放中繼。 格式:[“ my.domain.com”,“ my.second-domain.com”]。
customText - A html string that will replace the default text in the landing page.
customText-一個HTML字符串,它將替換登錄頁面中的默認文本。
allowAutocomplete - If set to false, will prevent auto completing users in the UI.
allowAutocomplete-如果設置為false,將阻止在用戶界面中自動完成用戶。
建立項目 (Build the project)
npm run build:ssr
This may take a while…
可能還要等一下…
運行AHEM (Run AHEM)
At this point, make sure your MongoDB server is up and running and that your properties.json file was configured correctly.
此時,請確保您的MongoDB服務器已啟動并正在運行,并且您的properties.json文件已正確配置。
The easiest way to run AHEM, is run the project with the command:
運行AHEM的最簡單方法是使用以下命令運行項目:
node ahem.js
This command will start (by default) the backend server on port 3000 and the front end will run on port 4200. You can then access the AHEM web interface at http://localhost:4200.
此命令將(默認情況下)在端口3000上啟動后端服務器,而前端將在端口4200上運行。然后,您可以在http:// localhost:4200上訪問AHEM Web界面。
Clap or star the GitHub Repo if you find this useful!
如果發現有用,請拍一下或加星標GitHub Repo !
翻譯自: https://www.freecodecamp.org/news/how-to-setup-your-own-disposable-email-server-b4cfd297afa7/
gitlab設置郵件服務器