Здравствуйте!
Проблемка следующая:
решил включить проверку адресов локальных пользователей на стадии подключения.
Действовал по статье
http://anfi.homeunix.net/sendmail/rtcyrus-socket.html
Пересобрал сендмайл :
Version 8.13.4
Compiled with: DNSMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7
NAMED_BIND NETINET NETINET6 NETUNIX NEWDB NIS PIPELINING SCANF
SOCKETMAP TCPWRAPPERS USERDB XDEBUG
Собрал sendmail.cf из следующего
divert(0)dnl
VERSIONID(`$Id: generic-bsd4.4.mc,v 8.10 1999/02/07 07:26:02 gshapiro Exp $')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
dnl It makes sendmail define user map in sendmail.cf
define(`LUSER_RELAY')
dnl define location of "socket map" socket provided by cyrus
define(`SMMAP_SOCKET',`/var/imap/socket/smmapd')
LOCAL_CONFIG
# cyrus - map for checking cyrus maibox presence
Kcyrus socket -T<TMPF> local:SMMAP_SOCKET
LOCAL_RULESETS
SLocal_localaddr
# Treat system mailboxes as usual
R$+ $: $(user $1 $)
R$+ <> $@
# Detect cyrus mailboxes - deliver via cyrus mailer
R$- $: $1 <$(cyrus $1 $: $)>
R$- <$+<TMPF>> $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
R$- <$+> $# cyrusv2 $: @$1
# Treat remaning as usuall
R$* $@
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(cyrusv2)dnl
Далее пробуем проверку :
пользователь который реально существует
# sendmail -bv -C ./sendmail.cf -d60.5 afon
map_lookup(dequote, sva, %0=sva) => NOT FOUND (0)
map_lookup(dequote, afon, %0=afon) => NOT FOUND (0)
map_lookup(user, afon, %0=afon) => NOT FOUND (67)
map_lookup(cyrus, afon, %0=afon) => afon (0)
afon... deliverable: mailer cyrusv2, user afon
Все замечательно, далее
пользователь которого нет
# sendmail -bv -C ./s.cf -d60.12 afon2
map_lookup(dequote, sva, %0=sva) => NOT FOUND (0)
map_lookup(dequote, afon2, %0=afon2) => NOT FOUND (0)
map_lookup(user, afon2, %0=afon2) => NOT FOUND (67)
map_lookup(cyrus, afon2, %0=afon2) => NOT FOUND (68)
map_lookup(user, afon2, %0=afon2) => NOT FOUND (67)
afon2... User unknown
замечательно, далее,
пользователь у которого превышена квота:
# sendmail -bv -C ./s.cf -d60.12 alexk
map_lookup(dequote, sva, %0=sva) => NOT FOUND (0)
map_lookup(dequote, alexk, %0=alexk) => NOT FOUND (0)
map_lookup(user, alexk, %0=alexk) => NOT FOUND (67)
map_lookup(cyrus, alexk, %0=alexk) => NOT FOUND (75)
map_lookup(cyrus, alexk) tempfail: errno=0
map_lookup tempfail: returning "alexk<TMPF>"
alexk... deliverable: mailer local, user alexk
Поему стоит deliverable? При таком раскладе письмо поступает в очередь, как сделать что бы такие письма отвергать?
Приведу конец лога разборки правил перезаписи:
# sendmail -bv -C ./s.cf -d21.12 alexk
rewrite: ruleset EnvToL returns: alexk
rewrite: ruleset final input: alexk
-----trying rule: $+ : ; < @ >
----- rule fails
-----trying rule: $* < @ >
----- rule fails
-----trying rule: $* < @ $+ . > $*
----- rule fails
-----trying rule: $* < @ *LOCAL* > $*
----- rule fails
-----trying rule: $* < $+ > $*
----- rule fails
-----trying rule: @ $+ : @ $+ : $+
----- rule fails
-----trying rule: @ $*
----- rule fails
-----trying rule: $+ @ $- . UUCP
----- rule fails
-----trying rule: $+ % $=w @ $=w
----- rule fails
rewrite: ruleset final returns: alexk
rewrite: ruleset localaddr input: alexk
-----trying rule: $+
-----rule matches: $: $1 $| $> "Local_localaddr" $1
rewrite: ruleset Local_localaddr input: alexk
-----trying rule: $+
-----rule matches: $: $( user $1 $)
rewritten as: alexk
-----trying rule: $+ < >
----- rule fails
-----trying rule: $-
-----rule matches: $: $1 < $( cyrus $1 $: $) >
rewritten as: alexk < alexk < TMPF > >
-----trying rule: $- < $+ < TMPF > >
-----rule matches: $# error $@ 4 . 3 . 0 $: "451 Temporary system failure. Please try again later."
rewritten as: $# error $@ 4 . 3 . 0 $: "451 Temporary system failure. Please try again later."
rewrite: ruleset Local_localaddr returns: $# error $@ 4 . 3 . 0 $: "451 Temporary system failure. Please try again later."
rewritten as: alexk $| $# error $@ 4 . 3 . 0 $: "451 Temporary system failure. Please try again later."
-----trying rule: $+ $| $# ok
----- rule fails
-----trying rule: $+ $| $# $*
-----rule matches: $# $2
rewritten as: $# error $@ 4 . 3 . 0 $: "451 Temporary system failure. Please try again later."
rewrite: ruleset localaddr returns: $# error $@ 4 . 3 . 0 $: "451 Temporary system failure. Please try again later."
alexk... deliverable: mailer local, user alexk
Ошибка вроде бы обозначена, почему письмо проходит?