Hosted by PSE.pl | Created: 2002-11-10 | Last update: 2004-03-01 15:05:49 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

Domanized Aliases (sendmail)

Abstract

The document describes how to make sendmail process corectly user@local.domain aliases. Without it sendmail ignores local.domaim during aliases expansion.


Copyright (c) 2002 Andrzej Filip

Usage

Define "domanized" aliases in aliases file (in /etc/mail/ or /etc/ directory).

user1@first.local.domain:   user1@domain2.com,\user1
user1@second.local.domain:  userx@nowhere.com

Install

  1. Fix small bug present in cf/m4/proto.m4 of 8.12.6. In pre DH line comment it is declared (but not implemented) that "$R has precedence for unqualified names" [I have reported the bug to sendmail-bugs@sendmail.org]

    Change order of MAIL_HUB and MAIL_RELAY processing.

    Apply the patch (signature) - in main directory of sendmail distribtion execute

    patch -p0 < RH.patch
    
  2. Apply required changes to *.mc file:
    dnl relay user@localdomain via MAIL_HUB
    FEATURE(`stickyhost')dnl
    define(`MAIL_HUB',`procmail:/etc/procmailrc/catch.rc')dnl
    dnl ignore MAIL_HUB for recipients without domain
    define(`LOCAL_RELAY',`$j')dnl
    
    dnl turn on alaises and S5 processing for procmail mailer
    MODIFY_MAILER_FLAGS(`PROCMAIL',`+A5')dnl
    MAILER(procmail)dnl
    
    LOCAL_RULESETS
    SLocal_localaddr
    # Strip domain part of recipient address
    R$+@$+  $# local $: $1
    

Tests

  1. Generate sendmail-test.cf as described in install section.
  2. Add domanized aliases to aliases file e.g.
    user1@first.local.domain:   user1@domain2.com,\user1
    
  3. Compile new aliases database using sendmail-test.cf
    newaliases -C sendmail-test.cf
    
  4. Test it using
    sendmail -C sendmail-test.c -d27.2 user1@first.local.domain
    

Additional

A wonderful quote apropos the bug mentioned in install section:

If the code and the comments disagree, then both are probably wrong.
-- Norm Schryer

Original Posting

googleThe posting
Subject: Domanized aliases
Date: 2002-10-27
Newsgroups: comp.mail.sendmail
Message-ID: <3DBBEA84.6A656833@Andrzej.Adam.Filip>