LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-31-2005, 03:48 PM   #1
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Rep: Reputation: 30
Exim4: Two accounts same name, different domains?


Hello,

I'm sure this is possible, it's just been so long since I played with my mail server (Exim4) that I can't get my head back into it.

I have an account named 'me'. It was my personal email account, as in me@mydomain.com.

My email server is now running three different domains and I want to create a 'me' account on another domain as well, as in me@myotherdomain.com.

Any ideas where to start?

Thanks!
 
Old 01-31-2005, 05:38 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,743
Blog Entries: 4

Rep: Reputation: 76
This is not difficult. Just edit exim conf to look like this (This line should be near the top):
Code:
domainlist local_domains = mydomain.com : myotherdomain.com
Now mail to 'me' at either domain will be routed locally the same as always, that is, either through a redirection in 'aliases' or to a real user account.

Edit: The above assumes that the MX records for both domains point to this server...

Last edited by bulliver; 01-31-2005 at 05:41 PM.
 
Old 02-01-2005, 09:18 AM   #3
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by bulliver
This is not difficult. Just edit exim conf to look like this (This line should be near the top):
Code:
domainlist local_domains = mydomain.com : myotherdomain.com
Now mail to 'me' at either domain will be routed locally the same as always, that is, either through a redirection in 'aliases' or to a real user account.

Edit: The above assumes that the MX records for both domains point to this server...
Heya!

Thanks for responding.

I forgot one vital piece of information: I want the two accounts to go to different people (ie - me@onedomain.com to me and me@otherdomain.com to my wife).

On a high level I think I need to do something like recreate my 'me' account into two accounts: 'me@onedomain.com' and 'me@otherdomain.com' using the force-bad-name (or whatever it's called) on my mail server. Then somehow when mail comes in - exim (or something) has to parse out the domain part and then send it to the proper account.

Or something like that.....??

Thanks!
 
Old 02-01-2005, 12:04 PM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,743
Blog Entries: 4

Rep: Reputation: 76
Knew it couldn't be that easy...

Ok so, I don't know how to do this for local delivery, but if you add a stanza such as:
Code:
aliases:
   driver = aliasfile
   file = /etc/mail/$domain.aliases
   search_type = lsearch
now you need two alias files. /etc/mail/onedomain.com.aliases and /etc/mail/otherdomain.com.aliases.
Now me@onedomain.com will look at onedomain.com.aliases to resolve 'me', whilst me@otherdomain.com will look at otherdomain.com.aliases where presumably 'me' will be an alias to your wife's real address...

I am taking this strait out of the Exim book, but I have never tried this...good luck.

Last edited by bulliver; 02-01-2005 at 12:05 PM.
 
Old 02-01-2005, 02:38 PM   #5
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by bulliver
Knew it couldn't be that easy...

Ok so, I don't know how to do this for local delivery, but if you add a stanza such as:
Code:
aliases:
   driver = aliasfile
   file = /etc/mail/$domain.aliases
   search_type = lsearch
now you need two alias files. /etc/mail/onedomain.com.aliases and /etc/mail/otherdomain.com.aliases.
Now me@onedomain.com will look at onedomain.com.aliases to resolve 'me', whilst me@otherdomain.com will look at otherdomain.com.aliases where presumably 'me' will be an alias to your wife's real address...

I am taking this strait out of the Exim book, but I have never tried this...good luck.
Heya..

This sounds reasonable, but I'm not sure what the 'aliasfile' is supposed to be....is that an example? The word aliasfile itself creates an error when I try to restart the MTA.
 
Old 02-01-2005, 03:01 PM   #6
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,743
Blog Entries: 4

Rep: Reputation: 76
Hey. Sorry, this is an old book, I think the alias driver is now called "redirect".

aliases are just a way to map email prefixes (local parts in exim terminology) to either a local account or another email address entirely. You almost certainly already have one in /etc/mail/aliases or perhaps just /etc/aliases.

The file looks like this:
Code:
# Basic system aliases -- these MUST be present.
MAILER-DAEMON:      root
postmaster:         root
info                bulliver
# General redirections for pseudo accounts.
adm:                root
bin:                root
daemon:             root
exim:               root
lp:                 root
mail:               root
named:              root
nobody:             root
postfix:            root

# Well-known aliases -- these should be filled in!
root:               bulliver
What you can see here is that mail sent to adm@ or exim@ etc are actually mapped to 'root@' and root in turn is mapped to bulliver@ (which is my personal account to collect all system mail). This works for anything however, I also have:
Code:
darrenkirby:        bulliver
darren:             bulliver
dkirby:             bulliver
dbot:               bulliver
in aliases so an email sent to any of the four above addresses will actually be sent to bulliver's mailbox.

You can also make an alias to an email account at a different domain ie:
Code:
darrenkirby:             dkirby@some_other_domain.com
In your case, you need two alias files, one for each domain so that exim knows which mailbox to send each me@ mail to. Just a note: you need to run 'newaliases' after updating an alias file.

Again though...I have never actually set up something like you want, so I am just trying to point you in the right direction.
 
Old 02-01-2005, 03:26 PM   #7
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Original Poster
Rep: Reputation: 30
Thanks for all the help...I'm almost there

I have the following lines in my /etc/exim4/exim4.conf.template file:

aliases:
driver = redirect
file = /etc/mail/$domain.aliases
search_type = lsearch

and I have a /etc/mail/mywifesdomain.com.aliases file with the single line me@mywifesdomain.com: kelly in it.

When I try to restart my MTA (after running /etc/exim4/update.exim4.conf.conf) I get the error that 'search_type' is not understood.

If I take that line out, the MTA will restart, but any mail to me@mywifesdomain.com just gets bounced with the error 'User unknown in virtual alias table'.

I was hoping that just a simple line in my /etc/aliases file reading 'me@mywifesdomain.com: kelly' would work, but alas no...

Any more ideas?

THanks!

Edit: I probably should mention that the mywifesdomain.com MX record already points to my machine and I get mail for her domain. That part is set up correctly. It's just that since she likes my 'me@mydomain.com' account so much that she's insisting on her own....groan.

Last edited by jonwatson; 02-01-2005 at 03:27 PM.
 
Old 02-01-2005, 03:42 PM   #8
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,743
Blog Entries: 4

Rep: Reputation: 76
Just one idea: The location of the alias files are a build-time configuration option for exim that cannot be changed, so if your current alias file lives in /etc then you will want to make the other one there too. Don't forget to change "file = /etc/mail/$domain.aliases" to "file = /etc/$domain.aliases

Another idea, is that perhaps exim strips the ".com" from the $domain variable, so try just mydomain.aliases instead of mydomain.com.aliases

This book is really giving me troubles. Philip Hazel obviously made a lot of non-backwards compatible changes between version 3 and 4, because what is in the book does not correspond to the current exim docs.
 
Old 02-01-2005, 04:54 PM   #9
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by bulliver
Just one idea: The location of the alias files are a build-time configuration option for exim that cannot be changed, so if your current alias file lives in /etc then you will want to make the other one there too. Don't forget to change "file = /etc/mail/$domain.aliases" to "file = /etc/$domain.aliases

Another idea, is that perhaps exim strips the ".com" from the $domain variable, so try just mydomain.aliases instead of mydomain.com.aliases

This book is really giving me troubles. Philip Hazel obviously made a lot of non-backwards compatible changes between version 3 and 4, because what is in the book does not correspond to the current exim docs.
Excellent ideas. I'll play with them tonight and post back my results.

Thanks again for you help.
 
Old 02-02-2005, 12:14 PM   #10
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Original Poster
Rep: Reputation: 30
Grrr...

Nothing works, I always get the email bounced back with the error 'User unknown in virtual alias table'

I've Googled it, but there's no quick answers out there. Obviously this seemingly simple thing is much more complicated than I thought.

It's driving me nuts though, I mean all I want to do is write a..what...a redirector? That will look at the whole email address 'me@mywifesdomain.com' and put it in the local mywifesname mailbox. Why is that so hard? Arrgh...
 
Old 02-02-2005, 12:24 PM   #11
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,743
Blog Entries: 4

Rep: Reputation: 76
Quote:
It's driving me nuts though, I mean all I want to do is write a..what...a redirector? That will look at the whole email address 'me@mywifesdomain.com' and put it in the local mywifesname mailbox. Why is that so hard? Arrgh...
Heh, it is easy... as long as you know what you're doing. Reading the docs it is quite clear that exim has many filtering tools including reg-exps to make what you want easy, but unfortunately I don't understand how to implement them, or how they work...so I cannot help.

Maybe time to hit up an exim mailing list?
 
Old 02-02-2005, 06:00 PM   #12
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Original Poster
Rep: Reputation: 30
Oh sure....bring the old 'if you know what you're doing' into it.

Of course I don't know what I'm doing!!!

I'll troll around the Intenet and see what there is to see...
 
Old 02-02-2005, 09:19 PM   #13
mfrick
Member
 
Registered: Sep 2004
Location: Perth
Posts: 51

Rep: Reputation: 15
Unfortunately I haven't had a play with exim yet so not sure if sites like this (http://www.tty1.net/virtual_domains_en.html) help. But for exactly what you want I usually use qmail with vpopmail etc etc and the easy way to install these I reckon is through the lazydog installer (http://lazyinstaller.net/) this project is just a shell script to grab all the installers you need and install them for ya the vpopmail handles multiple domains no problems at all. Using this though your username for checking mail will be username@mydomain.com not username but hey it is a small sacrifice.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating email accounts/domains etc... Swakoo Linux - Newbie 2 12-09-2005 06:59 AM
samba accounts/ unix accounts Buzz88 Linux - Newbie 3 09-25-2005 08:16 AM
qmail -- new accounts can't receive mail, but old accounts can b:z *BSD 1 07-13-2005 12:42 AM
exim4 exim4, setup debian tongueroo Linux - Networking 1 11-09-2004 04:12 AM
virtual email accounts on different domains js_530 Linux - Networking 0 07-26-2003 03:51 PM


All times are GMT -5. The time now is 01:53 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration