Relay Information missing from message details

Bugs in eFa 4
Post Reply
forhire
Posts: 30
Joined: 10 Jun 2021 16:54

Relay Information missing from message details

Post by forhire »

After updating eFa I am no longer seeing the Relay Information in the message details.

I have confirmed it went missing right when the update was done. Transport is working properly, it's just not capturing the delivery on the details page. Did it possibly get disabled? Any ideas?

I have rebooted the server and glanced through the config and logs but nothing jumps out.
relay.png
relay.png (23.84 KiB) Viewed 164240 times
forhire
Posts: 30
Joined: 10 Jun 2021 16:54

Re: Relay Information missing from message details

Post by forhire »

I think I found the issue. Not sure why postfix_relay isn't starting. I did managed to get it restart once last night but it promptly died. milter_relay is running. Rebooting the server made no change. Any ideas?

Code: Select all

[user@smtp ~]$ sudo systemctl status postfix_relay
● postfix_relay.service - Postfix relay service for MailWatch
   Loaded: loaded (/usr/bin/mailwatch/tools/Postfix_relay; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Sat 2022-04-16 10:59:21 PDT; 12min ago
  Process: 3911 ExecStart=/usr/bin/php -q /usr/bin/mailwatch/tools/Postfix_relay/mailwatch_postfix_relay.php (code=exited, status=255)
 Main PID: 3911 (code=exited, status=255)

Apr 16 10:59:21 smtp.domain.com systemd[1]: Unit postfix_relay.service entered failed state.
Apr 16 10:59:21 smtp.domain.com systemd[1]: postfix_relay.service failed.
Apr 16 10:59:21 smtp.domain.com systemd[1]: postfix_relay.service holdoff time over, scheduling restart.
Apr 16 10:59:21 smtp.domain.com systemd[1]: Stopped Postfix relay service for MailWatch.
Apr 16 10:59:21 smtp.domain.com systemd[1]: start request repeated too quickly for postfix_relay.service
Apr 16 10:59:21 smtp.domain.com systemd[1]: Failed to start Postfix relay service for MailWatch.
Apr 16 10:59:21 smtp.domain.com systemd[1]: Unit postfix_relay.service entered failed state.
Apr 16 10:59:21 smtp.domain.com systemd[1]: postfix_relay.service failed.
forhire
Posts: 30
Joined: 10 Jun 2021 16:54

Re: Relay Information missing from message details

Post by forhire »

It looks like either I have a missing/broken column in the database or an issue with the field list. Still digging.

Code: Select all

[user@smtp ~]$ sudo /usr/bin/php -q /usr/bin/mailwatch/tools/Postfix_relay/mailwatch_postfix_relay.php

Fatal error: Uncaught mysqli_sql_exception: Unknown column 'to_address' in 'field list' in /var/www/html/mailscanner/functions.php:1054
Stack trace:
#0 /var/www/html/mailscanner/functions.php(1054): mysqli->query()
#1 /var/www/html/mailscanner/mtalogprocessor.inc.php(135): dbquery()
#2 /var/www/html/mailscanner/mtalogprocessor.inc.php(179): MtaLogProcessor->processLine()
#3 /usr/bin/mailwatch/tools/Postfix_relay/mailwatch_postfix_relay.php(97): MtaLogProcessor->doit()
#4 {main}
  thrown in /var/www/html/mailscanner/functions.php on line 1054
cat: write error: Broken pipe

forhire
Posts: 30
Joined: 10 Jun 2021 16:54

Re: Relay Information missing from message details

Post by forhire »

I ran upgrade.php and postfix_relay is now running.

sudo /usr/bin/php -e /usr/bin/mailwatch/tools/upgrade.php

I'm still not seeing the Relay Information. Now I'm at a real loss. Any ideas?
forhire
Posts: 30
Joined: 10 Jun 2021 16:54

Re: Relay Information missing from message details

Post by forhire »

The database table mtalog_id is NOT updating. I selected a message from the logs. Grabbed the smtpd_id and the smtp_id and manually inserted them into the mtalog_id table. The Relay Information now appears in the message details for that message. Watching the count on mta_log_id table confirms it is NOT updating. The mtalog table is populating properly. Now I just need to figure out what code/daemon should be updating the table.

I pulled a random message-id from the logs:
Apr 16 21:13:51 smtp postfix/cleanup[20077]: 4KgxWz0KjMzB48GB: message-id=<c1dd2922-be04@foo.com>
Apr 16 21:13:56 smtp postfix/cleanup[20077]: 4KgxX45MBhzB48GB: message-id=<c1dd2922-be04@foo.com>

I then inserted the smtpd_id and smtp_id into the mtalog_id table:
MariaDB [mailscanner]> INSERT INTO mtalog_ids (smtpd_id,smtp_id) VALUES ("4KgxWz0KjMzB48GB", "4KgxX45MBhzB48GB");
Query OK, 1 row affected (0.04 sec)
freyuh
Posts: 62
Joined: 04 Oct 2018 11:21

Re: Relay Information missing from message details

Post by freyuh »

I have the same problem, Blut it`s more weired.
I have 2 eFas and the second is an exakt clone of the first one.
But I see the relay info on the second eFa. On the first one it is missing.
I have to take a deeper look on it next week.
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Relay Information missing from message details

Post by shawniverson »

The milter_relay daemon is responsible for inserting into the table mtalog_ids. So if you aren't getting this information, this is where we need to focus.

Restarting the milter_relay daemon causes it to rescan the maillog before following it live. So if it doesn't capture anything after restarting, we definitely have something to look at here.
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Relay Information missing from message details

Post by shawniverson »

I hate my own code sometimes... :oops:

Please download this copy and test and/or debug (DEBUG_MILTER can be set to true and restarted to get detailed logging to the maillog)...

Code: Select all

curl -sSL https://raw.githubusercontent.com/shawniverson/MailWatch/041722milter_relay/tools/Postfix_relay/mailwatch_milter_relay.php | sudo tee /usr/bin/mailwatch/tools/Postfix_relay/mailwatch_milter_relay.php
sudo systemctl daemon-reload
sudo systemctl restart milter_relay
forhire
Posts: 30
Joined: 10 Jun 2021 16:54

Re: Relay Information missing from message details

Post by forhire »

shawniverson, I installed the patched version this morning as it is working great. Thank you!!
freyuh
Posts: 62
Joined: 04 Oct 2018 11:21

Re: Relay Information missing from message details

Post by freyuh »

No problems so far ...
mendark
Posts: 24
Joined: 03 Dec 2021 10:10

Re: Relay Information missing from message details

Post by mendark »

Hello,
I have exact situation, but this problem aper when i modify chown on postfix folder to be root, on all folder.
Can be from change the owener of postfix folder?

Thank you
mendark
Posts: 24
Joined: 03 Dec 2021 10:10

Re: Relay Information missing from message details

Post by mendark »

Hello,
So i have some little update, i decide to convert Rocky Linux 8 to Alma Linux and relay information work again, but from today relay information disappear again. Can you help me with this situation?

Thank you
Post Reply