By Zonax7100
Hello,
I’m having some troubles setting up Postfix on my Ubuntu 14.04 x64. I have connected the server with Serverpilot, so the LAMP/LEMP stack is installed automatically. Serverpilot also installs Postfix on the server, and configures it to only allow the server itself send E-mails, which is great. Source here
My problem is:
I found a short tutorial, on how to use Sendgrid as SMTP host. Source here
So simply adding this to /etc/postfix/main.cf. Changed the username and password, of course.
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:yourSendGridUsername:yourSendGridPassword
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
header_size_limit = 4096000
relayhost = [smtp.sendgrid.net]:587
It gave an error, because relayhost is - by Serverpilot i guess - set to: relayhost = (So nothing). I did comment out the empty relayhost, so the Sendgrid could be used, and it seems to work.
Now, where I am a little lost, is how to change the sender domain, and name, and how to avoid spam filters.
Here is the main.cf, which is configured by Serverpilot, as far as I can tell. Now I just need to learn how to change the sender domain name, the sender name and be sure that I’m not getting into spam filters. Anyone know what my next step is? I’ve been looking at this, but I am not sure this is correct: Link1 Link2
# 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 (Ubuntu)
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
# 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_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = MYDOMAIN.COM
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost
# relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
local_transport = error:local delivery is disabled
smtp_helo_name = $myhostname.example.com
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:USERNAME:PASSWORD
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
header_size_limit = 4096000
relayhost = [smtp.sendgrid.net]:587
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
After a lot of trial and error, and 3 servers later, still not getting the results I would like. Can anyone cast some light on this issue?
Thank you! :-)
anyone who uses serverpilot, please join to the unofficial slack discussion community hub, for sharing experiences about doing missing (premium) features in free plan 😉
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.