zinxin
    • 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 New
    • 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 Note Insights Versions and GitHub Sync 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    mail server === [TOC] :::info > [Reference_鳥哥](http://linux.vbird.org/linux_server/0390postfix.php) * 設定檔:Postfix 的設定檔都在 `/etc/postfix` 裡面,主要的設定檔有:   * `/etc/postfix/main.cf` :這個就是最重要的 postfix 的設定檔了!等一下我們談到的設定都在這個檔案裡面進行修改的動作!基本上,他本身就是一個簡單的說明文件檔啦!不過,要注意的是,在你修改完成了 main.cf 之後,請記得『**一定要重新 reload 或重新 restart postfix** 才行!』   * `/etc/postfix/master.cf`:這個檔案是另外一個重要的 postfix 設定檔!他主要是規定了 postfix **每個程序的運作參數**!   * `/etc/postfix/access` :這個檔案與 sendmail 的 access 是相同的!都是用來**做為 relay 或者是 deny 某些 IP 與 hostname 的檔案**!不過,要啟用他還是**得要修改 main.cf**才行!   * `/etc/postfix/aliases` : 這個檔案與 sendmail 的 aliases 也是相同的!同樣的可以做為別名之用,所以您可以回頭去翻一翻這個檔案的用法喔! * `/etc/postfix/pcre_table` regexp_table relocated : 這幾個檔案可以做為**郵件的過濾之用**喔!可以使用正規表示法來進行郵件過濾(filter)的規則,呵呵!會使用這幾個檔案,或許連 procmail 也不需要使用了呢! ^_^ ::: ## Protocol ![](https://i.imgur.com/S12PfcN.png) :::success - Step 1 使用者利用 MUA (gmail 等軟體寫信) 寄信到 MTA 上面: - 發信人與發信網站:此處的網站就是 Step2 的 MTA - EX: 發信人 B8 發信網站 BBBBBBBB@gmail.com - 收信人與收信網站: account@email.server - EX: 收信人 Ou 發信網站 Qouou@gmail.com > MUA -> MSA -> MTA : **SMTP ( Simple Mail Transfer Protocol )** > port: 25 > MUA 會主動連接 MTA 的 port 25 - Step 2 MTA 收到自己的信件,交由 MDA 發送到該帳號的 MailBox 當中 - MTA (gmail.com :BBBBBBBB) -> MTA (gmail.com :Qouou) > MTA(BBBBBBBB) -> MTA(Qouou) -> MDA(Ou) : **SMTP ( Simple Mail Transfer Protocol )** > port: 25 > 只要 MTA 都支援 SMTP 信件便可順利流通 > Ou(收信者) -> MTA 的使用者 Mailbox : POP ( Post Office Protocol ) / IMAP > **POP3 ( Post Office Protocol version 3 )** > port: 110 > MUA -> MTA(port 110) :MTA mailbox -> MUA > 只要 MUA 與 MTA 同時支援 **POP3** 即可自由收信 > 收信後主機端會刪除信件(MUA 收完信 MTA 端的信會刪除) > IMAP: 讓使用者 ( client 用戶端 ) 自行定義信件放置的目錄功能,以及是否要儲存下載的信件之後,原信件是否保留在主機上面的功能,目前大部分 Web 介面的電子郵件使用,即是用這個達成的 ( Webmail 可以看到歷史郵件等 ) - Step 3 MTA 將信再轉送出去 - 如果由 Step 1 來的信件的收件人並不是 MTA 的內部帳號,那麼該封信將會被再轉送出去!由 Step 1 及 Step 3 的動作,我們也稱為 **Relay (郵件轉遞)** 的功能喔! - Step 4 遠端 MTA 收受本地的 MTA 所發出的郵件 - 遠端的 MTA 會收受我們這部 MTA 的信件,並將該信件交給他的 MDA 來處理 ( Step 5 ) ,此時,信件會存放在遠端的 MTA 上面,等待使用者登錄讀取或者下載回去! ::: * MUA (Mail User Agent) 郵件使用者代理人 - Client 端的電腦無法直接寄信,為 Client 端上的軟體 - 不論是送信還是收信,Client 端的用戶都需要透過各個作業系統提供的 MUA 才能夠使用郵件系統 > EX: 使用 gamil / Outlook 等軟體寄信(編輯信件) - 主要的功能 - 收受郵件主機的電子郵件 - 提供使用者瀏覽與編寫郵件的功能 * MSA (Mail Submission Agent) 郵件傳送代理人 - (Mail) Server 上面的軟體 1. 收受外部主機寄來的信件 > 既然是郵件主機,那麼『接收信件』想必就是主要的功能囉!呵呵,答對了!所以囉, MTA 最主要的功能就是收受外部來的信件,只要這個信件裡面有 MTA 內部的帳號時,那麼這封信就會被 MTA 收下來 2. 幫使用者傳送 ( 寄出 ) 信件 > 代表 Client 端的電腦不需 24 小時開著準備收信 ( MTA 間會互相傳遞信件,而非 MTA 傳給 MUA)[color=#e05e80] > 既然可以收信,那麼自然也就可以發信囉!沒錯啦!只要使用者具有合法的使用 MTA 的權力,那麼該使用者就可以利用這部 MTA 將他把信傳送出去!不過需要注意的是, **MTA 會將信件送給目的地的 MTA 而不是目的地的 MUA**喔!不要搞錯了!(註:曾經有個朋友跟我說,要我傳資料給他,而因為他要接收我的信件,所以他的電腦 "指的是 Windows 那個 Client 端的電腦" 得一直開著,真是不方便!聽到這句話時,害我嚇了一跳~這個觀念是不對的~因為使用者使用的是 MUA ,而信件『僅會送達到 MTA 主機上面』而已,收、發信件時,都需要透過 MTA 來幫忙處理的!所以,使用者在使用郵件編輯器"MUA"將資料編輯完畢之後,按下送出,並且成功的送到 MTA 之後,接下來的事情就是 MTA 的工作了,跟使用者的 Client 端這部電腦 "一點關係也沒有了" ) 3. 讓使用者自己的信可以收回去 > 使用者可以將放置在郵件主機的信件收到自己的個人電腦上面收看。 * MTA (Mail Transfer Agent) 郵件遞送代理人 - 將 MTA 所收受的信件,依照信件的流向 ( 送到哪裡去 ) 來將該信件放置到本機帳戶下的郵件檔案中 ( Mailbox ) - 或者是再經由 MTA 將這個信件送到下個 MTA 去 - 若是目的地為本機,還可具有**郵件分析 ( filtering )** 與其他相關的功能 > 如果你知道某個廣告信件的主旨都是固定的,例如『AV情色XXX』,你想將這種信件直接給他丟掉垃圾桶,可以嗎?當然可以囉!透過 MDA 郵件分析的功能,就可以將信件丟棄啦! > 如果有一天你要出差去,看樣子可能一個星期碰不到電子郵件了,但是你又不想讓一些朋友認為你在耍大牌都不回信的....這個時候你就可以利用 MDA 的功能,讓郵件主機分析到,當要送給你這個使用者的帳號的信出現時,就自動回覆一封回信,讓寄件者知道你在忙碌中....呵呵!這樣的功能是否很不錯呢?還不止這樣喔!其他的等一下後面再提吧! * Mailbox 『郵件信箱』 - 主機上面的一個目錄下的,某個人『專用』的信件收受檔案啦! > 舉個例子來說,系統管理員 root ,在預設的情況下,他會有個信箱,預設的檔案是在 /var/spool/mail/root 這個檔案就是了,一個帳號都會有一個自己的信箱喔! > 當 MTA 收到 root 的信時,就會將該封信件存到 /var/spool/mail/root 這個檔案中囉!使用者可以透過程式來將這個檔案裡面的信件資料讀取回去喔! ## mbox vs maildir - mbox to maildir `sudo apt install mb2md` - [mb2md](http://manpages.ubuntu.com/manpages/eoan/en/man1/mb2md.1.html) ```shell mb2md [-c] [-s sourcefile] [-d destdir] ``` `sudo mkdir /var/mail/zinxin_dir` - `sudo mb2md -s /var/mail/zinxin -d /var/mail/zinxin_dir` ![](https://i.imgur.com/ZMMi1DZ.png) - `sudo tree` ![](https://i.imgur.com/O6M44pO.png) | 比較 | Mbox | Maildir | Detail | -------- | -------- | -------- |-------- | | 可靠性 | :cry: | :smiley: |mbox只有一個檔案,一旦出問題之後,所有郵件都將損毀| | 更新速度 | :cry: | :smiley: |刪除/增加郵件的能力| | 搜尋速度 | :smiley: | :cry: |Mbox因為是單文件,因此搜索的能力要強於maildir| | 併發訪問能力 | :cry: | :smiley: |Mbox 有 file lock 的問題,需要 flock() 的支援,如果某個 process 訪問過久,那所有 process 都阻塞了(Maildir 在 NFS 等網路文件系統上相對安全)| | 擴充能力 | :cry: | :smiley: |Mbox應付那麼大的容量已力不從心,無疑Maildir是比較適合的| | 文件系統依賴 | :smiley: | :cry: |對於超大型的 maildir 讀寫性能會受到考驗(依賴對目錄的索引能力)| | 軟體支援 | sendmail | qmail/postfix |支持Maildir的軟體越來越多|

    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