aboutsummaryrefslogtreecommitdiff
path: root/etc/mailfromd.rc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-05-06 00:19:33 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-05-06 00:44:49 +0300
commitd2d21d1e6a06239fa97e50435abcea66b60678ae (patch)
treefc99ddaed8b77da3877a36b1b87e35cbf9455e51 /etc/mailfromd.rc
parent2e9e8087eef5452299cfc839b7b4cc23bb2feb6c (diff)
downloadmailfromd-d2d21d1e6a06239fa97e50435abcea66b60678ae.tar.gz
mailfromd-d2d21d1e6a06239fa97e50435abcea66b60678ae.tar.bz2
Minor changes.
* NEWS: Update. * doc/mailfromd.texi: Reorder material. * doc/upgrade.texi: New file. * doc/fdl.texi, doc/gacopyz.texi, doc/strftime.texi: Move sectioning commands to the main source. * etc/mailfromd.rc: Reflect recent changes. * mfd/lex.l: Change semantics of __statedir__ and __preproc__. Introduce __defstatedir__ and __defpreproc__.
Diffstat (limited to 'etc/mailfromd.rc')
-rw-r--r--etc/mailfromd.rc25
1 files changed, 12 insertions, 13 deletions
diff --git a/etc/mailfromd.rc b/etc/mailfromd.rc
index f25cfb33..e19cac49 100644
--- a/etc/mailfromd.rc
+++ b/etc/mailfromd.rc
@@ -1,6 +1,6 @@
/* This is a sample filter for Mailfromd. -*- mfl -*-
Site administrators are urged to write nicer versions.
- Copyright (C) 2005, 2006, 2007, 2008 Sergey Poznyakoff
+ Copyright (C) 2005, 2006, 2007, 2008, 2009 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
@@ -24,14 +24,13 @@
#include_once <status.mfh>
#require dns
+#require rateok
set mailfrom_address "<>"
set ehlo_domain "your.domain"
-number gltime
-set gltime interval("1 hour")
-number need_greylist
-set need_greylist 0
+number gltime interval("1 hour")
+number need_greylist 0
func cachestr() returns string
do
@@ -45,10 +44,12 @@ done
prog envfrom
do
if $f = ""
- pass
- elif hostname ${client_addr} matches ".*(adsl|sdsl|hdsl|ldsl|dialin|dialup|ppp|dhcp|dynamic).*"
+ pass
+ elif dbmap("/etc/mail/whitelist.db", $client_addr)
+ accept
+ elif hostname($client_addr) matches ".*(adsl|sdsl|hdsl|ldsl|dialin|dialup|ppp|dhcp|dynamic).*"
reject 550 5.7.1 "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}.*"
+ 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:
@@ -58,7 +59,7 @@ do
when temp_failure:
tempfail 450 4.1.0 "Try again later"
done
- elif relayed hostname ${client_addr}
+ elif relayed(hostname($client_addr))
pass
elif $f mx fnmatches "*.yahoo.com"
or $f mx fnmatches "*.namaeserver.com"
@@ -74,7 +75,7 @@ do
done
fi
- if rate($f "-" ${client_addr}, interval("1 hour 30 minutes")) > 100
+ if not rateok($f "-" $client_addr, interval("1 hour 30 minutes"), 100)
tempfail 450 4.7.0 "Mail sending rate exceeded. Try again later"
fi
done
@@ -82,15 +83,13 @@ done
prog envrcpt
do
if %need_greylist
- and not dbmap("/var/run/whitelist.db", $client_addr)
if greylist($client_addr "-" $f "-" $rcpt_addr, %gltime)
if %greylist_seconds_left = %gltime
tempfail 450 4.7.0
"You are greylisted for " %gltime " seconds"
else
tempfail 450 4.7.0
- "Still greylisted for "
- %greylist_seconds_left " seconds"
+ "Still greylisted for " %greylist_seconds_left " seconds"
fi
fi
fi

Return to:

Send suggestions and report system problems to the System administrator.