Skip to content

Instantly share code, notes, and snippets.

@nachoaguirre
Last active April 10, 2021 17:02
Show Gist options
  • Save nachoaguirre/4a4f75d9742beef136fdf53d5312b44a to your computer and use it in GitHub Desktop.
Save nachoaguirre/4a4f75d9742beef136fdf53d5312b44a to your computer and use it in GitHub Desktop.
AWS EC2 + SES + POSTFIX SMTP Working
# CONTENIDO DEL ARCHIVO /etc/postfix/main.cf
#myorigin = /etc/mailname
biff = no
append_dot_mydomain = no
#delay_warning_time = 4h
readme_directory = no
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file = /opt/bitnami/apache/conf/bitnami/certs/server.crt
smtpd_tls_key_file = /opt/bitnami/apache/conf/bitnami/certs/server.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
# aqui agregar el FROM DOMAIN que crearon en la validación del dominio
myhostname = mail.midominio.com
mydomain = midominio.com
mydestination = $myhostname
inet_interfaces = loopback-only
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
relayhost = [email-smtp.us-east-1.amazonaws.com]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
#mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
#recipient_delimiter = +
inet_protocols = all
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = encrypt
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_auth_enable = yes
smtp_use_tls = yes
smtp_tls_CAfile = /opt/bitnami/apache/conf/bitnami/certs/server.issuer.crt
mynetworks_style = subnet
smtpd_tls_CAfile = /opt/bitnami/apache/conf/bitnami/certs/server.issuer.crt
smtpd_recipient_restrictions = permit_mynetworks permit_inet_interfaces permit_sasl_authenticated permit_mx_backup
ignore_mx_lookup_error = yes
smtpd_helo_required = yes
empty_address_recipient = root
smtpd_delay_reject = no
broken_sasl_auth_clients = yes
smtpd_sasl_security_options =
recipient_delimiter =
; CONTENIDO DE /opt/bitnami/php/etc/php.ini
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = email-smtp.us-east-1.amazonaws.com
; http://php.net/smtp-port
smtp_port = 587
// CONTENIDO DE /opt/bitnami/php/lib/php/Mail/smtp.php
/**
* The SMTP host to connect to.
*
* @var string
*/
var $host = 'email-smtp.us-east-1.amazonaws.com';
/**
* The port the SMTP server is on.
*
* @var integer
*/
var $port = 587;
/**
* Should SMTP authentication be used?
*
* This value may be set to true, false or the name of a specific
* authentication method.
*
* If the value is set to true, the Net_SMTP package will attempt to use
* the best authentication method advertised by the remote SMTP server.
*
* @var mixed
*/
var $auth = true;
/**
* The username to use if the SMTP server requires authentication.
*
* @var string
*/
var $username = 'el usuario smtp generado en amazon ses';
/**
* The password to use if the SMTP server requires authentication.
*
* @var string
*/
var $password = 'la clave smtp generada en amazon ses';
/**
* Hostname or domain that will be sent to the remote SMTP server in the
* HELO / EHLO message.
*
* @var string
*/
var $localhost = 'midominio.com';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment