Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Help about MediaWiki
FUTO
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Introduction to a Self Managed Life: a 13 hour & 28 minute presentation by FUTO software
(section)
Main Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Step 13: Get emails with voicemails using Postfix with Postmark SMTP Relay == We are not doing the 1990s calling into voicemail system nonsense. That is miserable. <gallery mode="packed-hover" heights=250 widths=400 perrow=2> File:lu67917r1ezu_tmp_aaeb276e.png File:lu67917r1ezu_tmp_8c59ac9.png File:lu67917r1ezu_tmp_8cb7f78.png </gallery> <span id="configure-the-from-address-in-freepbx"></span> ==== 13.1 Configure the FROM Address in FreePBX ==== # Log into your FreePBX web interface. # Navigate to '''Settings → Voicemail Admin'''. # Click the '''Settings''' tab. # Click on the '''Email Config''' tab. # Set the '''Server Email''' to an email address of your choice. #* I suggest this address be within the domain of the email you set up in mailcow. #* For instance, if you set up an email for yourself called [http://steve@stevesavers.com '''steve@stevesavers.com'''] in mailcow, make this '''voicemails@stevesavers.com'''. # Click '''Submit''', then '''Apply Config''' (red button in the upper right corner). <gallery mode="packed-hover" heights=250 widths=400 perrow=2> File:lu67917r1ezu_tmp_7c7fe30c.png File:lu67917r1ezu_tmp_926f2cd4.png File:lu67917r1ezu_tmp_82ab253e.png File:lu67917r1ezu_tmp_302269b1.png File:lu67917r1ezu_tmp_5b69f714.png File:lu67917r1ezu_tmp_4ea2455d.png </gallery> <span id="configure-user-access-to-voicemail"></span> ==== 13.2 Configure user access to voicemail ==== # Navigate to '''Admin —> User Management'''. # Click '''Edit''' next to the user. #* Click the '''User Details''' tab at the top. #** Check that the email address is correct. #* Click the '''UCP''' tab at the top. #** Click the '''Call History''' sub-tab. #*** In '''CDR Access''', add the extensions for which you want to allow this user to listen to call recordings. So if your extension is '''401''', then '''401''' should be in this list. #*** Set '''Allow CDR''' to '''Yes'''. #*** Set '''Allow CDR Downloads''' to '''Yes'''. #*** Set '''Allow CDR Playback''' to '''Yes'''. #** Click the '''Voicemail''' sub-tab. #*** Make sure every option here is set to '''Yes'''. #*** In '''Allowed Voicemail''', make sure that your extension is in the list. So if your extension is '''401''', then '''401''' should be in this list. #* Click '''Submit''', then '''Apply Config''' (red button in the upper right corner). <gallery mode="packed-hover" heights=250 widths=400 perrow=2> File:lu67917r1ezu_tmp_dd6f816d.png File:lu67917r1ezu_tmp_653952c.png File:lu67917r1ezu_tmp_d77e3b32.png File:lu67917r1ezu_tmp_56847681.png File:lu67917r1ezu_tmp_aa85fde6.png File:lu67917r1ezu_tmp_6bcaece6.png File:lu67917r1ezu_tmp_abb6e1ff.png File:lu67917r1ezu_tmp_df1ec9c8.png </gallery> <span id="configure-extension-for-voicemail"></span> ==== 13.3 Configure extension for voicemail ==== # Navigate to '''Connectivity —> Extensions''' #* Choose your extension # Go to '''Voicemail''' #* Set your '''Voicemail password''' #* Set the '''Email Address''' to the email address you want it to email. #* Click '''Submit''', then '''Apply Config''' red button in the upper right corner # Click '''UCP''' on the top menu to enter the User Control Panel #* Click the plus sign in the upper left to add a panel. #* Choose '''Voicemail.''' #* Choose your extension, in this case, '''401''' #* Go to the little gear on the upper right corner of the panel you just added to open the '''settings''' menu #* Make sure '''Email Attachment''' is '''On''' #* '''Email Address''' should be the address that you want voicemails to go to. <span id="get-postmark-credentials-for-smtp-relay"></span> ==== 13.4 Get Postmark Credentials for SMTP relay ==== We are using Postmark for SMTP relay so our emails are not immediately rejected by most providers. # Go to postmarkapp.com # Log in and click Servers # Click onto the server you made earlier. # Click '''Default Transactional Stream''' # Navigate to the '''Setup Instructions page''' after clicking onto your message stream. #* Under '''“Pick the library or integration”''' – pick “SMTP”. #* '''This is the same thing we did when we set up mailcow with Postmark for SMTP relay in the mailcow section!''' #* Take note of these, as we will be using them with FreePBX <span id="modify-postfix-configuration"></span> ==== 13.5 Modify Postfix Configuration ==== <ol style="list-style-type: decimal;"> <li><p>Edit the main configuration file:</p> <pre>sudo nano /etc/postfix/main.cf</pre></li> <li><p>Find and modify/add these lines. Keep everything elsein the <code>main.cf</code> file unchanged. Adjust the <code>sender_canonical_maps = static:voicemailalert@stevesavers.com</code> to the email address you wish to use.</p></li></ol> <pre>relayhost = [smtp.postmarkapp.com]:587 smtp_use_tls = yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_sasl_mechanism_filter = plain sender_canonical_maps = static:voicemailalert@stevesavers.com</pre> <span id="set-up-authentication"></span> ==== 13.6 Set Up Authentication ==== <ol style="list-style-type: decimal;"> <li><p>Ssh into the FreePBX virtual machine:</p> <pre>ssh louis@192.168.5.6</pre></li> <li><p>Create/edit the SASL password file:</p> <pre>sudo nano /etc/postfix/sasl_passwd</pre></li> <li><p>Add this line (replace <code>USERNAME:PASSWORD</code> with your Postmark credentials):</p> <pre>[smtp.postmarkapp.com]:587 USERNAME:PASSWORD</pre></li> <li><p>Create the hash database and set permissions:</p> <pre>sudo postmap /etc/postfix/sasl_passwd sudo chmod 600 /etc/postfix/sasl_passwd*</pre></li></ol> <span id="restart-postfix"></span> ==== 13.7 Restart Postfix ==== <pre>sudo systemctl restart postfix</pre> <span id="test-configuration"></span> ==== 13.8 Test Configuration ==== Send a test email: <pre>cat << EOF | sendmail l.a.rossmann@gmail.com From: voicemailalert@stevesavers.com To: l.a.rossmann@gmail.com Subject: Test Email Content-Type: text/plain X-PM-Message-Stream: outbound This is a test email body. EOF</pre> Check mail logs for errors: <pre>sudo tail -f /var/log/mail.log</pre> <span id="troubleshooting"></span> ==== Troubleshooting ==== If emails aren’t sending: # Check <code>/var/log/mail.log</code> for errors # Check that Postmark credentials are correct (if you typed <code>postmark.com</code> instead of <code>postmarkapp.com</code> for server, etc) # Verify sender domain (<code>stevesavers.com</code>) is properly configured in Postmark # Check the activity tab on the transactional stream in Postmark # Mail log will tell you what you fkd up 99% of time. <div class="figure"> <gallery mode="packed-hover" heights=250 widths=400 perrow=2> File:lu67917r1ezu_tmp_923a1598.png </gallery> </div> !(Postmark Activity monitor](old/images/lu67917r1ezu_tmp_f60bd933.png) !(Postmark Activity monitor](old/images/lu67917r1ezu_tmp_c39a116d.png) <span id="postmark-activity-monitor"></span> ===== Postmark Activity Monitor: ===== If you want more troubleshooting information, check Postmark. # Log into Postmark. # Click '''Servers''' # Click onto the server you made. # Click onto your '''Default Transactional Stream''' # Click '''Activity''' # Poke around. <span id="default-etcpostfixmain.cf-config-file"></span> ==== Default /etc/postfix/main.cf config file ==== Just in case you mess something up, here’s the default one, because the ones in /usr/share/postfix require configuration from scratch. What they mean when they say ''“more complete”'' version is ''“we don’t offer a copy anywhere of the just working version”'', because it’s… GNU/Linux. <pre># See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) biff = no # appending .domain is the MUA's job. append_dot_mydomain = no # Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h readme_directory = no # See http://www.postfix.org/COMPATIBILITY_README.html -- default to 3.6 on # fresh installs. compatibility_level = 3.6 # TLS parameters smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_security_level=may smtp_tls_CApath=/etc/ssl/certs smtp_tls_security_level=may smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination myhostname = debian.home.arpa alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases mydestination = $myhostname, debian, localhost.localdomain, localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + # WARNING: Changing the inet_interfaces to an IP other than 127.0.0.1 may expose Postfix to external network connections. # Only modify this setting if you understand the implications and have specific network requirements. inet_interfaces = 127.0.0.1 inet_protocols = all message_size_limit = 102400000</pre> <span id="self-hosted-bitwarden-password-manager"></span>
Summary:
Please note that all contributions to FUTO may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
FUTO:Copyrights
for details).
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:
Cancel
Editing help
(opens in new window)