Jump to content

Virtual Mail with Postfix/MySQL [solved]


ianw1974
 Share

Recommended Posts

I've been following a howto on setting up a Mail Server using Postfix/MySQL. It's all working fine, but I'm trying to tidy things up, because I don't understand a few things.

 

Note, I've abbreviated a lot of table info, because it's just to get a gist of what's there.

 

First off, there are a few tables created, most of which I know what are doing. There is one however, I don't know why it exists. The tables I have are:

 

alias
relocated
transport
users
virtual

 

The alias table is simple. It's used for local users, like root, or admin, etc, that exist on the Linux system, so you have:

 

admin = admin@mydomain.com

 

The transport table is where I set up the normal domains, or virtual domains. So:

 

mydomain.com = local:
virtual.mydomain.com = virtual

 

The users table is where I configure the users, so:

 

admin@mydomain.com = /home/admin/.maildir
ian@virtual.mydomain.com = /home/vmail/ian/.maildir

 

The virtual table, then tells me to redirect for virtual users, so:

 

ian@mydomain.com = ian@virtual.mydomain.com

 

this is so that the email ends up in his /home/vmail/ian/.maildir, otherwise I get user "ian" doesn't exist, because it tries to map it to the user ian that doesn't exist on the Linux system as a user - because he's virtual.

 

The problem is, I don't know why I need the relocated table. I've been trying to figure out a better way for logging in through webmail. The reason is, my virtual users HAVE to log in using ian@virtual.mydomain.com instead of ian@mydomain.com. At first I thought the relocated table would solve this, so I could redirect in a similar way for the routing of emails to the virtual account. But it doesn't work.

 

I did think of setting my virtual domain so it just said "work". Then the user would log in with ian@work via webmail. However, when I do this, the email doesn't forward to the account, and fails because it then appends the rest of the domain to the end of the name. So, it would become ian@work.mydomain.com.

 

Anyone any ideas as to what relocated is for, and how I can clean up the virtual logins? I know I could just create Linux usernames and passwords, but that gets round the whole point of the virtual user process.

 

Just for info, the link for the virtual howto is:

 

http://www.gentoo.org/doc/en/virt-mail-how...style=printable

Link to comment
Share on other sites

I know why I'm getting the problem, it's because when I log into webmail, it looks at the users table. I just need to figure a way to clean it up.

 

I would need to point the login lookups to another table so it can figure out one email address, points to the users database for the username and password, and then go from there. However, I'm not sure how I would do this, so I'll investigate and figure out how I can tidy it up.

 

I'll check the link though, as there might be something in there that may help.

Link to comment
Share on other sites

I've actually solved the problem this morning now. It was really simply.

 

All I had to do was create another field within the table, of which I called "login". I put this between the first and third columns which were "id" and "email".

 

Then I filled with a username, be it, admin, ian, etc, etc. Then I edited the /etc/courier/authlib/authmysqlrc file so that the field:

 

MYSQL_LOGIN_FIELD      login

 

before this was pointing to the "email" field, which was why I was having problems. Now I don't have any problems at all :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...