Page 1 of 1

Cron Emails Stopped After Net Adapter Change

Posted: 2019/11/01 18:17:18
by thomas.deans
I have a PC/CentOS7 Server hosting my website from home. I have a Shell script updating my DNS for my website and several other services running. When I initially setup this server it was residing my my master bedroom on my TV table and we did not have access to wired ethernet in that room so i setup my server with a static wifi connection and this worked fine and I hardly ever lost connection. Sometimes a putty session woud stay open from work 50 miles away for several days without dropping. However now finding myself doing multiple large file tranfers per day and a lof of tunnel traffic over SSH I decided it was time to move it and hard wire it.

Last evening I shutdown and moved my server into my great room television cabinet and plugged into my Gig switch in there. I logged in and opened a terminal and went into nmtui and deactivated my wifi card. I then activated my eth0 card, inputting the same static IP, DG and DNS which I had on the wlan2 card, as I have Nat rules in my router already for web, ssh and mail routing.

I turned wifi off on my phone, remoted to work and tested ssh and was able to get a prompt no problem and i also am able to pull up my website from an outside domain.

the problem now is I am no longer receiving email notifications of my cron jobs that backup my website twice daily.

Services running:
Cron (duplicity backup to google drive, DNS updater for web domain)
nginx for tor
httpd for web
fail2ban/iptables for ssh brute forcers

I'm fairly confident that there is something somewhere looking at the wlan interface card and that needs to be changed to the eth0, however I dont know or recall where or what. Any help would be apprecciated!

Re: Cron Emails Stopped After Net Adapter Change

Posted: 2019/11/01 19:03:26
by TrevorH
Are you getting any emails at all?

Check the contents of /var/log/cron to make sure your cronjobs are actually running. Check the contents of /var/log/maillog to see what happens to them if so.

Nothing that I'm aware of tends to use interface names to base traffic on.

Re: Cron Emails Stopped After Net Adapter Change

Posted: 2019/11/02 06:16:27
by hunter86_bg
You can verify the configuration of your postfix via:

Code: Select all

echo TEST | mail -s TEST ''
sleep 5
postqueue -p

Re: Cron Emails Stopped After Net Adapter Change

Posted: 2019/11/04 13:55:29
by thomas.deans
Sorry for the delay, I am legally blind so I am not able to use the computer except during the week on my breaks at work.

I realized something over the weekend. I recently October 26th updated my debit card for autorenewal at godaddy, where I was paying for two domains, both hosted on this server via virtual clauses in httpd. both were setup with MX records in the DNS management at godaddy on cpanel. I decided to let one domain expire, and I believe thats around when the mail stopped.

Here is a tail of the maillog:

Code: Select all

[root@my my]# tail -20 /var/log/maillog
Nov  4 07:14:49 my postfix/smtp[27643]: B960D20A71E4: to=<>, orig_to=<root>, relay=none, delay=101387, delays=101387/0.35/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for type=MX: Host not found, try again)
Nov  4 07:39:49 my postfix/qmgr[2480]: E115420A71D9: from=<>, size=14713, nrcpt=1 (queue active)
Nov  4 07:39:49 my postfix/smtp[27985]: E115420A71D9: to=<>, orig_to=<my>, relay=none, delay=290377, delays=290377/0.37/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for type=MX: Host not found, try again)
these just repeat

Primary domain is the one i kept, secondary i let expire.

in Httpd config I have main and secondary as virtual hosts and mail from from the server is to the primary domain email addresses. email is setup as a forwarder with catchall on and .....

I just realized as i was typing. Secondary domain had a "mailbox" as well as the forwarder. I didnt use the mailbox except to route mail for me, it was through asia. I suppose my MX recorders were set the same for both domains. I may have to sign up for email on my primary domain for this to begin working again. Other than just verification that im receiving backups I really dont need email to flow from this server, fail2ban emails never worked anyay. Is there some other application I could install to have mail go through google, etc Id still like to get email verification of backup jobs, and DNS ip changes for my domain. Since im hosting from home IP changes for the www host a recoprd are handled with a shell script that does a godaddy API update.

Re: Cron Emails Stopped After Net Adapter Change

Posted: 2019/11/05 18:33:39
by thomas.deans
So it was related to the Netwprk change afterall. While troubleshooting POSTFIX issues and trying to setup mailrelay via gmail, I ran across a webpost how to which started with troubleshooting and making sure DNS was working. It seems somehow when i changed the wifi to eth0 via nmtui I missed or skipped setting the DNS lines. Therefore no name resolution was working on that aspect. After fixing that today and testing a few things, I found that POSTFIX really doesnt support or like STARTTLS. So i turned off postfix and stopped it and replaced that mta with a new mta called ssmtp which does support STARTTLS via gmail. Ive configured this and tested it and have received a few test emails.

I have updated alternatives to set my default mta to ssmtp, and now I am waiting on a cron job this evening to verify local mailflow is forwarding to my gmail via ssmtp, then i i can tackle the problem of fail2ban having never sent any email since implementation.

Re: Cron Emails Stopped After Net Adapter Change

Posted: 2019/11/05 19:00:18
by TrevorH
Just to clear it up: postfix does STARTTLS just fine. It's currently the default RHEL MTA on all supported versions so it would be a bit odd if it didn't.