VIRTUAL MAIL DOMAIN using PostFix on our server bigbang
Date: Mon Sep 2 17:22:56 MEST 2002
Thanks to David Schweiker I can build a virtual mail domain
for prof. Baechtold and Franck Robin for the Conference
they will organize in 2003 called WOCSDICE03
They wish a domain name for mailing as "wocsdice03.ethz.ch"
See also on tardis and by user obis@tardis and http://www.postfix.org
Sent a request to network@id.ee.ethz.ch for a new MX
wocsdice03.ethz.ch preference = 10, mail exchanger = bigbang.ee.ethz.ch
wocsdice03.ethz.ch preference = 20, mail exchanger = bernie.ethz.ch
Already prepared on bigbang: new user "woc03"
root@bigbang:/home/support/data/account/syst# nismatch woc03 passwd.org_dir
woc03:O18rwB3eGXN/g:30006:350:Franck Robin,syst,2002/09/02,Franck Robin
:/home/woc03:/usr/bin/tcsh:11932:0:::::
cd /etc/postfix/
root@bigbang:/etc/postfix# vim main.cf
..
virtual_maps = pcre:/etc/postfix/virtusertable_pcre
..
In the file 'virtusertable_pcre' we have the 'regular expressions'
which will be used by PERL for filtering:
root@bigbang:/etc/postfix# cat /etc/postfix/virtusertable_pcre
/^wocsdice03\.ethz\.ch$/ nonexistant
/^(.*)@wocsdice03\.ethz\.ch$/ woc03+$1
Above means that all mail to any_name@wocsdice03.ethz.ch go
to the user 'woc03' BUT with the suffix "+any_name" !!
This suffix is used to check the .forward+any_name files in
the Home Dir of the user woc03 to see what to do with this mail (see below).
Restart Postfix in order to reread the configuration files:
root@bigbang:/etc/init.d# ./postfix stop
postfix-script: stopping the Postfix mail system
root@bigbang:/etc/init.d# ./postfix start
postfix-script: starting the Postfix mail system
Output in /
Sep 2 17:07:09 bigbang postfix-script: refreshing the Postfix mail system
Sep 2 17:07:09 bigbang postfix/master[2237]: reload configuration
In /home/woc03 there should be files as
.forward+ where is a name used as recipient for wocsdice03
for instance: mailto: info@wocsdice03.ethz.ch
then is "info"
The content of this file is used to decide what to do with the mail.
Please note that the "plus" character (+) has a special meaning.
Possibilities:
send it to the inbox of "woc03" --> when no file '.forward+name' is present
send it to somebody else --> file contains an e-mail address
put it into a file --> file contains an ABSOLUTE file address, as for instance
/home/woc03/mail_folders/submissions
Test executed with the following files:
root@bigbang:/home/woc03# cat .forward+test
ballisti@ifh.ee.ethz.ch
root@bigbang:/home/woc03# cat .forward+test2
/home/woc03/mail_folders/test
bigbang:ballisti:[utilities]:87 % mailx test@wocsdice03.ethz.ch
Subject: test
test
.
EOT
bigbang:ballisti:[utilities]:88 % mailx test2@wocsdice03.ethz.ch
Subject: test
.
EOT
deneb.ee.ethz.ch:ballisti:[ballisti]:82 % telnet bigbang 25
Trying 129.132.2.214...
Connected to bigbang.ee.ethz.ch.
Escape character is '^]'.
220 bigbang.ee.ethz.ch ESMTP Postfix
HELO bla
250 bigbang.ee.ethz.ch
MAIL FROM: david@schweikert.ch
250 Ok
RCPT TO: test@wocsdice03.ethz.ch
250 Ok
DATA
354 End data with .
test
.
250 Ok: queued as CBF8D1DF83
QUIT
221 Bye
Connection closed by foreign host.
Sep 2 17:09:26 bigbang postfix/qmgr[19273]: C4F211DF83:
from=, size=346
(queue active)
Sep 2 17:09:26 bigbang postfix/cleanup[19271]: E15441DF85:
message-id=<20020902150926.C4F211DF83
@bigbang.ee.ethz.ch>
Sep 2 17:09:26 bigbang postfix/local[19274]: C4F211DF83:
to=, relay=l
ocal, delay=0, status=sent (forwarded as E15441DF85)
Sep 2 17:09:53 bigbang postfix/qmgr[19273]: EB8D01DF83:
from=, size=341
(queue active)
Sep 2 17:09:53 bigbang postfix/local[19274]: EB8D01DF83:
to=, relay=
local, delay=1, status=sent (/home/woc03/mail_folders/test)
Return-Path:
Delivered-To: ballisti@ifh.ee.ethz.ch
Received: by bigbang.ee.ethz.ch (Postfix) id 81E6C1DF85; Mon, 2 Sep 2002
17:14:48 +0200 (MET DST)
Delivered-To: woc03+test@ifh.ee.ethz.ch
Received: from bla (deneb.ee.ethz.ch [129.132.20.65]) by bigbang.ee.ethz.ch
(Postfix) with SMTP id CBF8D1DF83 for ; Mon, 2 Sep
2002 17:14:12 +0200 (MET DST)
Message-ID: <20020902151412.CBF8D1DF83@bigbang.ee.ethz.ch>
Date: Mon, 2 Sep 2002 17:14:12 +0200 (MET DST)
From: david@schweikert.ch
To: undisclosed-recipients: ;
X-Spam-Status: No, hits=4.2 required=5.0
tests=UNDISC_RECIPS,NO_REAL_NAME,SUBJ_MISSING version=2.20
X-Spam-Level: ****
test
Return-Path:
Delivered-To: ballisti@ifh.ee.ethz.ch
Received: by bigbang.ee.ethz.ch (Postfix) id E15441DF85; Mon, 2 Sep 2002
17:09:26 +0200 (MET DST)
Delivered-To: woc03+test@ifh.ee.ethz.ch
Received: by bigbang.ee.ethz.ch (Postfix, from userid 3501) id C4F211DF83;
Mon, 2 Sep 2002 17:09:26+0200 (MET DST)
To: test@wocsdice03.ethz.ch
Subject: test
Content-Length: 5
Message-ID: <20020902150926.C4F211DF83@bigbang.ee.ethz.ch>
Date: Mon, 2 Sep 2002 17:09:26 +0200 (MET DST)
From: ballisti@ifh.ee.ethz.ch (Ray Ballisti)
X-Spam-Status: No, hits=0.0 required=5.0 tests= version=2.20
X-Spam-Level:
test
------------------------------------------------------------------------------
To see which server works for which mail-domain:
deneb.ee.ethz.ch:ballisti:[ballisti]:85 % nslookup
Default Server: tardis.ee.ethz.ch
Address: 129.132.2.217
> set q=mx
> ifh.ee.ethz.ch
Server: tardis.ee.ethz.ch
Address: 129.132.2.217
Non-authoritative answer:
ifh.ee.ethz.ch preference = 10, mail exchanger = bigbang.ee.ethz.ch
ifh.ee.ethz.ch preference = 20, mail exchanger = bernie.ethz.ch
> iis.ee.ethz.ch
Server: tardis.ee.ethz.ch
Address: 129.132.2.217
Non-authoritative answer:
iis.ee.ethz.ch preference = 20, mail exchanger = bernie.ethz.ch
iis.ee.ethz.ch preference = 10, mail exchanger = laggin.ee.ethz.ch
Please mail suggestions (very welcome) or requests to ballisti@ifh.ee.ethz.ch
Ballisti Ray