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设置邮件服务器