Page 2 of 3

Re: Email notifications fail on Plesk servers

Posted: 13 Apr 2015, 16:18
by ForumAdmin
Actually, that rule would not work for the lo device, so it would have to be specified explicitly in an iptables command in a csfpost.sh file.

Re: Email notifications fail on Plesk servers

Posted: 13 Apr 2015, 16:23
by ForumAdmin
Something like this in a csfpost.sh file would allow SMTP outbound connections from the root account to the lo device:

Code: Select all

/sbin/iptables -I ALLOWOUT -o lo -p tcp --dport 25 -m owner --uid-owner 0  -j ACCEPT
As it is restricting the connection to root alone, it shouldn't pose any risk.

Re: Email notifications fail on Plesk servers

Posted: 13 Apr 2015, 16:26
by marcele
I'll submit a bug report to the Plesk developers. Hopefully we can get this fixed right away.

Re: Email notifications fail on Plesk servers

Posted: 13 Apr 2015, 16:52
by marcele
Just for reference here is the bug report I submitted. Thanks again for taking to time to help out Chirpy! Hopefully the Plesk developers get this fixed soon.
http://forum.odin.com/threads/plesk-sen ... ly.332717/

Re: Email notifications fail on Plesk servers

Posted: 13 Apr 2015, 17:24
by ForumAdmin
I've had a think. Could you try the following, edit /etc/csf/lfd.pl and change around line 8672-8674 from:

Code: Select all

			open (MAIL, "|$config{SENDMAIL} -f $from -t") or &logfile("Unable to send SENDMAIL alert via [$config{SENDMAIL}]: $!");;
			print MAIL $data;
			close (MAIL);
to:

Code: Select all

		eval {
			local $SIG{CHLD} = 'DEFAULT';
			open (MAIL, "|$config{SENDMAIL} -f $from -t") or &logfile("Unable to send SENDMAIL alert via [$config{SENDMAIL}]: $!");;
			print MAIL $data;
			close (MAIL);
		}
Then disable LF_ALERT_SMTP and restart lfd and test whether sendmail works?

Re: Email notifications fail on Plesk servers

Posted: 13 Apr 2015, 17:39
by ForumAdmin
Whether the above works or not, could you also try without that mod but instead at around line 8622:

Before:

Code: Select all

sub sendmail {
	my @message = @_;
	my $time = localtime(time);
After:

Code: Select all

sub sendmail {
	my @message = @_;
	local $SIG{CHLD} = 'DEFAULT';
	my $time = localtime(time);
Then restart lfd. Let's call this method2 and the previous one method1.

Re: Email notifications fail on Plesk servers

Posted: 13 Apr 2015, 18:05
by marcele
ForumAdmin wrote:Let's call this method2 and the previous one method1.
Both method2 and method1 fixed the issue :)

Re: Email notifications fail on Plesk servers

Posted: 13 Apr 2015, 18:07
by ForumAdmin
Great. I'll look into implementing one or the other as a workaround in a short while after further testing...

Re: Email notifications fail on Plesk servers

Posted: 13 Apr 2015, 18:11
by marcele
Thanks again!

Re: Email notifications fail on Plesk servers

Posted: 13 Apr 2015, 18:17
by ForumAdmin
I have release csf v7.67 with the workaround:
http://blog.configserver.com/