Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 19th April 2005, 17:23
mike mike is offline
Junior Member
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setup mailaccount

Hi,

I have followed the SuSE 9.2 server "The Perfect Setup".

Now how do I create a mailaccount using courier imap?

Michael
Reply With Quote
Sponsored Links
  #2  
Old 19th April 2005, 17:27
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

First you have to tell Postfix to deliver emails to a user's Maildir:

Code:
postconf -e 'home_mailbox = Maildir/'
postconf -e 'mailbox_command ='
/etc/init.d/postfix restart
Then you have to create a system user and a password:

Code:
useradd -d /home/sample_user -g users sample_user
passwd sample_user
Then run

Code:
postconf -e 'virtual_maps = hash:/etc/postfix/virtusertable'
postconf -e 'mydestination = /etc/postfix/local-host-names'
/etc/postfix/local-host-names should contain all domains that you want to accept emails for, e.g.:

Code:
localhost
your.server.name
localhost.your.server.name
example.com
yourdomain.com
/etc/postfix/virtusertable looks like this:

Code:
info@yourdomain.com  sample_user
thomas@example.com  sample_user
webmaster@yourdomain.com  sample_user
Emails for info@yourdomain.com, thomas@example.com and webmaster@yourdomain.com will now arrive in the mailbox of sample_user.

Everytime you change /etc/postfix/virtusertable you have to run the following command:

Code:
postmap /etc/postfix/virtusertable
Now restart Postfix:

Code:
/etc/init.d/postfix restart
and you're done!
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
Mini (9th November 2010)
  #3  
Old 20th April 2005, 12:08
mike mike is offline
Junior Member
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Falko! It is working...

Michael
Reply With Quote
  #4  
Old 20th August 2007, 23:17
johnnynine johnnynine is offline
Junior Member
 
Join Date: Aug 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What's the difference between using /etc/postfix/virtusertable and /etc/aliases?
Reply With Quote
  #5  
Old 21st August 2007, 18:37
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

/etc/aliases maps the mails for existing system users to another system user. virtusertable defines the email addresses that belong to a system user.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 21st August 2007, 20:09
johnnynine johnnynine is offline
Junior Member
 
Join Date: Aug 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
/etc/aliases maps the mails for existing system users to another system user. virtusertable defines the email addresses that belong to a system user.
I have my /etc/aliases file mapping non-existing system users to a system user and it works fine, so I don't quite understand?
Reply With Quote
  #7  
Old 25th August 2007, 09:32
johnnynine johnnynine is offline
Junior Member
 
Join Date: Aug 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
/etc/aliases maps the mails for existing system users to another system user. virtusertable defines the email addresses that belong to a system user.
Ok, I reread this and it makes sense... too many late night linux installs.
Reply With Quote
  #8  
Old 30th August 2007, 00:36
Happy Happy is offline
Member
 
Join Date: Jun 2007
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default creating email accounts

Quote:
Originally Posted by falko
First you have to tell Postfix to deliver emails to a user's Maildir:

Code:
postconf -e 'home_mailbox = Maildir/'
postconf -e 'mailbox_command ='
/etc/init.d/postfix restart
Then you have to create a system user and a password:

Code:
useradd -d /home/sample_user -g users sample_user
passwd sample_user
Then run

Code:
postconf -e 'virtual_maps = hash:/etc/postfix/virtusertable'
postconf -e 'mydestination = /etc/postfix/local-host-names'
/etc/postfix/local-host-names should contain all domains that you want to accept emails for, e.g.:

Code:
localhost
your.server.name
localhost.your.server.name
example.com
yourdomain.com
/etc/postfix/virtusertable looks like this:

Code:
info@yourdomain.com  sample_user
thomas@example.com  sample_user
webmaster@yourdomain.com  sample_user
Emails for info@yourdomain.com, thomas@example.com and webmaster@yourdomain.com will now arrive in the mailbox of sample_user.

Everytime you change /etc/postfix/virtusertable you have to run the following command:

Code:
postmap /etc/postfix/virtusertable
Now restart Postfix:

Code:
/etc/init.d/postfix restart
and you're done!
Ok I orginally created the users mailboxes in webmin

and then created them in
/etc/postfix/virtusertable
when I ran /etc/init.d/postfix restart
I got a error/warning saying duplicate -
however the users remained in
/etc/postfix/virtusertable

Should I expect any issue
If not then I will begin testing as I am done except for doing some Spam catching/filtering

Happy
Reply With Quote
  #9  
Old 30th August 2007, 22:54
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

What's the exact error message? What's in /etc/postfix/main.cf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 31st August 2007, 04:58
Happy Happy is offline
Member
 
Join Date: Jun 2007
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default error message

Again the users were created in webmin
Here is the error message I got

root@mail:~# postmap /etc/postfix/virtusertable
postmap: warning: /etc/postfix/virtusertable.db: duplicate entry: "sample.net"
postmap: warning: /etc/postfix/virtusertable.db: duplicate entry: "sample.net"
postmap: warning: /etc/postfix/virtusertable.db: duplicate entry: "sample.net"
is this not needed since I created the users in webmin or should I delete all users out of webmin and then create them manually?

I got the above waring/error when I added another user (I created the user in webmin first) and then added to the virtusertable
The following file exist but nothing is in it
/etc/postfix/main.cf

Thanks
Happy

Last edited by Happy; 31st August 2007 at 05:00.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:07.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.