0

I am running an Ubuntu 20.04 LEMP Server. It is an Email and Web Server. I am having a puzzling warning in my postconf messages that I need help fixing.

When I run the command

postconf default_process_limit

it returns the warning message:

postconf: warning: /etc/postfix/main.cf: undefined parameter: mail

Below is my /etc/postfix/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)
smtpd_banner = $myhostname ESMTP
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

# TLS parameters
# Don't use self-signed certificates
#smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
#smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
#smtpd_tls_security_level=may

### Linuxbabe
# Enable TLS Encryption when Postfix receives incoming emails
smtpd_tls_cert_file=/etc/letsencrypt/live/mail.facl.xyz/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mail.facl.xyz/privkey.pem
smtpd_tls_security_level=may
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache

### Linuxbabe
#Enable TLS Encryption when Postfix sends outgoing emails
smtp_tls_security_level = may # Original by Linuxbabe. Use this if emails break.
#smtp_tls_security_level = encrypt
smtp_tls_loglevel = 1
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

### Linuxbabe
#Enforce TLSv1.3 or TLSv1.2
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1

# Default 3 = uncommented
#smtp_tls_CApath=/etc/ssl/certs
#smtp_tls_security_level=may
#smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# The below line prevents you from being an open relay, which means that your mail server wont forward email on behalf of anyone towards any destination, like open relays do.
# This line tells Postfix to forward email only from clients in trusted networks, from clients that have authenticated with SASL, or to domains that are configured as authorized relay destinations.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, localhost
relayhost =
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 = ipv4
message_size_limit = 104857600

#### Linuxbabe
# Tell Postfix to deliver incoming emails to local message store via the Dovecot LMTP server.
mailbox_transport = lmtp:unix:private/dovecot-lmtp
# Disable SMTPUTF8 in Postfix, because Dovecot-LMTP doesn't support this email extension
smtputf8_enable = no

### Linuxbabe Chapter 3
virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf
virtual_mailbox_maps =
   proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf,
   proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
virtual_alias_maps =
   proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf,
   proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf,
   proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf

### Linuxbabe chapter 3
virtual_transport = lmtp:unix:private/dovecot-lmtp

### Linuxbabe Chapter 3
# The first line defines the base location of mail files. The remaining 3 lines
# define which user ID and group ID Postfix will use when delivering incoming
# emails to the mailbox. We use the user ID 2000 and group ID 2000.
virtual_mailbox_base = /var/vmail
virtual_minimum_uid = 2000
virtual_uid_maps = static:2000
virtual_gid_maps = static:2000

### Linuxbabe Chapter 3 Ending
# By default, any local user can use the sendmail binary to submit outgoing emails.
# Now that your mail server is using virtual mailboxes, you might want to restrict
# access to the sendmail binary to trusted local users only, so a malicious user
# can’t use it to send a large volume of emails to damage your mail server’s reputation
authorized_submit_users = root,www-data,ubuntu,netdata

# deliver emails to local message store via the dovecot LMTP server (roundcube tutorial, sieve section, linuxbabe)
mailbox_transport = lmtp:unix:private/dovecot-lmtp
# disables SMTPUTF8 in Postfix, because Dovecot-LMTP doesn’t support this email extension (roundcube tutorial, seive section, linuxbabe)
smtputf8_enable = no

### Linuxbabe, rouncube tutorial, sieve section
# Help remove sensitive info (such as roundcube version number) from email headers
# This line is overridden by smtp_header_checks line at bottom of page
#smtp_header_checks = regexp:/etc/postfix/smtp_header_checks

### LINUXBABE CHAPTER 4
# The first line specifies the Postfix policy agent timeout setting. The following lines will impose a restriction on incoming emails by rejecting unauthorized email and checking SPF record.
policyd-spf_time_limit = 3600
smtpd_recipient_restrictions =
   permit_mynetworks,
   permit_sasl_authenticated,
   reject_unauth_destination,
   check_policy_service unix:private/policyd-spf,
### LinuxBabe Chapter "7 Effective Tips for Blocking Email Spam with Postfix SMTP Server"
   # Make Postfix use the Postgrey policy server.
   check_policy_service inet:127.0.0.1:10023,
   # Tip #6, Whitelisting
   check_client_access hash:/etc/postfix/rbl_override,
### LinuxBabe Chapter ""7 Effective Tips for Blocking Email Spam with Postfix SMTP Server"
   # Tip #6: Using Public Realtime Blacklists
   reject_rhsbl_helo dbl.spamhaus.org,
   reject_rhsbl_reverse_client dbl.spamhaus.org,
   reject_rhsbl_sender dbl.spamhaus.org,
   # The single line below is for public whitelisting, with dnswl whitelisting by ip address
   permit_dnswl_client list.dnswl.org=127.0.[0..255].[1..3],
   # The single line below is for whitelisting, however, if using spamhaus.org for blacklisting, then you don't need this on a whitelist as it is impossible for an IP address to be listed in Spamhaus whitelist and blacklist at the same time.
   #permit_dnswl_client swl.spamhaus.org,
   reject_rbl_client zen.spamhaus.org

### LINUXBABE CHAPTER 4
# Milter configuration for Postfix to be able to call OpenDKIM via the milter protocol.
#milter_default_action = accept
#milter_protocol = 6
#smtpd_milters = local:opendkim/opendkim.sock
#non_smtpd_milters = $smtpd_milters

### Linuxbabe Chapter "7 Effective Tips for Blocking Email Spam with Postfix SMTP Server"
## Tip #1
smtpd_sender_restrictions =
   permit_mynetworks
   permit_sasl_authenticated
## Tip #4
   # Add the following line to reject email if the domain name of the address supplied with the MAIL FROM command has neither MX record nor A record.
   reject_unknown_sender_domain
   # This directive rejects an email if the client IP address has no PTR Record.
   reject_unknown_reverse_client_hostname
## Tip #3
   # A legitimate email server should have an IP address returned from an A record, that matches the IP address of the email server.
   # To filter out emails from hosts that don't have a valid A record (IP doesnt match that of the server) add the following two lines below.
   #reject_unknown_reverse_client_hostname # Duplicate from above.
   reject_unknown_client_hostname
   # ^^^ NOTE: reject_unknown_client_hostname does not require HELO from SMTP client. It will fetch the hostname from PTR record, then check the A record.

## Tip #2
# Add the following line to require the client to provide a HELO/EHLO hostname.
smtpd_helo_required = yes
# Add the following 3 lines to enable smtpd_helo_restrictions
smtpd_helo_restrictions =
   permit_mynetworks
   permit_sasl_authenticated
   # Ocasionally, a legitimate mail server doesn't have a valid A record for the HELO/EHLO hostname. You need to whitelist them with the line below ("check_helo_access" directive).
   # Don't forget to add whitelisted domains the the helo_access whitelist file, located at /etc/postfix/helo_access
   check_helo_access hash:/etc/postfix/helo_access
   # Use the following line to reject clients who provide malformed HELO/EHLO hostname.
   reject_invalid_helo_hostname
   # Use the following line to reject non-fully qualified HELO/EHLO hostname.
   reject_non_fqdn_helo_hostname
   # Use the following line to reject emails when the HELO/EHLO hostname has neither DNS A records nor MX Records.
   reject_unknown_helo_hostname

### Linuxbabe, Chapter "Block Email Spam with Postfix and SpamAssassin Content Filter"
# Use header checks with PCRE
header_checks = pcre:/etc/postfix/header_checks
body_checks = pcre:/etc/postfix/body_checks

# Milter configuration (Note: Order of these matters. Don't change the order.)
# https://www.linuxbabe.com/mail-server/block-email-spam-check-header-body-with-postfix-spamassassin
milter_default_action = accept
milter_protocol = 6
smtpd_milters = local:opendkim/opendkim.sock,local:opendmarc/opendmarc.sock,local:spamass/spamass.sock
# If you haven't configured openDmarc you should remove local:opendmarc/opendmarc.sock from smtpd_milters in /etc/postfix/main.cf
#smtpd_milters = local:opendkim/opendkim.sock,local:spamass/spamass.sock
non_smtpd_milters = $smtpd_milters

### LInuxbabe "Spamassassin and Sieve Chapter"
# You can use smtp_header_checks to delete email headers that could show sensitive information.
# smtp_header_checks are only applied when Postfix is acting as an SMTP client, so it won’t affect incoming emails.
# You might not want the recipient to know that you are using SpamAssassin on your mail server.
# So add the following line, which tells Postfix to delete the X-Spam-Status and X-Spam-Checker-Version header
# from the email message when sending emails
smtp_header_checks = pcre:/etc/postfix/smtp_header_checks

### Linuxbabe "Postfix-amavis" chapter
# This tells Postfix to turn on content filtering by sending every incoming email message to Amavis, which listens on 127.0.0.1:10024.
content_filter = smtp-amavis:[127.0.0.1]:10024
# This will delay Postfix connection to content filter until the entire email message has been received, which can prevent content filters from wasting time and resources for slow SMTP clients.
smtpd_proxy_options = speed_adjust

# This setting was added by admin to fix "SPF: HELO does not publish an SPF Record" on mail-tester.com
smtp_helo_name = $mail.example.com

What does this warning mean and how can I fix it? Do I have errors somewhere in my postfix files and what exactly should I be looking for?

Thanks for any help!

2
  • 1
    Please provide your /etc/postfix/main.cf. Jun 14, 2022 at 5:35
  • @GeraldSchneider I have added my main.cf file to the original post.
    – DanRan
    Jun 14, 2022 at 15:24

2 Answers 2

3

Your last line is

smtp_helo_name = $mail.example.com

But you don't have any variable $mail defined. Use the actual DNS name of your mail host, not a variable.

3
  • I'm not exactly sure what this means. I'm still very noob and have been following tutorials. What exactly would be the DNS name of my host? Because in my /etc/hosts file I have "127.0.0.1 mail.example.com" listed, and thet is my fqdn, that I use in all of my postfix conf files. How do I find that actual DNS name of my mail host? And what exactly is a variable? Is the variable $mail.example.com? Should I just change it to "mail.example.com"? I'm confused. Thank you for the replies by the way.
    – DanRan
    Jun 15, 2022 at 7:04
  • Yes, if mail.example.com is your DNS record, and more importantly, your reverse DNS record, then that is exactly what you need to do. Just remove the $. Jun 15, 2022 at 7:08
  • thank you this worked. i willadd it as an answer
    – DanRan
    Jun 15, 2022 at 11:12
0

My last line in /etc/postfix/main.cf file was smtp_helo_name = $mail.example.com, but I didn't have a $mail variable defined. Since my mail host is actually called mail.example.com I just had to eliminate the $ before my actual dns name of my mail host. After this, my line changed from this:

smtp_helo_name = $mail.example.com

to this:

smtp_helo_name = mail.example.com

Then the warning in the original post no longer appeared.

You must log in to answer this question.

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