0

I'm very much a linux noob and greatly appreciate any help and patience you can provide.

I'm running Ubuntu 21.04

Email setup instructions from web host:

I'm trying to setup mail to be sent via postfix.

This is my configuration from:

nano /etc/postfix/main.cf
# 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

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2


smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = <mydomain>.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, mail.<mydomain>.com, <computer name>, localhost.localdomain, localhost
relayhost = [mail.<mydomain>.com]:465
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all


# Enable SASL authentication
smtp_sasl_auth_enable = yes
# Disallow methods that allow anonymous authentication
smtp_sasl_security_options = noanonymous
# Location of sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

# Enable STARTTLS encryption
smtp_use_tls = yes

# where to find CA certificates
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

smtp_tls_wrappermode = yes

smtp_tls_security_level = encrypt

I send a test email by running:

echo "Test Mail" | mail -s "Test Email" <[email protected]>

However, I never receive the email (I've checked my spam folder).

Here is the output of the

nano /var/log/mail.log
Aug 22 01:01:13 <computername> postfix/pickup[1396540]: 1F77980FA1: uid=1000 from=<<user>@<computername>>
Aug 22 01:01:13 <computername> postfix/cleanup[1396964]: 1F77980FA1: message-id=<20210822050113.1F77980FA1@<mydomain>.com
Aug 22 01:01:13 <computername> postfix/qmgr[1396541]: 1F77980FA1: from=<user>@<computername>, size=347, nrcpt=1 (queue active)
Aug 22 01:01:13 <computername> postfix/smtp[1396966]: warning: database /etc/postfix/sasl_passwd.db is older than source file /etc/postfix/sasl_passwd
Aug 22 01:01:14 <computername> postfix/smtp[1396966]: 1F77980FA1: to=<[email protected]>, relay=mail.<mydomain>.com[<ip address>]:465, delay=1.2, delays=0.07/0.08/0.74/0.27, dsn=2.0.0, status=sent (250 OK id=1mHfbe-001L4X-3a)
Aug 22 01:01:14 <computername> postfix/qmgr[1396541]: 1F77980FA1: removed

Thanks in advance for any assistance you might be able to provide.

1
  • As it turns out, the above configuration IS working. The test email address I was using was apparently blocking the email completely (maybe because I don't have a static IP address?) sending the test email to another account was received correctly.
    – youngfong
    Aug 23, 2021 at 14:12

1 Answer 1

0

Yes, this configuration is correct.

0

Not the answer you're looking for? Browse other questions tagged .