Created
March 24, 2022 21:53
-
-
Save WolfangAukang/b45714514cac21d87e6b4dc8b8471eb8 to your computer and use it in GitHub Desktop.
Postfix setup for Amazon SES on NixOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ modulesPath, pkgs, ... }: { | |
# AWS Defaults | |
imports = [ "${modulesPath}/virtualisation/amazon-image.nix" ]; | |
ec2.hvm = true; | |
# Server | |
networking.hostName = "nixos-testing"; | |
boot.cleanTmpDir = true; | |
# Applications | |
environment.systemPackages = with pkgs; [ | |
mailutils | |
]; | |
services.postfix = { | |
enable = true; | |
# Using password and tls setup with postmap | |
config = { | |
smtp_sasl_auth_enable = "yes"; | |
smtp_sasl_security_options = "noanonymous"; | |
smtp_sasl_password_maps = "hash:/etc/postfix/saslpasswd"; | |
smtp_always_send_ehlo = "yes"; | |
smtp_use_tls = "yes"; | |
smtp_tls_security_level = "encrypt"; | |
smtp_tls_note_starttls_offer = "yes"; | |
smtp_tls_policy_maps = "hash:/etc/postfix/tls_policy"; | |
}; | |
relayHost = "email-smtp.us-east-1.amazonaws.com"; | |
relayPort = 587; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment