3

I'm having issues sending emails from my localhost domain to outbound email servers (gmail, yahoo, etc). I can send emails inbound but when I try to send an email test to my gmail account it doesn't work. Is it possible to send outbound emails with postfix, it's been very frustrating, I've been trying it during 2 days, I would appreciate some help. This is my main.cf file:

# 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_un$
myhostname = Server
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.mydomainlocalhost.com, Server, localhost.localdomain, localhost, domain.c$
#relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24
mailbox_size_limit = 0
recipient_delimiter = +
myhostname = Server
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.mydomainlocalhost.com, Server, localhost.localdomain, localhost, domain.c$
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
smtpd_sasl_type = dovecot
0

Based on your mail.cf your mail server user dovecot, ssl, private cert ...

Maybe is good solution to start from beginning with manual you have or with new.

I don't known what you wish/need.

For the first aid try to run

sudo dpkg-reconfigure postfix

and fallow wizard

1) Choose 'Internet with smarthost' (recommended) to use another mail server for relaying mail 

2) Enter system mail name (mail.your_domain.com)

3) Enter SMTP relay host (your_isp_smtp_server.com)

4) Root and postmaster mail recipient (user@domail.com)

5) Other destinations to accept mail for (mail.your_domain.com, localhost.foo.tld, localhost)

6) Force synchronous updates on mail queue (No)

7) Local networks (127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128)

9) Mailbox size limit (bytes) (0)

10) Local address extension character (+)

11) Internet protocols to use (ipv4 is the safe choice)

Try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.