The document describes how to make sendmail select non default local mailer (e.g. cyrus) for some local addresses via aliases, virtusertable or forward file.
It will make sendmail reject during SMTP session delivery attempt to addresses handled by no local mailer unlike typical similar solutions (including cyrusv2.mc from cyrus distribution).
It can be used to select original local mailer delivery for some addresses when cyrus is used as as local mailer.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHOR NAME MUST BE QUOTED IN ANY WORK DERIVATED FROM THE WORK.
In aliases file you can put entries like the ones given below:
# deliver to cyrus mailbox user2: user2@CYRUSV2 # deliver to cyrus mailbox, system mailbox, and mailbox on another host user1: user1@CYRUSV2, \user1, userx@another.host
Messages to local address jamesbond will be delivered via to cyrus mailbox kgb.
Sample virtusertable entries:
# # deliver messages to all mailboxes in example.net to cyrus mailer # @example.net %1@CYRUSV2 # # redirect one use to cyrus mailbox # user1@example.com %1@CYRUSV2 # # deliver messages to "valid" mailboxes in example.org to cyrus # reject remaining addresses in example.org # userx@example.org userx@CYRUSV2 usery@example.org usery@CYRUSV2 @example.org error:nouser User unknown
Sample ~login/.forward file:
login@CYRUSV2 \login somebody@another.host
Make sendmail resolve (canonify) *@CYRUS addresses without DNS lookups
In *.mc file add
LOCAL_CONFIG CPCYRUS CYRUSV2 LOCAL
Deliver messages to *@CYRUS using cyrus mailer [requires FEATURE(`mailertable')].
mailertable:
CYRUS cyrus:inbox CYRUSV2 cyrusv2:inbox LOCAL local:
cyrus will try to deliver messages to user.USERID.inbox mailbox with user.USERID (default destination) being a fall-back. You must specify something after : otherwise mailertable does not work properly.
Do not accept messages to *@CYRUS via SMTP [requires FEATURE(`access_db') and FEATURE(`blacklist_recipients')]
access:
to:CYRUS REJECT to:CYRUSV2 REJECT to:LOCAL REJECT
You can use commands given below for testing the feature:
while read addr; do sendmail -C sendmail-test.cf -bv $addr ; done <<END user1 user1@example.com nosuchuser END