Skip to content

Instantly share code, notes, and snippets.

@DavidePrincipi
Last active December 22, 2015 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DavidePrincipi/b557fddba1554dabe857 to your computer and use it in GitHub Desktop.
Save DavidePrincipi/b557fddba1554dabe857 to your computer and use it in GitHub Desktop.
NethServer mail configuration for Office365 (experimental)
#
# 90smarthosts_accounts (template-custom)
# /etc/e-smith/templates-custom/etc/postfix/main.cf/90smarthosts_accounts
#
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/relaymaps
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
{
#
# 40smarthosts_accounts (custom templates)
# /etc/e-smith/templates-custom/postfix/postmap/40smarthosts_accounts
#
push @postmapList, qw(relaymaps);
'';
}
#
# 90smarthosts_accounts
# /etc/e-smith/templates-custom/etc/postfix/relaymaps/90smarthosts_accounts
#
# This line is an example: replace it with actual data
#
first.user@{$DomainName} smtp.gmail.com:587
#
# 90smarthosts_accounts (custom-template)
# /etc/e-smith/templates-custom/etc/postfix/sasl_passwd/90smarthosts_accounts
#
# This line is an example: replace it with actual data
#
first.user@{$DomainName} isp_username:isp_password
#
# 90accounts_smarthosts (template-custom)
# /etc/e-smith/templates-custom/etc/postfix/tls_policy/90accounts_smarthosts
#
# This line is an example: replace it with actual data
#
smtp.gmail.com:587 encrypt
@DavidePrincipi
Copy link
Author

This is an experiment DON'T use it on production

  • Copy each template fragment to its location under templates-custom, as reported in the comment
  • Edit each file replacing its contents with your site setup
  • To re-configure Postfix, execute the following commands:

    expand-template /etc/postfix/relaymaps
    signal-event nethserver-mail-common-save

Original idea from Linux4All:
http://community.nethserver.org/t/custom-templates-are-not-working/2374?u=davidep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment