Delivering to user@domain versus user@host.domain

Christian Schulte cs at schulte.it
Wed May 28 18:03:55 EDT 2003


Don Doumakes wrote:

>
> On 2003.05.24 06:03:46 -0500 Christian Schulte wrote:
>
>> Here is the patch to proto.m4! Added one line and changed two. I got
>> this from someone on this list here a few months ago and it solved all
>> my problems but be warned that this heavily influences sendmail and may
>> leed to trouble. I am using it since months without any problems 
>> though....
>> In order to make this work be sure that your cyrusv2 mailer definition
>> contains S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL because local names now
>> have @domain in them and local mailer can use the rewriting rules
>> EnvToL/HdrToL
>> If you plan to use virtusertable feature this also has a huge influence.
>> You definetely want to
>>
>> define(`_VIRTUSER_STOP_ONE_LEVEL_RECURSION_', `true')dnl
>>
>> and do routing in virtusertable like
>>
>> account at domain   account at domain
>> anotherone at domain   anotherone at domain
>> @domain   thirdone at domain
>>
>> with account at domain,anotherone at domain,thirdone at domain all beeing
>> mailboxes with theire logins.
>>
>> If you get the error map macro not found or something like that you also
>> have to
>>
>> define(`_NEED_MACRO_MAP_',`1')dnl
>>
>> to get onelevel-recursion working!
>>
>> This is all I needed to get it up and running! Hope this helps....
>>
>> --Christian
>>
>>
>> *** /root/sendmail-8.12.9/cf/m4/proto.m4 Fri Mar 28 18:20:53 2003
>>
>> --- /home/schulte/sendmail-8.12.9/cf/m4/proto.m4    Fri Apr 25 
>> 22:00:03 2003
>> ***************
>> *** 1098,1105 ****
>>  dnl $H empty (but @$=w.)
>>  R< > $+ + $* < $+ >    $#_LOCAL_ $: $1 + $2        plussed name?
>>  R< > $+ < $+ >        $#_LOCAL_ $: @ $1             nope, local 
>> address',
>> ! `R$=L < @ $=w . >    $#_LOCAL_ $: @ $1            special local names
>> ! R$+ < @ $=w . >        $#_LOCAL_ $: $1            regular local name')
>>
>>  ifdef(`_MAILER_TABLE_', `dnl
>>  # not local -- try mailer table lookup
>> --- 1098,1107 ----
>>  dnl $H empty (but @$=w.)
>>  R< > $+ + $* < $+ >    $#_LOCAL_ $: $1 + $2        plussed name?
>>  R< > $+ < $+ >        $#_LOCAL_ $: @ $1             nope, local 
>> address',
>> ! `R$=L < @ $=w . >    $#_LOCAL_ $: @ $1`@'$2            secial local 
>> names
>> ! R$+ < @ $j . >        $#_LOCAL_ $: $1                 leave 
>> untouched if @$j
>> ! R$+ < @ $=w . >        $#_LOCAL_ $: $1`@'$2             regular 
>> local name')
>> !
>>
>>  ifdef(`_MAILER_TABLE_', `dnl
>>  # not local -- try mailer table lookup
>
>
> Good, getting closer!  My sendmail.mc now is:
>
> # divert(-1)
> #
> #    (C) Copyright 2000 by Carnegie Mellon University
> #
> #    This sample mc file is for a site that uses the Cyrus IMAP server
> #    exclusively for local mail. This requires Sendmail 8.10 or later.
> #
> # $Id: cyrusv2.mc,v 1.4 2001/08/23 23:26:56 leg Exp $
>
> divert(0)dnl
> VERSIONID(`cyrus v2 sample configuartion')
>
> OSTYPE(linux)
> define(`confBIND_OPTS',`-DNSRCH -DEFNAMES')
> define(`confTO_IDENT',`0')
>
> dnl setting cyrus as the trusted user will make it easier to pass
> dnl Sendmail's safefile checks.  however, it means that someone with the
> dnl "cyrus" password could easily become root.
> dnl define(`confTRUSTED_USER', `cyrus')
>
> define(`confLOCAL_MAILER', `cyrusv2')
>
> define(`_VIRTUSER_STOP_ONE_LEVEL_RECURSION_')dnl
> define(`_NEED_MACRO_MAP_', `1')dnl
>
> dnl if you aren't using Sendmail 8.12, you might need to remove
> dnl the following feature.
> FEATURE(`preserve_local_plus_detail')
> FEATURE(`nocanonify')
> FEATURE(`virtusertable')
> FEATURE(`use_cw_file')
> FEATURE(`always_add_domain')
> MAILER(`cyrusv2')
> MAILER(`local')
> MAILER(`smtp')
>
> MAILER_DEFINITIONS
> Mcyrusv2,    P=[IPC], F=lsDFMnqA@/:|SmXz, E=\r\n,
>     S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP,

I have: S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL,

Do you have cf/mailer/cyrusv2.m4 file ? If yes just left out your 
complete MAILER_DEFINITION section because MAILER(cyrusv2) is already 
known if you have it and should be correct. All I need to get it running 
is the patch to proto.m4, the debian OSTYPE and DOMAIN definitions and 
my sendmail.mc and submit.mc (...of course on debian...) !
Here are my changes to the debian configuration files:

smtp:/home/schulte/sendmail-8.12.9/cf/cf# cat sendmail.mc
define(`_USE_ETC_MAIL_')dnl
VERSIONID(`$Id: sendmail.mc, v 8.12.3-4 2003-04-24 02:30:20 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
LOCAL_CONFIG
FEATURE(`masquerade_envelope')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`redirect')dnl
FEATURE(`nouucp', `reject')dnl
FEATURE(`mailertable')dnl
FEATURE(`virtusertable')dnl
FEATURE(`smrsh')dnl
define(`confLOCAL_MAILER', `cyrusv2')dnl
define(`confSEVEN_BIT_INPUT', `false')dnl
define(`confEIGHT_BIT_HANDLING', `mime')dnl
define(`confDEF_CHAR_SET', `iso-8859-15')dnl
define(`confCHECK_ALIASES', `true')dnl
define(`_VIRTUSER_STOP_ONE_LEVEL_RECURSION_', `true')dnl
define(`_NEED_MACRO_MAP_',`1')dnl
dnl #
dnl # SSL
dnl #
dnl # CA directory - CA certs should be herein
define(`confCACERT_PATH', `/etc/ssl/certs')dnl
dnl #
dnl # CA file (may be the same as client/server certificate)
define(`confCACERT',      `/usr/lib/ssl/demoCA/cacert.pem')dnl
dnl #
dnl # Server certificate/key (can be in the same file, and shared w/client)
dnl # NOTE: The key must *NOT* be encrypted !!!
define(`confSERVER_CERT', `/etc/mail/tls/sendmail-server.crt')dnl
define(`confSERVER_KEY',  `/etc/mail/tls/sendmail-server.key')dnl
dnl #
dnl # Clien certificate/key (can be in the same file, and shared w/server)
dnl # NOTE: The key must *NOT* be encrypted !!!
define(`confCLIENT_CERT', `/etc/mail/tls/sendmail-client.crt')dnl
define(`confCLIENT_KEY',  `/etc/mail/tls/sendmail-client.key')dnl
dnl #
dnl # Optional settings
define(`confTLS_SRV_OPTIONS', `V')dnl          # don't request user certs
dnl #
dnl # Do not touch anything below this line...
MAILER_DEFINITIONS
MAILER(cyrusv2)dnl <<<already known in cf/mailer/cyrusv2.m4
MAILER(smtp)dnl

smtp:/home/schulte/sendmail-8.12.9/cf/cf# cat submit.mc
define(`_USE_ETC_MAIL_')dnl
VERSIONID(`$Id: submit.mc, v 8.12.3-6.3 2003-04-04 16:02:54 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-msp')dnl
LOCAL_CONFIG
FEATURE(`use_ct_file')dnl
dnl #
dnl # SSL
dnl #
dnl # CA directory - CA certs should be herein
define(`confCACERT_PATH', `/etc/ssl/certs')dnl
dnl #
dnl # CA file (may be the same as client/server certificate)
define(`confCACERT',      `/usr/lib/ssl/demoCA/cacert.pem')dnl
dnl #
dnl # Server certificate/key (can be in the same file, and shared w/client)
dnl # NOTE: The key must *NOT* be encrypted !!!
define(`confSERVER_CERT', `/etc/mail/tls/sendmail-server.crt')dnl
define(`confSERVER_KEY',  `/etc/mail/tls/sendmail-server.key')dnl
dnl #
dnl # Clien certificate/key (can be in the same file, and shared w/server)
dnl # NOTE: The key must *NOT* be encrypted !!!
define(`confCLIENT_CERT', `/etc/mail/tls/sendmail-client.crt')dnl
define(`confCLIENT_KEY',  `/etc/mail/tls/sendmail-client.key')dnl
dnl #
dnl # Optional settings
dnl define(`confTLS_SRV_OPTIONS', `V')dnl          # don't request user 
certs
dnl #
dnl # Do not touch anything below this line...
FEATURE(`msp', `[127.0.0.1]', `MSA')dnl

smtp:/home/schulte/sendmail-8.12.9/cf/mailer# cat cyrusv2.m4
PUSHDIVERT(-1)
#
# Copyright (c) 2002 Sendmail, Inc. and its suppliers.
#       All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#       Contributed by Kenneth Murchison.
#

_DEFIFNOT(`_DEF_CYRUSV2_MAILER_FLAGS', `lsDFMnqXz')
_DEFIFNOT(`CYRUSV2_MAILER_FLAGS', `A@/:|m')
ifdef(`CYRUSV2_MAILER_ARGS',, `define(`CYRUSV2_MAILER_ARGS', `FILE 
/var/imap/socket/lmtp')')
define(`_CYRUSV2_QGRP', `ifelse(defn(`CYRUSV2_MAILER_QGRP'),`',`', ` 
Q=CYRUSV2_MAILER_QGRP,')')dnl

POPDIVERT

#########################################
###   Cyrus V2 Mailer specification   ###
#########################################

VERSIONID(`$Id: cyrusv2.m4,v 1.1 2002/06/01 21:14:57 ca Exp $')

Mcyrusv2,       P=[IPC], F=_MODMF_(CONCAT(_DEF_CYRUSV2_MAILER_FLAGS, 
CYRUSV2_MAILER_FLAGS), `CYRUSV2'),
                S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL, E=\r\n,
                _OPTINS(`CYRUSV2_MAILER_MAXMSGS', `m=', `, 
')_OPTINS(`CYRUSV2_MAILER_MAXRCPTS', `r=', `, 
')_OPTINS(`CYRUSV2_MAILER_CHARSET', `C=', 
`,')T=DNS/RFC822/SMTP,_CYRUSV2_QGRP
                A=CYRUSV2_MAILER_ARGS





More information about the Info-cyrus mailing list