Skip to content
📨 簡易電子報發送系統,使用 #Golang 實作,send campaign mail with open, click tracker.
Go Shell Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
campaign Squashed commit of the following: Nov 22, 2017
reader Tiny changed May 25, 2017
.gitignore Move Makefile -> Makefile_example Jul 3, 2017
.travis.yml Remove install gimme in travis Apr 10, 2019
Dockerfile-min Update alpine to 3.9, golang to 1.12.3 Apr 10, 2019
Makefile_example Update alpine to 3.9, golang to 1.12.3 Apr 10, 2019 Add GO111MODULE=on into build-min Apr 10, 2019 Upgrade mariadb to 10.1.24 Jun 1, 2017 Upgrade mariadb to 10.1.24 Jun 1, 2017
doc.go Move mailbox/cmd -> cmd Jun 28, 2017
go.mod Fixed go.mod Apr 10, 2019
go.sum Fixed go.mod Apr 10, 2019 Move some script into travis Apr 10, 2019
mariadb.cnf Fixed many conn Jul 16, 2017

Mailbox GitHub release Build Status Coverage Status license

簡易電子報發送系統,使用 Golang 實作。建立發送 campaign 資訊、匯入訂閱者資訊(群組標記)、簡易發送系統、開信追蹤與連結點擊追蹤。

以 docker container 運行。


  1. mailbox campaign:建立 campaign,包含產生該 campaign 的亂數種子。
  2. mailbox user:匯入訂閱者的資訊。
  3. mailbox send:發送電子報,以 HTML 格式發送。
  4. mailbox server:接收開信訊息。

相關的操作請參考 -h 的說明,或 cmd/docs

Build Docker Image



sh ./


只將編譯過的 cmd 程式放入。

sh ./;


  1. AWS SES KEY, Token.
  2. Update ./Makefile run_cmd, ./ files.
    1. mailbox_ses_key:AWS SES KEY
    2. mailbox_ses_token:AWS SES Token
    3. mailbox_ses_sender:發送者的 email。如:Toomore Chiang <>.
    4. mailbox_web_site:接收開信網址,不包含 https 與結尾。如
    5. mailbox_ses_replyto: (選擇) 回信時的信箱。
  3. Nginx

Nginx config


proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Args $query_string;
proxy_set_header X-Uri $uri;


Into container

make run_cmd

Support bash-completion

mailbox [tab][tab]
campaign  send      server    user

... and pretty help (using spf13/cobra)

mailbox -h

Import User data from csv

匯入訂閱者資訊的 csv 檔案,檔案內需包含 email, groups, f_name, l_name 欄位。

mailbox user import ./list.csv

可以使用 -d 來預覽資料讀取狀況

mailbox user import ./list.csv -d

Template Replace

利用 mailbox send -p [HTML path] 時,可以在指定的 HTML 檔案中放入可被替換參數。

  • {{FNAME}}:訂閱者的 first name
  • {{LNAME}}:訂閱者的 last name
  • {{READER}}:放置開信追蹤連結。例:<img src="{{READER}}">
  • {{WASHI}}...{{/WASHI}}:放置點擊後才替換的參數。例:{{WASHI}}{{LNAME}}{{/WASHI}}
You can’t perform that action at this time.