We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 904922a commit a54bc8fCopy full SHA for a54bc8f
lib/VWF/Display/index.pm
@@ -103,6 +103,15 @@ sub html {
103
die 'No email entry assigned to ', $info->person();
104
}
105
106
+ # Rate limit for sending e-mails
107
+ if(my $remote_addr = $ENV{'REMOTE_ADDR'}) {
108
+ if($self->{'mailfrom'}->{$remote_addr} >= 2) {
109
+ $self->{_logger}->info("E-mail blocked to $to");
110
+ return $self->SUPER::html({ error => 'You have reached your limit for sendmail e-mails' });
111
+ }
112
+ $self->{'mailfrom'}->{$remote_addr}++;
113
114
+
115
# Send the email
116
if(open(my $fout, '|-', '/usr/sbin/sendmail -t')) {
117
print $fout "To: $to\n",
0 commit comments