Hosted by PSE.pl | Created: 2004-03-11 | Last update: 2005-01-24 20:12:26 UTC | GnuPG signature of this page
anfiTop | anfiUp | Andrzej Filip | Mirror Sites | GnuPG Keys | New!google
googleMy Postings | slashdotJournal | Showing Gratitude
Personal | Sendmail | Exim | General MTA | Cyrus IMAP | UUCP
slashdotFeedback for this page

Real Time Cyrus Integration Version 2 (sendmail,cyrus)

Obsoletes

Obsoletes Real Time Cyrus Integration Version 1

Abstract

The document describes how to make sendmail check in real time presence of cyrus mailbox using socket map map (or fstat map) and FEATURE(`mrs'). It supports cyrus virtual domains

Socket map support is included in sendmail sendmail-8.13. Sendmail-8.12 requires patch.

Cyrus-2.2.3 provides socket map daemon.

Fstat map (alternative to socket map) requires patching sendmail source code.

This page is listed at Cyrus > External Links page of Cyrus Wiki.


Copyright (c) 2004 Andrzej Filip

Usage

It will make sendmail check if cyrus mailbox exists. The checks are done before alias expansion except when you use MAIL_HUB ($H), LOCAL_RELAY ($R) or LUSER_RELAY ($L).

Install

  1. Make cyrus-imap start smmapd daemon. In SERVICES section of cyrus.conf file add the following line:
    smmapd     cmd="smmapd" listen="/var/imap/socket/smmapd" prefork=1 
    
  2. Make cyrus-imap "lowercase" received user names. In /etc/imapd.conf add the following line:
    lmtp_downcase_rcpt: 1
    
    It will make cyrus-imap ignore case of user part addresses and convert AndrewFilip@Example.COM to andrewfilip@example.com.
  3. Compile sendmail-8.13 with socket map support (or use fstat map patch)
    Sendmail-8.12 requires patch to support socket map.
  4. Install FEATURE(`mrs') [It requires patching cf/m4/proto.m4]
  5. Install MAILER(`cyrusv2') (Release B)
  6. Install FEATURE(`mr_cyrus') for socket map
    OR FEATURE(`mr_cyrus_fstat') for fstat map
  7. Modify *.mc file you use to generate your sendmail.cf. Choose one of a few options:

    • mailertable
      Sendmail.mc:
      FEATURE(`mrs')dnl
      FEATURE(`mrs_cyrus')dnl
      MODIFY_MAILER_FLAGS(`CYRUSV2',`-A5')dnl Required ONLY if you use mrs_cyrus_user
      MAILER(`cyrusv2')dnl Required release B if you use mrs_cyrus_mailertable
      
      mailertable:
      # return "user unknown" for non existing cyrus mailboxes
      1st.domain   mrs_cyrus_mailertable:
      # directly specify errot message for non existing cyrus mailboxes
      2nd.domain   mrs_cyrus_mailertable:error:5.1.1:550 User unknown
      # return "user unknown" for non existing cyrus mailboxes - strip domain
      3rd.domain   mrs_cyrus_user:
      
      acess (if you want to accept message to the domains from anywhere):
      to:1st.domain   RELAY
      to:2nd.domain   RELAY
      to:3rd.domain   RELAY
      
      Mailertable DOES NOT work for local email domains (handy link):
      echo '$=w' | sendmail -bt
      

      It will make sendmail check if cyrus is going to accept user1@1st.domain (without stripping 1st. domain) and user2 (with stipped 2nd.domain). In both case addresses not handled by cyrus will be passed to "error" relay [you could use "local:catchrmaining" relay insted of "error" relay].

    • Luser Relay Sendmail.mc:
      define(`LUSER_RELAY',`mrs_cyrus_user:error:5.1.1:550 User unknown')dnl
      FEATURE(`mrs')dnl
      FEATURE(`mrs_cyrus')dnl
      MODIFY_MAILER_FLAGS(`CYRUSV2',`-A5')dnl
      MAILER(`cyrusv2')dnl
      

      It will make sendmail check if cyrus is going to accept user if no OS account is present.

      Remove define(`confLOCAL_MAILER',`cyrus') from your *.mc file.

    • Local Relay Sendmail.mc:
      define(`LOCAL_RELAY',`mrs_cyrus_user:dummy')dnl
      FEATURE(`mrs')dnl
      FEATURE(`mrs_cyrus')dnl
      MODIFY_MAILER_FLAGS(`CYRUSV2',`-A5')dnl
      MAILER(`cyrusv2')dnl
      

      It will make sendmail check if cyrus is going to accept user. Cyrus mailboxes will take precedence over OS maiboxes.

      Remove define(`confLOCAL_MAILER',`cyrus') from your *.mc file.

    • Sticky Hub Sendmail.mc:
      LOCAL_CONFIG
      C{VirtCyrus}1st.domain 2nd.domain 3rd.domain
      divert(-1)
      define(`MAIl_HUB',`mrs_cyrus_stickyhub:dummy')dnl
      FEATURE(`mrs')dnl
      FEATURE(`mrs_cyrus')dnl
      FEATURE(`stickyhost')dnl
      MAILER(`cyrusv2')dnl
      

      it should make sendmail check checkexistence mailboxes in $={Virtcyrus} domains (e.g. user@1st.domai mailbox). $={VirtCyrus} domains must be also local email domains ($=w).

      You MUST put ":dummy" after mrs_cyrus_stickyhub - it is crucial

      Remove define(`confLOCAL_MAILER',`cyrus') from your *.mc file.

Tests

sendmail -C test.cf -d60.5 -bv user@the.domain

Additional

Thanks