aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-01-19 09:25:24 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-01-19 09:25:24 +0000
commit537173318e882abb2bbc693481cd9e94bd40ae5e (patch)
treee2901ce39f8fd9e7168ccb4b56d90a2304b76438 /etc
parent6b91c2969167f3ba77fa0aea00462df3cd4bf918 (diff)
downloadmailfromd-537173318e882abb2bbc693481cd9e94bd40ae5e.tar.gz
mailfromd-537173318e882abb2bbc693481cd9e94bd40ae5e.tar.bz2
Update
git-svn-id: file:///svnroot/mailfromd/trunk@1194 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'etc')
-rw-r--r--etc/mailfromd.rc35
1 files changed, 25 insertions, 10 deletions
diff --git a/etc/mailfromd.rc b/etc/mailfromd.rc
index 1b43e01f..e9c95ce2 100644
--- a/etc/mailfromd.rc
+++ b/etc/mailfromd.rc
@@ -1,5 +1,6 @@
-/* This file is part of mailfrom filter.
- Copyright (C) 2005, 2006 Sergey Poznyakoff
+/* This is a sample start-up script for mailfrom filter.
+ Site administrators are urged to write nicer versions.
+ Copyright (C) 2005, 2006, 2007 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
@@ -16,15 +17,31 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA */
+#error "Do not use this file 'AS IS'! Tailor it to suit your site!"
+
#pragma option relay "/etc/mail/sendmail.cw"
#pragma option relay "/etc/mail/relay-domains"
-#pragma option timeout 33
-#pragma option retry 3
#pragma option mailfrom ""
#pragma option ehlo "your.domain"
#pragma regex +extended +icase
#pragma option debug 1
+#include <status.mfh>
+
+number gltime
+set gltime interval("1 hour")
+number need_greylist
+set need_greylist 0
+
+func cachestr() returns string
+do
+ if %cache_used
+ return "[CACHED] "
+ else
+ return ""
+ fi
+done
+
prog envfrom
do
if $f = ""
@@ -36,7 +53,7 @@ do
when success:
next
when not_found or failure:
- reject 550 5.1.0 "Sender validity not confirmed"
+ reject 550 5.1.0 cachestr() "Sender validity not confirmed"
when temp_failure:
tempfail 450 4.1.0 "Try again later"
done
@@ -44,13 +61,13 @@ do
next
elif $f mx fnmatches "*.yahoo.com"
or $f mx fnmatches "*.namaeserver.com"
- next
+ set need_greylist 1
else
on poll $f do
when success:
next
when not_found or failure:
- reject 550 5.1.0 "Sender validity not confirmed"
+ reject 550 5.1.0 cachestr() "Sender validity not confirmed"
when temp_failure:
tempfail
done
@@ -63,9 +80,7 @@ done
prog envrcpt
do
- set gltime interval("1 hour")
- if $f mx fnmatches "*.yahoo.com"
- or $f mx fnmatches "*.namaeserver.com"
+ 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

Return to:

Send suggestions and report system problems to the System administrator.