divert(-1) # # Copyright (c) 2003, 2004 Victor Ustugov # This hack is under BSD License # Redistributions of source code must retain the above copyright notice # # hacks disscussion's maillist - http://www.mta.org.ua/mailman/listinfo/sendmail-conf # # # Check Cyrus users # dnl # Subject: Re: sendmail+cyrus-imapd2 & DSN: User unknown dnl # Date: Fri, 15 Aug 2003 10:40:34 +0000 (UTC) dnl # From: Sergey Goryachev dnl # Organization: Talk.ru dnl # Newsgroups: fido7.ru.unix.bsd dnl # dnl # sendmail.mc dnl # -------------- dnl # MAILER(smtp)dnl dnl # MAILER(local)dnl dnl # MAILER(cyrusv2)dnl dnl # HACK(cyrususers)dnl dnl # -------------- dnl # dnl # (прототип взят с unixfaq.ru) dnl # -------------- dnl # Выдержка из Косталеса: dnl # --------------------------------------------------------------------- dnl # The file form of the class configuration command allows different dnl # formatting patterns to be used with scanf(3). [3] But the program dnl # form does not allow any variation, and so its scanf(3) pattern is dnl # always %s, which tells scanf(3) to read only the first whitespace- dnl # delimited word from each line of text: dnl # dnl # [3] The version of sendmail that you are using must have been dnl # compiled with SCANF defined (see Section 18.8.39) for scanf(3) to be dnl # usable from within the configuration file. dnl # dnl # dnl # FX file pat with scanf(3) pattern dnl # FX |program always ``%s'' dnl # --------------------------------------------------------------------- dnl # Поэтому при просмотре sasldb2 вылезает dnl # что-то вроде 'user@realm:' (до первого пробела) dnl # dnl # Баги: dnl # ===== dnl # 1) Пришлось сделать setuid root на /usr/local/sbin/sasldblistusers2 dnl # (пускается от пользователя mailnull, смотрел по 'lastcomm |grep sasl') dnl # dnl # 2) На каждый 'rcpt to:' запускается внешняя команда - накладно для dnl # ресурсов dnl # dnl # 3) Почта на user+detail@domain.tld не принимается, а должна бы dnl # приниматься и раскладываться цирусом в папку INBOX.detail (при наличии dnl # таковой и разрешающем ACL) -- надо бы подумать, как это обрулить dnl # рулесетами (запомнить '+detail' в macro, что ли?) dnl # F{cyrususers}|/usr/local/sbin/sasldblistusers2 dnl # divert(0) VERSIONID(`$Id: cyrususers.m4,v 8.12-0.02 2003/09/22 19:20:00 corvax Exp $')dnl divert(-1) dnl dnl LOCAL_CONFIG dnl dnl # Add rule to the end of ruleset 98 ( local hack for ruleset 0 ) LOCAL_RULE_0 # Deliver mail through cyrusv2 mailer for imap users. R $- $: $1 @ $j : R $* < @ $+ . > $: $1 @ $2 : R $={cyrususers} $: < CYRUS > $1 R < CYRUS > $* : $#cyrusv2 $: $1 R $* @ $+ : $: $1 < @ $2 . >