1

Topic: System emails (CRON) being sent to incorrect email address...

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.7 MYSQL edition
- Linux/BSD distribution name and version:  Ubuntu 16.04.4 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro?  No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

During initial configuration I inadvertently configured the server to be mail.example.com instead of just example.com. 
Somehow the the system is now sending system emails (like from CRON) to root@mail.example.com.  I have triedeverywhere I can think in order to get these going to root@example.com but to no avail.  While this isn't a iRedMail issue exactly, I am thinking that it was due to my improper configuration the first time around.  The server is working great now, properly configured with multiple domains sending and receiving emails. 

For the life of me I am just unable to figure out how to solve this issue.  Does anybody have any suggestions?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: System emails (CRON) being sent to incorrect email address...

You need to change the hostname of your server. Cron mails are sent to the cron user ("root") at your servers hostname ("mail.example.com").

3 (edited by dejavux 2018-03-21 03:57:28)

Re: System emails (CRON) being sent to incorrect email address...

hws wrote:

You need to change the hostname of your server. Cron mails are sent to the cron user ("root") at your servers hostname ("mail.example.com").

Well... that's not it.  My hostname is somethingElse.example.com.  And as I said the emails are going to mail.example.com.

This is either not the case or I have something else misconfigured.  hmm

More Info:  Logwatch emails are going to the correct email address - root@example.com. As configured in the logwatch.conf which is probably not relevant.

4

Re: System emails (CRON) being sent to incorrect email address...

Have a look at https://docs.iredmail.org/change.server.hostname.html
maybe some hints there

5

Re: System emails (CRON) being sent to incorrect email address...

Check:
postconf | grep mydomain
postconf | grep myhostname
hostnamectl

6

Re: System emails (CRON) being sent to incorrect email address...

swejun wrote:

Check:
postconf | grep mydomain
postconf | grep myhostname
hostnamectl

I'd already changed the postconf values to remove the "mail."  I've checked all of the files for "mail.", even did a grep -R in the etc directory.

I will go over the list in the link you provided tomorrow to double check.  Most look familiar, but I will go over them again to double check.

Thanks!

7

Re: System emails (CRON) being sent to incorrect email address...

Just one idea, check /etc/mail.rc
It is used by mailx client. Look for entries like:
  set from=root@x.x.x.x.x   <----------
   set smtp=smtp://f.q.d.n

8

Re: System emails (CRON) being sent to incorrect email address...

swejun wrote:

Just one idea, check /etc/mail.rc
It is used by mailx client. Look for entries like:
  set from=root@x.x.x.x.x   <----------
   set smtp=smtp://f.q.d.n

I made an addition to the crontab file of MAILTO=xxx@yyy.com.  I received a cron email this morning.  So, progress...