M
M
MoyMirok2021-07-14 16:03:01
Mail server
MoyMirok, 2021-07-14 16:03:01

How to set up a mail service in Ubuntu Server?

Hello. There is a task to send a message with a log from Ubuntu Server to the company's postal address (exchange 2019). Installed mailutils, the test message is wrapped, how to set it up correctly? (servers in different vlans)



# 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 www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
= smtpd_tls_key_file / etc / an ssl / the private / an ssl-the cert-snakeoil.key
smtpd_tls_security_level = may

smtp_tls_CApath = / etc / an ssl / the certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = the btree: $ {} data_directory / smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = hostname.domain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, domain, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8[::ffff:127.0.0.0]/104[: :1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = localhost
default_transport = error
relay_transport = error
inet_protocols = all

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MoyMirok, 2021-07-14
@MoyMirok

Looks like I had to commit tls options

A
Alexey Dmitriev, 2021-07-14
@SignFinder

It all depends on whether your server itself will send mail from itself, or will use another configured server for forwarding.
The settings for both options are googled.
Or, for example, you can generally use msmtp as mta, connecting to any created mailbox.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question