Can someone help me out here please. I have a CentOS 8 install, and am trying this line:
echo "Subject: Hello" | sendmail -v [email protected]
This is /etc/hostname
:
web.mydomain.com
This is /etc/resolv.conf
# Generated by NetworkManager
search mydomain.com
nameserver 1.1.1.1
nameserver 8.8.8.8
This is /etc/hosts
:
### Hetzner Online GmbH installimage
# nameserver config
# IPv4
127.0.0.1 localhost.localdomain localhost
11.22.33.44 web.mydomain.com web
#
# IPv6
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
11:22:33:44::5 web.mydomain.com web
(IP addresses obviously falsified for this post)
I have DNS A- and AAAA-records for web.mydomain.com
that point to the ip/ipv6 of the box.
I have corresponding reverse DNS entries set up at my host, Hetzner.
The output of that sendmail command is simply Mail Delivery Status Report will be mailed to <root>.
I'm logged in as root when I send it. Oddly I have a /var/spool/mail/mynamehere
file but not a /var/spool/mail/root
file?
As an aside, I have this at the bottom of /etc/aliases
(and have run newaliases
):
# Person who should get root's mail
root: [email protected]
If you can't tell already, I have NO idea what I'm doing. All I want right now is to be able to send emails to myself from various cron jobs. Maybe I should be sending them to root and letting the alias forward them on, but I've tried that as well (simply root
in place of [email protected]
) and it didn't seem to work any better?
Mydomain.com's email is handled by gmail, and I have no problem sending or receiving from that address from the gmail web interface.
This is /etc/postfix/main.cf
compatibility_level = 2
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = localhost
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix/samples
readme_directory = /usr/share/doc/postfix/README_FILES
smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem
smtpd_tls_key_file = /etc/pki/tls/private/postfix.key
smtpd_tls_security_level = may
smtp_tls_CApath = /etc/pki/tls/certs
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_security_level = may
meta_directory = /etc/postfix
shlib_directory = /usr/lib64/postfix