Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Aliasing" domains?

0 views
Skip to first unread message

Thomas -Balu- Walter

unread,
Jul 28, 2002, 12:58:31 PM7/28/02
to
How am I supposed to set up "domain aliases" e.g. all mails to domain2
are delivered to the same users mailbox that is in domain1.

In short I was thinking of something like this in the virtual table:

@domain2 @domain1

I think I've read it somewhere, but can not remember if it is possible
or not. If not I guess I have the following options:

- set up virtual entries for all users and all domain aliases
e.g.
user@domain2 user@domain1
user@domain3 user@domain1
user2@domain2 user2@domain1
This would be very error-prone in maintaining.

- Use regexp or pcre tables to make something like (is this correct?)
/^(.*)@domain2$/ ${1}@domain1
I am not sure if I like this solution, because I have my postfix data
in MySQL tables and this would add a textfile that has to be
maintained in addition

Others?

Balu
--
"Linux is like a fractal: No matter how deep you go, there's always
more!" [Casey Bralla, 24.01.2001 in lfs-d...@linuxfromscratch.org]
-
To unsubscribe, send mail to majo...@postfix.org with content
(not subject): unsubscribe postfix-users

Dean Strik

unread,
Jul 28, 2002, 1:16:47 PM7/28/02
to
Thomas -Balu- Walter wrote:
> How am I supposed to set up "domain aliases" e.g. all mails to domain2
> are delivered to the same users mailbox that is in domain1.
>
> In short I was thinking of something like this in the virtual table:
>
> @domain2 @domain1

Why not add them to mydestination?

--
Dean C. Strik Eindhoven University of Technology
de...@stack.nl | de...@ipnet6.org | http://www.ipnet6.org/
"This isn't right. This isn't even wrong." -- Wolfgang Pauli

Dean Strik

unread,
Jul 28, 2002, 1:26:04 PM7/28/02
to
Dean Strik wrote:
> Thomas -Balu- Walter wrote:
> > How am I supposed to set up "domain aliases" e.g. all mails to domain2
> > are delivered to the same users mailbox that is in domain1.
> >
> > In short I was thinking of something like this in the virtual table:
> >
> > @domain2 @domain1
>
> Why not add them to mydestination?

Ok, quite obvious you can't if domain1 is virtual as well ;)

@domain1 @domain2

in virtual works just fine.

Michael Tokarev

unread,
Jul 28, 2002, 3:16:11 PM7/28/02
to
Thomas -Balu- Walter wrote:
>
> How am I supposed to set up "domain aliases" e.g. all mails to domain2
> are delivered to the same users mailbox that is in domain1.
>
> In short I was thinking of something like this in the virtual table:
>
> @domain2 @domain1

This will work fine *except* of one issue: postfix will gladly accept
mail for anything@domain2, even if there is no such user in domain1.

> I think I've read it somewhere, but can not remember if it is possible
> or not. If not I guess I have the following options:
>
> - set up virtual entries for all users and all domain aliases
> e.g.
> user@domain2 user@domain1
> user@domain3 user@domain1
> user2@domain2 user2@domain1
> This would be very error-prone in maintaining.

Why this will be error-prone? Set up a file for domain1, and
use something like:

cat domain1 > domains
for f in domain2 domain3 ; do
sed "s/@domain1/@$f/" domain1
done >> domains
postmap domains

In the other words: a little shell programming together with a
makefile is your very good friend.

> - Use regexp or pcre tables to make something like (is this correct?)
> /^(.*)@domain2$/ ${1}@domain1
> I am not sure if I like this solution, because I have my postfix data
> in MySQL tables and this would add a textfile that has to be
> maintained in addition

This is the same as "@domain2 @domain1". Oh, and since you mentioned
mysql map - i think there should/may be an option to set up a query
so it will return the same information when queried any of your domainN.
But I don't know more.

/mjt

Thomas -Balu- Walter

unread,
Jul 28, 2002, 3:47:37 PM7/28/02
to
+ Michael Tokarev <m...@tls.msk.ru> [28.07.02 21:27]:

> Thomas -Balu- Walter wrote:
> > In short I was thinking of something like this in the virtual table:
> > @domain2 @domain1
>
> This will work fine *except* of one issue: postfix will gladly accept
> mail for anything@domain2, even if there is no such user in domain1.

It will accept, put in queue, notice that user is unknown and bounce it?
Does it have any serious consequences other than that?

> > - set up virtual entries for all users and all domain aliases
> > e.g.
> > user@domain2 user@domain1
> > user@domain3 user@domain1
> > user2@domain2 user2@domain1
> > This would be very error-prone in maintaining.
>
> Why this will be error-prone? Set up a file for domain1, and
> use something like:
>
> cat domain1 > domains
> for f in domain2 domain3 ; do
> sed "s/@domain1/@$f/" domain1
> done >> domains
> postmap domains
>
> In the other words: a little shell programming together with a
> makefile is your very good friend.

As I said: My data is stored in mysql-tables. The frontend for that
has to be written yet, right now it's phpMyAdmin ;) And manual fiddling
as done ATM _is_ error prone :)

Balu

Michael Tokarev

unread,
Jul 28, 2002, 5:08:54 PM7/28/02
to
Thomas -Balu- Walter wrote:
>
> + Michael Tokarev <m...@tls.msk.ru> [28.07.02 21:27]:
> > Thomas -Balu- Walter wrote:
> > > In short I was thinking of something like this in the virtual table:
> > > @domain2 @domain1
> >
> > This will work fine *except* of one issue: postfix will gladly accept
> > mail for anything@domain2, even if there is no such user in domain1.
>
> It will accept, put in queue, notice that user is unknown and bounce it?
> Does it have any serious consequences other than that?

No, there is no more. I personally consider this very issue to be serious -
all sorts of dictionary attacks that spammers performs will be yours, with
all issues with (undeliverable or sent to faked recipients) bounces etc.

[]


> As I said: My data is stored in mysql-tables. The frontend for that
> has to be written yet, right now it's phpMyAdmin ;) And manual fiddling
> as done ATM _is_ error prone :)

Yes, this method IS error-prone. But I said about different possiblity,
something like this:

select destination from users, domains
where domain||'@'||user = :query_string;

(first try, without any thinking). I.e., it may be possible to construct
a query in a "backend" (postfix) that will equally work for any domains
given a list of bare *usernames* (localparts) and list of domains (star
join).

/mjt

Ralf Hildebrandt

unread,
Jul 29, 2002, 2:27:23 AM7/29/02
to
On Sun, Jul 28, 2002 at 10:02:44PM +0200, Thomas -Balu- Walter wrote:
> + Michael Tokarev <m...@tls.msk.ru> [28.07.02 21:27]:
> > Thomas -Balu- Walter wrote:
> > > In short I was thinking of something like this in the virtual table:
> > > @domain2 @domain1
> >
> > This will work fine *except* of one issue: postfix will gladly accept
> > mail for anything@domain2, even if there is no such user in domain1.
>
> It will accept, put in queue, notice that user is unknown and bounce it?
> Does it have any serious consequences other than that?

Yes, some mails are unbouncable, namely the ones where the sending
domain doesn't accept bounces.

--
Ralf Hildebrandt (Im Auftrag des Referat V A) Ralf.Hil...@charite.de
Charite Campus Virchow-Klinikum Tel. +49 (0)30-450 570-155
Referat V A - Kommunikationsnetze - Fax. +49 (0)30-450 570-916
cc:Mail SMTPLINK: A 5 year old child left in charge of a large sorting
office. Can't reach over the counter properly, can't handle more than
one letter at once and has to go looking for a grownup whenever it
wants to deliver to mail to other towns. Often opens parcels to look
for shiny things inside then just delivers the wrapping paper onwards.

0 new messages