蔡佳軒
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    ###### tags: `lsa` # Mail ![](https://i.imgur.com/S12PfcN.png) - `MUA` Mail User Agent - Client 端收受郵件的媒介 - `MTA` Mail Transfer Agent - 負責將 MUA 的信件做轉送,Mail Server 一般指的是他 - `MDA` Mail Delivery Agent - 依據信件流向送到目標位置 ![](https://i.imgur.com/9zCbIs0.png) ## postfix 安裝 ```shell= sudo apt install postfix ``` 使用圖形化介面進行設定 ```shell= sudo dpkg-reconfigure postfix ``` - type of mail configuration - `Internet site` 不論 localhost, 對外收發都可以 - `Internet with smarthost` 對外交由 smarthost 來處理 (`relayhost`) - `satellite system` - `local only` 僅限 localhost 的收發 (只能主機內使用者相互寄信) - system server name - 預設寄信 domain - 會被記錄到 `/etc/mailname` - Mail for the `postmaster` - 如果有人寄給管理員,要轉送給誰 ![](https://i.imgur.com/RLi96fW.png) - local network (network blocks for which this host should relay mail) - 設定允許被 relay 的網段 - mailbox size limit - mailbox 大小上限 - `0` 代表沒有限制 - local address extension character - 表示忽略 `符號` 後內容 - 可以用來內部信件分流 > 預設為 + 號 > e.g., aaa+domain@gmail.com > 這是說寄給 aaa@gmail.com > 但是收件者可以自行將該信分類到 domain > [name=zinxin] - Internet protocol - IPv4 or IPv6 :::success **Postfix 重要檔案** - `/etc/postfix/main.cf` 主設定檔案 - `/etc/mailname` 系統 default server name - `/etc/aliases` 信箱別名 - `/var/mail/{userName}` (收) 信箱 - `/var/spool/postfix/` (送)寄出 Queue ::: 設定檔 ```shell= vim /etc/postfix/main.cf ``` - `mydestination` (寄進來) 允許收的 domain - `mynetwork` 被認定為 Local 的網段 - `mailbox_size_limit` ## 透過 telnet 寄信 :::info **SMTP** Simple Mail Transfer Protocol 僅支援純 ASCII 文字的傳輸 慣用 port: 25 ::: ```shell= telnet localhost 25 ``` SMTP 寄信 :::success 確定 sender 有在列表內 (mydestination) ::: ```shell= mail from: <sender email address> rcpt to: <receiver email address> data Subject: <信件標題> <信件內容> . quit ``` 查看信件 (如果是寄給 localhost) ```shell= vim /var/mail/{receiver name} ``` 信沒收到可以到 queue 查看 `deffer` 當有部分收件者無法收件,且可收件的人員都已送達時 `active` 準備要送的 ```shell= ls -l /var/spool/postfix/ ``` ## alias 一次發給多個人 增加 alias 紀錄 ```shell= sudo vim /etc/aliases ``` ```shell= jobs: {your_user_name}, root ``` 更新 aliases.db ```shell= sudo postalias hash:/etc/aliases ``` 重新 reload postfix ```shell= sudo service postfix reload ``` 如果信沒寄到可以確認 server name (/etc/mailname) 有沒有在名單中 ```shell= sudo vim /etc/mailname ``` 測試寄給 jobs ```shell= mail from: <sender email address> rcpt to: jobs@localhost data Subject: <信件標題> <信件內容> . quit ``` ## 如何不被當成垃圾郵件 ### RBL (Real time Block List,RBL) 即實時黑名單列表。由第三方的反垃圾郵件組織提供檢查垃圾郵件發送者IP地址的服務。 在該組織列表中的IP位址既是嚴重對外發布過垃圾郵件而被檢舉列入清單 ### SPF (Sender Policy Framework) - 目的 - 防止隨意偽造發件人 - 原理 - mail server 收到信件後會反向驗證該 FQDN 在 DNS 中的 SPF 紀錄,確認該 IP 是不是在允許名單中 - SPF record - `v=spf1 ip4:192.168.0.1/16 -all` ### DKIM (DomainKeys Identified Mail) - 原理 - 透過設定的==公鑰==進行驗證 - DKIM record (`k` 演算法 `p`金鑰內容) - `v=DKIM1; k=rsa ;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRDG9+KjIHtJXilSxHtbS92dsEuKZ1mSWBu/e9L3ZpkDpYlOYsqiD8grXafNoIuwrxBpXW2lg2LbwkvugNDjJtQ7SQTPpP6b5hL23i8ezCYKeMTA8XM1618BtO2ZWHmWBOEvlEC11vmCZuuQc0RAxXa1H6hz0C13W+Qg/Qz+xYNQIDAQAB` ### DMARC - 原理 - 建立在 SPF 和 DKIM 協議的基礎上,當前兩個都下去了該怎麼處理 - 處理 - `none` - `quarantine` - `reject` - DMARC - ![](https://i.imgur.com/mtBYRuF.png) ![](https://i.imgur.com/UhIBu5y.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully