I’m using the web console diagnostics page to send a test email, but it’s not working.
“root” is automatically entered in the “mailbox to test” box.
I have an alias configured for “root@” to point to dave@domain.org.uk domain.org.uk is configured on the email tab.
If i send a message from the command line using echo "subject: test" | sendmail -v root@domain.org.uk
that does arrive in the dave@domain.org.uk mailbox.
I’ve tried changing the /etc/postfix/virtual entry to root@ dave@domain.org.uk
then issuing postmap /etc/postfix/virtual and then postfix reload, but email from the diagnostic page isn’t delivered to dave@domain.org.uk
why can’t i test email delivery from the diagnostic page of the web interface?
NethServer uses a template system to write config files. Config files are rewritten on updates/reboot. You may customize your config with custom templates:
hello @mrmarkuz
Thank you for the reply. I’ve added a real email address to the root user profile, just as you suggested. Now I get delivery reports for every message routed through my mail server. The server is using getmail and routing email via sendmail, so I get a delivery report for every message.
thank you for the information about the template system, please note I manually changed the config files but did not do anything via the web interface to trigger a refresh of the config files. So I assume my manual changes to the postmap wern’t overwritten.
why does setting an alias for root through the web config not work?
Yes, but they will be overwritten. You may restore the original config file with expand-template /etc/postfix/virtual
What do you want to do exactly? What’s the goal?
You may set root as destination for a mail alias so mails to an email address like alias@domain.tld go to root.
An alias usually is a mail address. root is a system user and a special case.
Maybe the name of the config file creates some confusion. In the root profile page you change /etc/aliases. In the mail aliases page you change /etc/postfix/virtual.
I’m trying to ensure that if the system sends an email to root, that message goes to a system user.
e.g. if an error occurs and an error report is sent to root I want that message sent to a system user. That’s why I’ve configured an alias that should send email addressed to root@ to dave@domain.org.uk, but it doesn’t.
Does the system send error reports via email to root?
Hello mrmarkuz,
Thanks again for your reply.
I’ve noticed that some of the system cron jobs dont send their output to the null device, so they send their output to root - which is why i’m getting lots of system messages.
e.g. some cron jobs have &>/dev/null after them, to make them send their output to null. Other cron jobs don’t have this and therefore generate system messages.
I think this is because root@ is expanded like root@$(hostname -d) (only domain part), whilst a local user name (i.e. root) is expanded to root@$(hostname) (the host FQDN). This leads to very different mail recipients!
In other words, by defining a root@ alias you are not obtaining what you expect. Instead, like @mrmarkuz said, go to the root’s Profile page and set the email forward address.
I think we’re lacking a documentation page for this …