Quick /etc/aliases question

dalearyous

Senior member
Jan 8, 2006
836
0
0
so i wanted to create a mailing list. i know how to edit the /etc/aliases file correctly but my question is this:

my VPS hosts several sites and domains, how do i specify an alias for a certain domain? (i'm a noob so go easy)

example:
lets say i host domain1.com and domain2.com on my VPS

the /etc/aliases files seems to be global, how do i setup for, lets say domain2.com a mailing list like this:

info: bob,sam,joe

where info is info@domain2.com and bob is bob@domain2.com and sam is sam@domain2.com and joe is joe@domain2.com
 

TPk

Junior Member
Oct 6, 2010
4
0
0
If your mailer is set up correctly, all you need to do is this:

info: so-and-so@blah.com, whoever@gmail.com, someone@hotmail.com

etc. Just put the full email address (and run "newaliases")


If this is an MTA and you're trying to set up a distribution list, usually that is handled somewhere else (unless you're actually using sendmail). For e.g., postfix uses /etc/postfix/virtual for that.
 
Last edited:

dalearyous

Senior member
Jan 8, 2006
836
0
0
ok but how does the server know that the info isn't info@adifferentdomain.com ?

like what if domain1.com had info alias and domain2.com had info alias... if you did:

info: whatever@whatever.com

wouldn't it send all info@ to whatever@whatever.com

my etc/postfix/virtual_aliases is blank so i don't think thats what it is using

oh and when i run newaliases i just type in newaliases as the root user?
 
Last edited:

TPk

Junior Member
Oct 6, 2010
4
0
0
ok but how does the server know that the info isn't info@adifferentdomain.com ?

like what if domain1.com had info alias and domain2.com had info alias... if you did:

info: whatever@whatever.com

wouldn't it send all info@ to whatever@whatever.com

my etc/postfix/virtual_aliases is blank so i don't think thats what it is using

oh and when i run newaliases i just type in newaliases as the root user?

It will use the default domain of the machine it's running on. Postfix doesn't use /etc/aliases

If you need this in postfix it is quite easy, just do like so in /etc/postfix/virtual:

Code:
target@somedomain.org     someone@gmail.com,someoneelse@hotmail.com
Then run

Code:
postmap /etc/postfix/virtual
 

dalearyous

Senior member
Jan 8, 2006
836
0
0
It will use the default domain of the machine it's running on.

first, thanks for your clarification. can i change the default domain of the VPS? if not, can i specify it for a specific domain?

also, how do i create a catch all for a domain?
 
Last edited: