Notice: Undefined variable:

General eFa discussion
Post Reply
tbuchanan
Posts: 21
Joined: 19 May 2016 14:53

Notice: Undefined variable:

Post by tbuchanan »

I have 4 EFA project mail scanners currently running 3.0.1.1 -- 3 virtual, 1 physical. The physical server is an outgoing scanner and has been giving me the following notice since before the upgrade from 3.0.0.9 to 3.0.1.0 (the line number may have changed during one of the upgrades). Can anyone tell me the cause and/or solution? I have compared the files called out and they are identical between servers. Thank you.

/etc/cron.hourly/mailwatch_relay.sh:
Notice: Undefined variable: _relay in /var/www/html/mailscanner/postfix_relay.php on line 228
Notice: Undefined variable: _dsn in /var/www/html/mailscanner/postfix_relay.php on line 228
Notice: Undefined variable: _delay in /var/www/html/mailscanner/postfix_relay.php on line 228
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Notice: Undefined variable:

Post by pdwalker »

What OS and version is your physical and virtual servers running?
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Notice: Undefined variable:

Post by pdwalker »

As a quick guess, I'd say the variables are not getting set beacause the script is having a problem reading the log file. Verify the permissions as well and also compare the log files between the physical and one of the virtual servers - is it the same format and in the same location?
tbuchanan
Posts: 21
Joined: 19 May 2016 14:53

Re: Notice: Undefined variable:

Post by tbuchanan »

All are CentOS 6.8 Are you talking about the maillog -- I'm going to assume that I know nothing other than it was working well and then after a spam outbreak cleanup, I started seeing these messages -- not consistently for a while but now very regularly. I checked the /var/log/maillog location and permissions and they are the same between servers. Also, as far as I can tell, the same format but I'm not sure what other formats there are. I have stopped MailScanner and removed the Process.db file and also rebooted the server with no change. Thank you.
tbuchanan
Posts: 21
Joined: 19 May 2016 14:53

Re: Notice: Undefined variable:

Post by tbuchanan »

rotating /var/log/maillog seems to have fixed the problem
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Notice: Undefined variable:

Post by pdwalker »

It may have been minor corruption in the log file. Only way to find out is to debug the script on that file.

Glad it's working for you again.
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Notice: Undefined variable:

Post by pdwalker »

Centos 6.x where x is 8 right now, I think.
ericarcher57
Posts: 3
Joined: 18 Oct 2016 11:38

Re: Notice: Undefined variable:

Post by ericarcher57 »

I have exactly the same problem!

I am new to EFA and have just installed the latest release, V3.0.1.5 and I can now see these hourly messages- "Cron <root@EFA> run-parts /etc/cron.hourly"

The contents are the same:

/etc/cron.hourly/mailwatch_relay.sh:

Notice: Undefined variable: _relay in
/var/www/html/mailscanner/postfix_relay.php on line 228

Notice: Undefined variable: _dsn in
/var/www/html/mailscanner/postfix_relay.php on line 228

Notice: Undefined variable: _delay in
/var/www/html/mailscanner/postfix_relay.php on line 228

repeated several times.

I am a bit of a noob when it comes to Linux so please be kind in your suggestions, I see someone resolved this by "rotating" the log file but i don't know what this means.

Thanks in advance.
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Notice: Undefined variable:

Post by pdwalker »

I did a search and I found the following answer in the first link

Code: Select all

sudo logrotate --force /etc/logrotate.conf
That will manually rotate your log files for you.

Do that, and then let us know if you're still getting the error messages
ericarcher57
Posts: 3
Joined: 18 Oct 2016 11:38

Re: Notice: Undefined variable:

Post by ericarcher57 »

I rotated the log files but I still get the hourly messages
chris
Posts: 14
Joined: 16 Jan 2015 08:31

Re: Notice: Undefined variable:

Post by chris »

I have the same issue on one of my mta's. Tried to compare but can not seem to find anything that differ really...

logrotate -f /etc/logrotate.conf dosen´t help.


/etc/cron.hourly/mailwatch_relay.sh

Notice: Undefined variable: _relay in /var/www/html/mailscanner/postfix_relay.php on line 228

Notice: Undefined variable: _dsn in /var/www/html/mailscanner/postfix_relay.php on line 228

Notice: Undefined variable: _delay in /var/www/html/mailscanner/postfix_relay.php on line 228

Notice: Undefined variable: _relay in /var/www/html/mailscanner/postfix_relay.php on line 228

Notice: Undefined variable: _dsn in /var/www/html/mailscanner/postfix_relay.php on line 228

Notice: Undefined variable: _delay in /var/www/html/mailscanner/postfix_relay.php on line 228

Notice: Undefined variable: _relay in /var/www/html/mailscanner/postfix_relay.php on line 228

Notice: Undefined variable: _dsn in /var/www/html/mailscanner/postfix_relay.php on line 228

Notice: Undefined variable: _delay in /var/www/html/mailscanner/postfix_relay.php on line 228
okuepfer
Posts: 1
Joined: 28 Dec 2016 19:51

Re: Notice: Undefined variable:

Post by okuepfer »

I experinece the same problem over and over again since I ugraded to 3.x

3 Informoations I was able to proof
a) It is not an Upgrade issue
b) It's most possibly related to the 3.x Version or the latest updates
c) Fresh installed EFA 3.0.1.5 is having the same Problem within 24 hours.
--> I did not restore any setting, everything was configured from scratch

/etc/cron.hourly/mailwatch_relay.sh:

Notice: Undefined variable: _relay in /var/www/html/mailscanner/postfix_relay.php on line 228
Notice: Undefined variable: _dsn in /var/www/html/mailscanner/postfix_relay.php on line 228
Notice: Undefined variable: _delay in /var/www/html/mailscanner/postfix_relay.php on line 228

Anyone can explain or even fix this?

Thanks
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Notice: Undefined variable:

Post by shawniverson »

Looks like the maillog isn't being parsed properly by postfix_relay.php, or the format of the postfix entries in the maillog aren't in a format the this script expects.

It would be interesting to see a snippet of a maillog associated with this problem. Might shed some light on the issue.
tbuchanan
Posts: 21
Joined: 19 May 2016 14:53

Re: Notice: Undefined variable:

Post by tbuchanan »

I am experiencing this problem again on 3.0.1.8 - CentOS 6.8 fully updated. I can't identify the portion of the maillog that corresponds with the error:
/etc/cron.hourly/mailwatch_relay.sh:
Notice: Undefined variable: _relay in /var/www/html/mailscanner/postfix_relay.php on line 240
Notice: Undefined variable: _dsn in /var/www/html/mailscanner/postfix_relay.php on line 240
Notice: Undefined variable: _delay in /var/www/html/mailscanner/postfix_relay.php on line 240
However this seems to happen after cleaning out spam messages in the deferred outgoing queue. I have been cleaning them by changing directory to /var/spool/postfix/deferred and running rm -vf `grep -Elr bburton .` Is there a better way of trying to clear a spam outbreak? No matter how many times I tell people not to provide their credentials to every message that slips through, they do and then I have to try to quickly stop. When it happens over night there is not much I can do. One other symptom that appears after doing this is that mysqld hogs 90+% CPU and I am unable to view message details through the web interface. Restarting the httpd process at least gets me back to where I can monitor recent messages but rebooting the server is the only way I can get the mysqld process to behave for a while before it goes back to 100% CPU utilization.
User avatar
darky83
Site Admin
Posts: 540
Joined: 30 Sep 2012 11:03
Location: eFa
Contact:

Re: Notice: Undefined variable:

Post by darky83 »

if you delete messages manually you might cause some issues down the road.

the official postfix way of clearing all messages from the deferred dir is by running:

Code: Select all

postsuper -d ALL deferred
The question more is why would you want to clear the deferred queue?
If you keep having lots of dictionary attacks it might be a good time to start looking at a way to implement recipient validation, problem here is that eFa is a generic system, so how to implement depends completely on the mailserver(s) you run behind the spamfilter.
Version eFa 4.x now available!
tbuchanan
Posts: 21
Joined: 19 May 2016 14:53

Re: Notice: Undefined variable:

Post by tbuchanan »

Thanks for your comment. This is an outgoing mail relay servicing several mail servers. Since it serves students as well as faculty and staff devices, authentication would be cumbersome. Also, the accounts sending out spam are legitimate -- they just succumbed to giving out their credentials to messages promising increased mail space. There are legitimate messages still in the deferred queue that need to be left. I'm only trying to clear out the ones known to be spam. I would like to find a way to hold delivery of messages from individuals who try to send more than x number of messages in x minutes with the ability to white-list certain addresses since there are bulk messages sent to the students from the student information system.
Post Reply