<HTML><HEAD><TITLE>Re: OT Routing problem MS sendmail and exchange
{Scanned by HJMS}</TITLE></HEAD>
<BODY>
<DIV id=idOWAReplyText38314 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Thanks everyone who
gave me suggestions on how to solve this!</FONT></DIV>
<DIV dir=ltr>Im am very greatful.</DIV>
<DIV dir=ltr>Ended up using LUSER_HOST value for sendmail. Works great for
now but as has been pointed out Im keeping a watch out for mail loops.
Hanvent seen any yet :-)</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>/ Carl</DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Furnish, Trever G<BR><B>Sent:</B>
Tue 2003-10-14 18:07<BR><B>To:</B>
MAILSCANNER@JISCMAIL.AC.UK<BR><B>Subject:</B> Re: OT Routing problem MS
sendmail and exchange {Scanned by HJMS}<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>&gt; Mailscanner servr has 10 MX (mailgateway)<BR>&gt;
Sendmail server&nbsp; no MX (pop/IMAP)<BR>&gt; Exchange server&nbsp; no
MX<BR><BR>Ah, so you have three servers, not two, and you already have
this much<BR>working:<BR>MS -&gt; ex -&gt; sm<BR><BR>... so if ex doesn't
have the user, then it passes it along to sm.<BR><BR>And the only problem
you're having is that sm refuses to pass messages back<BR>to ex when a
user doesn't exist?&nbsp; Well there may be other ways to address<BR>this
but the simplest (at least to my knowledge) is still to assign
a<BR>subdomain to your ex system and then forward mail there using
virtusertable.<BR><BR>In other words, imagine assigning mail.foo.com to
ex, and assigning an<BR>@mail.foo.com address to each mailbox located on
ex.&nbsp; Then on the sm server,<BR>all you need is a list of the local
users.&nbsp; Such a list is easily produced<BR>in an automated fashion
(cut -f1 -d: /etc/passwd | sed -e 's/$/@foo.com/',<BR>for example).&nbsp;
Your virtusertable would look something like
this:<BR><BR>localuser1@foo.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
localuser1<BR>localuser2@foo.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
localuser2<BR>localuser3@foo.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
localuser3<BR>@foo.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
%1@mail.foo.com<BR><BR>Given such a set-up, any mail hitting the sm server
bound for localuser1,<BR>localuser2, or localuser3 would get delivered
locally, but any other mail<BR>for foo.com would get re-written and
delivered to the same user<BR>@mail.foo.com (your ex box).<BR><BR>I'm not
a sendmail guru by any means, but I have done the type of
transition<BR>you're describing many times using this method.&nbsp; More
information about the<BR>virtusertable can be found here:<BR><A
href="http://www.sendmail.org/m4/features.html#virtusertable"
target=_blank>http://www.sendmail.org/m4/features.html#virtusertable</A><B
R><BR>&gt; Maintaining the alias file on the Sendmail can work but
then<BR>&gt; I will have to<BR>&gt; add aliases there for every new user I
get on the Exchange<BR>&gt; (users that are<BR>&gt; totally new) and
change it for users i migrate.<BR>&gt; This is a bit too much
administation from my point of view<BR>&gt; and also it has<BR>&gt; the
potential of getting really messy. Who is where and what<BR>&gt; aliases
and so<BR>&gt; forth...<BR>&gt; We are understaffed and under funded so an
email admin is not really<BR>&gt; possible :-(<BR><BR>I can sympathize
with you, but I guess I just consider this the cost of<BR>doing a
migration.&nbsp; I'm also assuming that this is just a
temporary<BR>situation - that after you complete your migration, the
sendmail system will<BR>disappear and there will no longer be a need for
administration of it.<BR><BR>The little command-line I listed for
producing a list of local users above<BR>could pretty easily be scripted
up to produce your virtuser table.&nbsp; It only<BR>relies on your
removing user accounts when you transfer a user from sm to<BR>ex.&nbsp; If
you aren't going to remove the user accounts when you move them,<BR>then
you could simply maintain a list of moved users on the sm server
and<BR>use that to filter the password file as part of producing
virtusertable.<BR><BR>For example, given a file /etc/moved_users with
usernames one per line of<BR>the moved users, the following perl script
will produce a virtusertable file<BR>on stdout.<BR><BR># --------------- 
start of script ---------------<BR># Store me as
/usr/local/bin/makevirtusertable.pl<BR><BR>$old_domain="foo.com";<BR>$new_
domain="mail.foo.com";<BR>%local=();<BR>%moved=();<BR>unless (open(PASSWD,
"/etc/passwd")) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; die
"Unable to read /etc/passwd: $!\n";<BR>}<BR><BR>unless (open(MOVED,
"/etc/moved_users")) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; die
"Unable to read /etc/moved_users: $!\n";<BR>}<BR><BR>while
($line=&lt;PASSWD&gt;) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
($uname, undef)=split(':', $line,
2);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$local{$uname}=1;<BR>}<BR><BR>while ($uname=&lt;MOVED&gt;)
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chomp
$uname;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$moved{$uname}=1;<BR>}<BR><BR>foreach $uname (sort keys %local)
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unless (exists
$moved{$uname}){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print
"$uname\@$old_domain\t$uname\n";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp; }<BR>}<BR><BR>print "\@$old_domain&nbsp;&nbsp;&nbsp;
%1\@$new_domain\n";<BR># --------------- end of
script ---------------<BR><BR>Assuming this is the only thing that will be
in your virtusertable file, you<BR>could just wrap that script a simple
shell script and then put the shell<BR>script in crontab to run every 5
minutes.&nbsp; The shell script should just dump<BR>the perl script's
output into your virtusertable file and run make within<BR>the directory
that contains it.&nbsp; Then all you have to do is maintain one<BR>list of
moved users on the sendmail server, and that list contains only
the<BR>uname of the user's account.<BR><BR>An example shell script would
be:<BR><BR>#----------- start of shell
script ------------<BR>#!/bin/sh<BR>perlscript="/usr/local/bin/makevirtuse
rtable.pl"<BR>$perlscript &gt;/etc/mail/virtusertable<BR>(cd /etc/mail
&amp;&amp; make)<BR>#----------- end of shell
script --------------<BR><BR>Hope it
helps,<BR>Trever<BR><BR><BR>&gt; -----Original Message-----<BR>&gt; From:
Carl Boberg [<A href="mailto:carl.boberg@NRM.SE"
target=_blank>mailto:carl.boberg@NRM.SE</A>]<BR>&gt; Sent: Tuesday,
October 14, 2003 9:35 AM<BR>&gt; To: MAILSCANNER@JISCMAIL.AC.UK<BR>&gt;
Subject: Re: OT Routing problem MS sendmail and exchange {Scanned
by<BR>&gt; HJMS}<BR>&gt;<BR>&gt;<BR>&gt; Hi,<BR>&gt;<BR>&gt; Thank you
very much for your reply. Just to clarify some:<BR>&gt;<BR>&gt;
Mailscanner servr has 10 MX (mailgateway)<BR>&gt;<BR>&gt; Sendmail
server&nbsp; no MX (pop/IMAP)<BR>&gt; Exchange server&nbsp; no
MX<BR>&gt;<BR>&gt; Exhange recives all mail comming in from the
MailScanner and if the<BR>&gt; user@domain.com does not resolve it will
forward it to the<BR>&gt; Sendmail server.<BR>&gt; As it will with all
email it cant resolve.<BR>&gt; When a user on the Sendmail server want to
email a user on<BR>&gt; the Exchange<BR>&gt; server the Sednmail just says
550 user unknown.<BR>&gt;<BR>&gt; Maintaining the alias file on the
Sendmail can work but then<BR>&gt; I will have to<BR>&gt; add aliases
there for every new user I get on the Exchange<BR>&gt; (users that
are<BR>&gt; totally new) and change it for users i migrate.<BR>&gt; This
is a bit too much administation from my point of view<BR>&gt; and also it
has<BR>&gt; the potential of getting really messy. Who is where and
what<BR>&gt; aliases and so<BR>&gt; forth...<BR>&gt; We are understaffed
and under funded so an email admin is not really<BR>&gt; possible
:-(<BR>&gt;<BR>&gt; Any more suggestions are very welcome.<BR>&gt;<BR>&gt;
Best regards<BR>&gt; --------------------------------<BR>&gt; Carl
Boberg<BR>&gt; System &amp; Network Administrator<BR>&gt; Swedish Museum
of Naturalhistory<BR>&gt; Frescativägen 40<BR>&gt; 104 05
Stockholm<BR>&gt; Sweden<BR>&gt; Tel nr: 08-5195 5116<BR>&gt; Mobile:
0701-82 4055<BR>&gt; E-mail:
carl.boberg@nrm.se<BR>&gt; --------------------------------<BR>&gt;<BR>&gt
; -----Original Message-----<BR>&gt; From: MailScanner mailing list [<A
href="mailto:MAILSCANNER@JISCMAIL.AC.UK"
target=_blank>mailto:MAILSCANNER@JISCMAIL.AC.UK</A>]On<BR>&gt; Behalf Of
Furnish, Trever G<BR>&gt; Sent: den 14 oktober 2003 16:00<BR>&gt; To:
MAILSCANNER@JISCMAIL.AC.UK<BR>&gt; Subject: Re: OT Routing problem MS
sendmail and exchange {Scanned by<BR>&gt; HJMS}<BR>&gt;<BR>&gt;<BR>&gt; So
during your transition process you are trying to host the<BR>&gt; same
domain on<BR>&gt; two servers, each of which only has some of the valid
users<BR>&gt; for that domain?<BR>&gt; That won't work -- or at least it's
a very odd way of doing things.<BR>&gt;<BR>&gt; And maintaining a list of
which users have been moved and<BR>&gt; which ones haven't<BR>&gt; is "too
much administration"?&nbsp; If maintaining a list of users<BR>&gt; is too
much<BR>&gt; work for you, then hire an email administrator and
stop<BR>&gt; trying to do it<BR>&gt; yourself.&nbsp; Successfully
migrating from one mail system to another is a<BR>&gt; process that should
be undertaken by someone willing to be<BR>&gt; extremely careful<BR>&gt;
and extremely thorough.<BR>&gt;<BR>&gt; But in the spirit of being
helpful, I'll offer this<BR>&gt; suggestion: give your<BR>&gt; exchange
server its own subdomain and use sendmail's virtusertable to<BR>&gt;
forward mail to the users migrated to exchange.<BR>&gt;<BR>&gt; In greater
detail:<BR>&gt;<BR>&gt; Let's imagine that your original domain is
foo.com, and that<BR>&gt; your sendmail<BR>&gt; server is sm.foo.com and
your exchange server is ex.foo.com.<BR>&gt;<BR>&gt; You originally had MX
records that looked like this:<BR>&gt;
foo.com.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN MX&nbsp;&nbsp; 10
sm.foo.com.<BR>&gt;<BR>&gt; Given that starting point, what you should
have done was to assign a<BR>&gt; subdomain to the exchange server before
moving your users there.&nbsp; For<BR>&gt; example, you could assign
mail.foo.com to the exchange server:<BR>&gt; mail.foo.com.&nbsp;&nbsp; IN
MX&nbsp;&nbsp; 10 ex.foo.com.<BR>&gt;<BR>&gt; Then, when you create a
mailbox on the exchange server, you<BR>&gt; assign BOTH the<BR>&gt; user's
original @foo.com address AND a new @mail.foo.com<BR>&gt; address.&nbsp;
Exchange<BR>&gt; will happily accept multiple smtp addresses for the
same<BR>&gt; mailbox.&nbsp; Be sure<BR>&gt; that you set the @foo.com
address as the mailbox's primary address -<BR>&gt; otherwise when the user
sends email it will go out as<BR>&gt; something else.&nbsp; For<BR>&gt;
example, Joe Shmoe's new mailbox on the exchange server would<BR>&gt; have
two smtp<BR>&gt; addresses (as well as all the other addresses exchange
creates):<BR>&gt; joe.shmoe@foo.com&nbsp;&nbsp; &lt;-- set as
primary<BR>&gt; joe.shmoe@mail.foo.com<BR>&gt;<BR>&gt; Now, on your
sendmail system all you have to do is forward<BR>&gt; users as you
move<BR>&gt; them.&nbsp; You can do this with aliases or with the
virtuser<BR>&gt; table, whichever is<BR>&gt; appropriate for your
set-up.&nbsp; If you're using aliases, then<BR>&gt; on the
sendmail<BR>&gt; server you would have an alias of:<BR>&gt;
joe.shmoe:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
joe.shmoe@mail.foo.com<BR>&gt;<BR>&gt; After moving a user mailbox you
should forward and clear the<BR>&gt; user mail spool<BR>&gt; on the
sendmail server - then you will be able to spot any<BR>&gt; email still
being<BR>&gt; delivered to the user's spool.&nbsp; If there is still
mail<BR>&gt; flowing into the<BR>&gt; spool of a forwarded user, then he
has an address that you<BR>&gt; have missed -<BR>&gt; just forward that
one as well.<BR>&gt;<BR>&gt; When you have moved *all* users off of the
sendmail server,<BR>&gt; then you can<BR>&gt; take foo.com out of the
sendmail server's list of local domain names<BR>&gt;
(/etc/mail/local-host-names or /etc/mail/sendmail.cw) and add<BR>&gt; a
RELAY line<BR>&gt; to the sendmail access file for the domain (assuming
you<BR>&gt; still want to use<BR>&gt; the sendmail server as a relay for
it).&nbsp; Then you also need<BR>&gt; to update DNS to<BR>&gt; direct
email to the exchange server directly, so you might<BR>&gt; end up
with:<BR>&gt; foo.com.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN
MX&nbsp;&nbsp; 10 sm.foo.com.<BR>&gt;
foo.com.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN MX&nbsp;&nbsp; 5
ex.foo.com.<BR>&gt;<BR>&gt; If you intend to use the sendmail system as a
mailscanner<BR>&gt; gateway for the<BR>&gt; exchange server, then you also
need to prevent email from<BR>&gt; flowing directly<BR>&gt; to the
exchange server without first hitting the sendmail<BR>&gt; server.&nbsp;
If your<BR>&gt; exchange server is on windows server 2003 you can probably
just reject<BR>&gt; connections to port 25 from everything EXCEPT
sm.foo.com.&nbsp; If<BR>&gt; you have an<BR>&gt; earlier version of
windows then you probably want to use sendmail's<BR>&gt; mailertable or
smarthost feature instead.<BR>&gt;<BR>&gt; HTH,<BR>&gt;
Trever<BR>&gt;<BR>&gt;<BR>&gt; &gt; -----Original Message-----<BR>&gt;
&gt; From: Carl Boberg [<A href="mailto:carl.boberg@NRM.SE"
target=_blank>mailto:carl.boberg@NRM.SE</A>]<BR>&gt; &gt; Sent: Tuesday,
October 14, 2003 8:32 AM<BR>&gt; &gt; To:
MAILSCANNER@JISCMAIL.AC.UK<BR>&gt; &gt; Subject: OT Routing problem MS
sendmail and exchange<BR>&gt; {Scanned by HJMS}<BR>&gt; &gt;<BR>&gt;
&gt;<BR>&gt; &gt; Hi,<BR>&gt; &gt; I have been looking everywhere fo a
solution to this.<BR>&gt; &gt;<BR>&gt; &gt; Using Malscanner a mailgateway
(lowest MX)<BR>&gt; &gt;<BR>&gt; &gt; In the DMZ i have a sendmail sever
my users connetct to for<BR>&gt; &gt; POP/IMAP/SMTP<BR>&gt; &gt;<BR>&gt;
&gt; I now have a new Exchange server and new users on this one<BR>&gt;
&gt; and migrating old<BR>&gt; &gt; users<BR>&gt; &gt; slowly from the
sendmail to the exchange.<BR>&gt; &gt;<BR>&gt; &gt; MS smtpGW scans all
mail comming in an the sends all mail to the new<BR>&gt; &gt; Exchange
server.<BR>&gt; &gt; All email the exchange server cant resolve it sends
to the<BR>&gt; &gt; old sendmail<BR>&gt; &gt; server (even @domain.com
addresses)<BR>&gt; &gt; But the sendmail will only deliver @domain.com if
there exist<BR>&gt; &gt; a local user.<BR>&gt; &gt;<BR>&gt; &gt; I need to
figure out how to make sendmail deliver local<BR>&gt; &gt; addresses and
those<BR>&gt; &gt; @domain.com adresses it doesnt have localy sould be
sent to<BR>&gt; &gt; the exchange<BR>&gt; &gt; server?<BR>&gt;
&gt;<BR>&gt; &gt; How to solve when a local domain (@domain.com) address
has<BR>&gt; &gt; been moved???<BR>&gt; &gt;<BR>&gt; &gt; I could maintain
the aliasses file on the old server but that<BR>&gt; &gt; is way
too<BR>&gt; &gt; much administration.<BR>&gt; &gt;<BR>&gt; &gt; Also can I
make the Mailscanner Mailgateway relay mail to<BR>&gt; my internal<BR>&gt;
&gt; mailservers on a trial error basis?<BR>&gt; &gt; Incomming mail to
@domain.com first try<BR>&gt; internalmailserver1.domain.com<BR>&gt; &gt;
if NDR (non delivery reply) then try
internalmailserver2.domain.com<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;
Sorry if im unclear or messy in my description.<BR>&gt; &gt; Thanks for
any help in advance.<BR>&gt; &gt;<BR>&gt; &gt; Bets regards<BR>&gt;
&gt; --------------------------------<BR>&gt; &gt; Carl Boberg<BR>&gt;
&gt; System &amp; Network Administrator<BR>&gt; &gt; Swedish Museum of
Naturalhistory<BR>&gt; &gt; Frescativägen 40<BR>&gt; &gt; 104 05
Stockholm<BR>&gt; &gt; Sweden<BR>&gt; &gt; Tel nr: 08-5195 5116<BR>&gt;
&gt; Mobile: 0701-82 4055<BR>&gt; &gt; E-mail: carl.boberg@nrm.se<BR>&gt;
&gt; --------------------------------<BR>&gt;
&gt;<BR>&gt;<BR></FONT></P></DIV></BODY></HTML>
<HTML>###########################################<br><br>This message has
been scanned by F-Secure Anti-Virus for Microsoft Exchange.<br>For more
information, connect to http://www.F-Secure.com/</HTML>