Email notifications fail on Plesk servers

ForumAdmin
Moderator
Posts: 1524
Joined: 01 Oct 2008, 09:24

Re: Email notifications fail on Plesk servers

Post 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.
ForumAdmin
Moderator
Posts: 1524
Joined: 01 Oct 2008, 09:24

Re: Email notifications fail on Plesk servers

Post 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.
marcele
Junior Member
Posts: 215
Joined: 17 Sep 2007, 17:02

Re: Email notifications fail on Plesk servers

Post by marcele »

I'll submit a bug report to the Plesk developers. Hopefully we can get this fixed right away.
marcele
Junior Member
Posts: 215
Joined: 17 Sep 2007, 17:02

Re: Email notifications fail on Plesk servers

Post 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/
ForumAdmin
Moderator
Posts: 1524
Joined: 01 Oct 2008, 09:24

Re: Email notifications fail on Plesk servers

Post 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?
ForumAdmin
Moderator
Posts: 1524
Joined: 01 Oct 2008, 09:24

Re: Email notifications fail on Plesk servers

Post 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.
marcele
Junior Member
Posts: 215
Joined: 17 Sep 2007, 17:02

Re: Email notifications fail on Plesk servers

Post by marcele »

ForumAdmin wrote:Let's call this method2 and the previous one method1.
Both method2 and method1 fixed the issue :)
ForumAdmin
Moderator
Posts: 1524
Joined: 01 Oct 2008, 09:24

Re: Email notifications fail on Plesk servers

Post by ForumAdmin »

Great. I'll look into implementing one or the other as a workaround in a short while after further testing...
marcele
Junior Member
Posts: 215
Joined: 17 Sep 2007, 17:02

Re: Email notifications fail on Plesk servers

Post by marcele »

Thanks again!
ForumAdmin
Moderator
Posts: 1524
Joined: 01 Oct 2008, 09:24

Re: Email notifications fail on Plesk servers

Post by ForumAdmin »

I have release csf v7.67 with the workaround:
http://blog.configserver.com/
Post Reply