Cron Emails Stopped After Net Adapter Change

General support questions
Post Reply
thomas.deans
Posts: 12
Joined: 2019/11/01 17:58:13

Cron Emails Stopped After Net Adapter Change

Post by thomas.deans » 2019/11/01 18:17:18

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)
vncserver
SSH
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!

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cron Emails Stopped After Net Adapter Change

Post by TrevorH » 2019/11/01 19:03:26

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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Cron Emails Stopped After Net Adapter Change

Post by hunter86_bg » 2019/11/02 06:16:27

You can verify the configuration of your postfix via:

Code: Select all

echo TEST | mail -s TEST 'your@email.com'
sleep 5
postqueue -p

thomas.deans
Posts: 12
Joined: 2019/11/01 17:58:13

Re: Cron Emails Stopped After Net Adapter Change

Post by thomas.deans » 2019/11/04 13:55:29

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=<toor@domain.com>, 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 name=domain.com type=MX: Host not found, try again)
Nov  4 07:39:49 my postfix/qmgr[2480]: E115420A71D9: from=<my@my.domain.com>, size=14713, nrcpt=1 (queue active)
Nov  4 07:39:49 my postfix/smtp[27985]: E115420A71D9: to=<toor@domain.com>, 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 name=domain.com 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.

thomas.deans
Posts: 12
Joined: 2019/11/01 17:58:13

Re: Cron Emails Stopped After Net Adapter Change

Post by thomas.deans » 2019/11/05 18:33:39

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.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cron Emails Stopped After Net Adapter Change

Post by TrevorH » 2019/11/05 19:00:18

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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply