Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pulipulichen/8def2fed0fe85ea57e0c7055924e1af9 to your computer and use it in GitHub Desktop.
Save pulipulichen/8def2fed0fe85ea57e0c7055924e1af9 to your computer and use it in GitHub Desktop.
1secmail,Linux,tmpmail
看起來暫時性電子郵件信箱是可以去申請Let's Encrypt憑證。
----
# 臨時郵件 / tmpmail
用certbot申請Let's Encrypt憑證的時候,需要加上電子郵件地址的參數。
雖然大多時候大家都老老實實地寫上自己的電子郵件地址,但我這次的情況不太一樣。
我只需要有個「可以寄信」的電子郵件地址就好了,不需要真的用它來收信。
而且既然使用了certbot了,那我就希望整個流程能夠直接用程式碼自動化完成是最好的了。
https://www.makeuseof.com/generate-temporary-email-addresses-using-linux-command-line/。
後來找到的是這篇「How to Generate Temporary Email Addresses Using the Linux Terminal」。
作者Nitin Ranganath介紹「tmpmail」這個指令列工具的安裝與使用方式。
https://github.com/sdushantha/tmpmail。
「tmpmail」使用了1secMAIL API來取得臨時性的電子郵件地址,可以產生例如「3o7cv5xt9d@qiott.com」這樣的臨時性地址。
雖然說是臨時性,但我不確定這個信箱會在何時重置。
知道的人可以幫忙在下面留言告知嗎?。
# 安裝 / Installation
在安裝tmpmail之前,必須先安裝tmpmail使用的套件:。
````
apt-get install jq w3m xclip curl -y
````
然後用以下指令安裝:
````
curl -L "https://git.io/tmpmail" > tmpmail && chmod +x tmpmail
````
這樣就完成了。
# 使用 / Usage
使用tmpmail的指令如下。
由於我們沒有把tmpmail放在/usr/bin裡面,它必須要指定路徑來執行才行,所以不可以忽略前面的「./」。
````
./tmpmail --generate
````
接著就會跑出一串電子郵件地址,例如:
(圖片來源:Make Use Of)
這樣就完成囉。
如果想要在Bash裡面,將tmpmail的結果傳入變數的話,可以用以下的指令:。
----
繼續閱讀 ⇨ 用指令取得臨時電子郵件地址 : Generate Temporary Email Addresses in Linux Terminal
https://blog.pulipuli.info/2023/04/blog-post_427.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment