aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-08-30 14:06:48 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-08-30 14:06:48 +0000
commitc14f282dfb2886d429f10061335068ba493af98c (patch)
tree57077351f9db795bd84c42e61b1b06ef02f6e82f /etc
parent001cc04387e71e967bfe8a636467abcee8dfda81 (diff)
downloadmailfromd-c14f282dfb2886d429f10061335068ba493af98c.tar.gz
mailfromd-c14f282dfb2886d429f10061335068ba493af98c.tar.bz2
Rewrite using 2.x syntax
git-svn-id: file:///svnroot/mailfromd/trunk@476 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'etc')
-rw-r--r--etc/mailfromd.rc68
1 files changed, 36 insertions, 32 deletions
diff --git a/etc/mailfromd.rc b/etc/mailfromd.rc
index 7a5d0ef1..2bbc55f2 100644
--- a/etc/mailfromd.rc
+++ b/etc/mailfromd.rc
@@ -1,5 +1,5 @@
/* This file is part of mailfrom filter.
- Copyright (C) 2005, Sergey Poznyakoff
+ Copyright (C) 2005, 2006 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,35 +26,39 @@
#pragma regex +extended +icase
#pragma option debug 10
-if $f = ""
- accept
-elif hostname ${client_addr} matches ".*(adsl|sdsl|hdsl|ldsl|dialin|dialup|ppp|dhcp|dynamic).*"
- reject 550 "Use your SMTP relay"
-elif hostname ${client_addr} matches ".*-[0-9]{1,3}-[0-9]{1,3}-[0-9]{1,3}-[0-9]{1,3}.*"
- on poll host ${client_addr} for $f do
- when success:
- accept
- when not_found or failure:
- reject 510 "Sender validity not confirmed"
- when temp_failure:
- tempfail
- done
-elif relayed hostname ${client_addr}
- accept
-elif $f fnmatches "*yahoo.com"
- accept
-else
- on poll $f do
- when success:
- accept
- when not_found or failure:
- reject 510 "Sender validity not confirmed"
- when temp_failure:
- tempfail
- done
-fi
-
-if rate $f 100 / hour 30 minutes
- tempfail 410 "Mail sending rate exceeded. Try again later"
-fi
+prog envfrom
+do
+ if $f = ""
+ accept
+ elif hostname ${client_addr} matches ".*(adsl|sdsl|hdsl|ldsl|dialin|dialup|ppp|dhcp|dynamic).*"
+ reject 550 "Use your SMTP relay"
+ elif hostname ${client_addr} matches ".*-[0-9]{1,3}-[0-9]{1,3}-[0-9]{1,3}-[0-9]{1,3}.*"
+ on poll host ${client_addr} for $f do
+ when success:
+ accept
+ when not_found or failure:
+ reject 510 "Sender validity not confirmed"
+ when temp_failure:
+ tempfail
+ done
+ elif relayed hostname ${client_addr}
+ accept
+ elif $f fnmatches "*yahoo.com"
+ accept
+ else
+ on poll $f do
+ when success:
+ accept
+ when not_found or failure:
+ reject 510 "Sender validity not confirmed"
+ when temp_failure:
+ tempfail
+ done
+ fi
+
+ if rate($f "-" ${client_addr}, interval(1 hour 30 minutes)) > 100
+ tempfail 410 "Mail sending rate exceeded. Try again later"
+ fi
+done
+

Return to:

Send suggestions and report system problems to the System administrator.