0717.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Proxmox Email Notification Configuration</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="How To Configure Email Notifications In Proxmox VE,How To Setup Proxmox Email Notifications,Setup Email Notifications In Proxmox,Proxmox Email Setup,Proxmox Email Configuration,Home Lab,Hypervisor,Proxmox,Proxmox VE,Email,Notifications,GMail,SASL,Postfix,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Proxmox Email Notification Configuration">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="02/20/2023 03:19:03 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Proxmox Email Notification Configuration</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>Configuring User E-mail Address</h2>
  26. <ol>
  27. <li>In a web browser, navigate to the Proxmox web UI and login</li>
  28. <li>Select Datacenter &gt; Permissions &gt; Users from the left navigation menus</li>
  29. <li>Double click the user to configure</li>
  30. <li>Complete the E-mail field on the Edit User form &gt; Click OK</li>
  31. </ol>
  32. <h2>Simple Configuration via Web UI</h2>
  33. <p>By default, Proxmox will try to use the domain portion of the &quot;Email from address&quot; as the e-mail relay server.</p>
  34. <ol>
  35. <li>Select Datacenter &gt; Options from the left navigation menus</li>
  36. <li>Double click the Email from address field</li>
  37. <li>Enter the e-mail address that Proxmox will send outgoing e-mails from &gt; Click OK</li>
  38. <li>Expand Datacenter &gt; Select the node name &gt; Click Shell in the left navigation menus</li>
  39. <li>Run the following commands in the terminal
  40. <div class="codeBlock CMD"># send a basic test email<br />
  41. echo &quot;Test email from Proxmox: $(hostname)&quot; | /usr/bin/proxmox-mail-forward<br />
  42. # output the mail log<br />
  43. cat /var/log/mail.log</div>
  44. </li>
  45. <li>Notice the relay is the domain (i12bretro.local) from the Email from address setting</li>
  46. </ol>
  47. <h2>Advanced Configuration via CLI</h2>
  48. <p>To make more advanced configuration changes, like using a gmail account, you need to edit the postfix settings via command line</p>
  49. <ol>
  50. <li>Back in the Proxmox web shell, run the following commands in the terminal
  51. <div class="codeBlock CMD"># install libsasl<br />
  52. apt install libsasl2-modules -y<br />
  53. # edit the postfix config<br />
  54. nano /etc/postfix/main.cf</div>
  55. </li>
  56. <li>Press CTRL+W and search for mydestination</li>
  57. <li>Comment out mydestination by adding a # to the beginning of the line</li>
  58. <li>Press CTRL+W and search for relayhost</li>
  59. <li>Comment out relayhost by adding a # to the beginning of the line</li>
  60. <li>Update or add the following configuration
  61. <p>relayhost = smtp.gmail.com:587<br />
  62. smtp_use_tls = yes<br />
  63. smtp_sasl_auth_enable = yes<br />
  64. smtp_sasl_security_options =<br />
  65. smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd<br />
  66. smtp_tls_CAfile = /etc/ssl/certs/Entrust_Root_Certification_Authority.pem</p>
  67. </li>
  68. <li>Press CTRL+O, Enter, CTRL+X to write the changes</li>
  69. <li>Continue with the following commands in the terminal
  70. <div class="codeBlock CMD"># create /etc/postfix/sasl_passwd<br />
  71. nano /etc/postfix/sasl_passwd</div>
  72. </li>
  73. <li>Add a line to configure gmail authentication
  74. <p>smtp.gmail.com:587 &lt;%youraccount%&gt;@gmail.com:&lt;%yourpassword%&gt;</p>
  75. </li>
  76. <li>Press CTRL+O, Enter, CTRL+X to write the changes</li>
  77. <li>Continue with the following commands in the terminal
  78. <div class="codeBlock CMD"># update postfix lookup tables<br />
  79. postmap hash:/etc/postfix/sasl_passwd<br />
  80. # limit access to sasl_passwd to only root<br />
  81. chmod 600 /etc/postfix/sasl_passwd<br />
  82. # restart postfix service<br />
  83. systemctl restart postfix<br />
  84. # test from postfix directly<br />
  85. echo &quot;Test email from Proxmox: $(hostname)&quot; | mail -s &quot;Proxmox Testing&quot; &lt;%youraccount%&gt;@gmail.com<br />
  86. # send a test from proxmox<br />
  87. echo &quot;Test email from Proxmox: $(hostname)&quot; | /usr/bin/proxmox-mail-forward</div>
  88. </li>
  89. </ol>
  90. <p>Sources: <a href="https://forum.proxmox.com/threads/get-postfix-to-send-notifications-email-externally.59940/" target="_blank">https://forum.proxmox.com/threads/get-postfix-to-send-notifications-email-externally.59940/</a>,<br />
  91. <a href="https://www.reddit.com/r/homelab/comments/5nzmm3/setting_up_the_proxmox_email_alerts/" target="_blank">https://www.reddit.com/r/homelab/comments/5nzmm3/setting_up_the_proxmox_email_alerts/</a></p> </div>
  92. </div>
  93. </body>
  94. </html>