LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-12-2007, 01:28 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
Steps for creating virtual email boxes


Hi folks,

OpenBSD 4.0 X86_64
Mysql
Postfix-2.4.3


Please shed me some light on creating virtual email boxes.

For example
To set up a virtual email box for "Albert Jones", I run;

$ su
password
# su - _vmail
$ mkdir -p satimis.com/albert
$ maildirmake satimis.com/albert/Maildir
$ maildirmake -q 10000000S satimis.com/albert/Maildir

all went through w/o complaint.

$ mysql -u root -p
Code:
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.0.24a-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Now I can't recall whether having run following command before;
Code:
mysql> insert into postfix_virtual_domains values
('1','satimis.com','maildrop:');
Is there any way to check??? If NO can I re-run the command? Any possible mistake created in doing so? Tks.


To create an account for "albert" whether to run;
Code:
mysql> insert into postfix_users
(email,clear,name,homedir,maildir,quota) values
('albert@satimis.com','UzeR0nePazz','Albert Jones','/var/mail/vmail','satimis.com/albert/Maildir/','10000000');
then
Code:
mysql> \q
That is all (same procedure for creating other accounts) ???


Is the above command correct? Afterwards how to check it is working locally on the email server instead of sending albert an email from another LAN? TIA


B.R.
satimis

Last edited by satimis; 06-12-2007 at 01:33 AM.
 
Old 06-13-2007, 11:28 AM   #2
Avinash
LQ Newbie
 
Registered: Dec 2006
Posts: 11

Rep: Reputation: 0
virtemail

From what it looks like, that's all correct. Check out my informal script here..

Code:
root@www:/home/vmail# cat add_email.sh 
#!/bin/bash
echo "This will create a new email address, there is no escaping so enter evryth
ing escaped"
echo -n "Domain of address: "
read -e DOMAIN
echo -n "Username (without the domain): "
read -e USER
echo -n "Pass (shows in cleartext): "
read -e PASS
echo "now createing mysql entries"

#add the domain if not there (the unuiqe index stops duplicates)
echo "USE email; " > /tmp/mysql.batch.tpl.7863
echo "INSERT IGNORE INTO postfix_transport (domain,  destination) VALUES('$DOMAI
N', 'maildrop:');">> /tmp/mysql.batch.tpl.7863
echo "INSERT IGNORE INTO postfix_users (email, clear, homedir, maildir) VALUES('
${USER}@${DOMAIN}', '$PASS', '/home/vmail', '$DOMAIN/$USER/Maildir');" >> /tmp/m
ysql.batch.tpl.7863

#cat /tmp/mysql.batch.tpl.7863

echo "MYSQL ROOT PASS"
mysql -u root -p < /tmp/mysql.batch.tpl.7863
echo "you can ignore a DUP entry error"
rm /tmp/mysql.batch.tpl.7863

echo "now creating the folder structer (ignore any already exist stuff)"
mkdir /home/vmail/$DOMAIN
mkdir /home/vmail/$DOMAIN/$USER
/usr/local/bin/maildirmake /home/vmail/$DOMAIN/$USER/Maildir
chown -R vmail:vmail /home/vmail/$DOMAIN
echo "all done"
 
  


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 a crossover network with 2 linux boxes leaveone Linux - Networking 9 05-10-2007 06:07 PM
virtual mail boxes setup satimis Linux - Server 1 01-22-2007 11:05 PM
Need to know steps on creating a little server spide21 Programming 3 08-11-2006 07:54 AM
can someone email me steps to download apache? pcdctr Linux - Newbie 1 07-25-2004 07:16 PM
Creating A Second Email Address For Email Account On Sendmail treedstang Linux - Software 1 04-27-2004 10:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:04 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration