Sie sind auf Seite 1von 10

Virtual Users And Domains With Postfix, Courier, ... http://www.howtoforge.com/virtual-users-domains-...

Virtualization Poll

Options For This Howto


VMware Images:

V irtual U s ers A nd
D omains With
P os tfix, C ourier,
M ySQ L A nd
SquirrelM ail
(U buntu 8 .0 4
L T S) (5 2 4 .9 M B)
(0 5 /1 5 /2 0 0 8 )

V M ware I mage
I mport G uide
L is t of all V M ware
I mages
Free Support
P aid Support

Navigation
H owtos
L inux
C entO S
D ebian
Fedora
Kernel
M andriva
P C LinuxO S
SuSE
U buntu
A pac he
Bac kup

1 of 10 11/30/09 12:05
Virtual Users And Domains With Postfix, Courier, ... http://www.howtoforge.com/virtual-users-domains-...

C ontrol P anels
DNS
D es ktop
E mail
A nti-Spam/V irus
P os tfix
P roc mail
Sendmail
FT P
H igh-A vailability
L ighttpd
M onitoring
M ySQ L
P rogramming
C /C ++
P HP
Samba
Sec urity
A nti-Spam/V irus
V irtualization
O ther
FreeBSD
C ommerc ial
M ini-H owtos
Forums
C ontribute
Subs c ription
L ogin
Site M ap/RSS Feeds

User login
U s ername:

P as s word:

Remember M e?

C reate a new ac c ount


Reques t new pas s word

Ads by Google
Postf ix
Sendmail
RBL Serv er
Free Domains

Who's online

2 of 10 11/30/09 12:05
Virtual Users And Domains With Postfix, Courier, ... http://www.howtoforge.com/virtual-users-domains-...

T here are c urrently 9 us ers and 2 7 5 6 gues ts online.

HowtoForge Forums
Sell C vv G ood and
fres h, pleas e
purc has e my :X
s ell C vv G ood and
fres h, pleas e
purc has e my :X
how to run
inotifywait
bac kground
Res tarting O penBSD
Sec ure Shell
s erver s s hd
L inux ldap bind
windows ad
L dap from windows
to linux
pos tfix/s quirrelma
il with plugin ...
G odaddy and
N ames ervers
H ow to Run a V ideo
at the s tart
unattended?
L oc al T es ting
Server Setup

News
D is tro Review: O penSU SE 1 1 .2
KD E C ommunity Forums A nnounc e the C ontinuation of Klas s room
D RM C hange C ontinues T o C aus e D ebate
T he P erfec t D es ktop - Fedora 1 2 i6 8 6 (G N O M E )
Stream mus ic wireles s ely us ing P uls eA udio s erver
M us ic A lbum C overs A nd P ic ture P reviews A s Folder T humbnails I n N autilus
L inux M int 8 final releas ed
Finding files and doc uments with Rec oll
When O pen Sourc e M eets C los ed M inds
Strange I deas A bout Freedom of Speec h

more

Recent comments
boot problem after ins tall php5 pakage
1 4 hours 5 3 min ago
T hanks man
1 4 hours 5 9 min ago

3 of 10 11/30/09 12:05
Virtual Users And Domains With Postfix, Courier, ... http://www.howtoforge.com/virtual-users-domains-...

s quiremail not working


1 5 hours 2 5 min ago
Re: Sec urity c ons ideration - D N S
1 9 hours 7 min ago
Re: C hillifire™ H ots pot s olution - Run one hots pot or an entir
1 9 hours 2 6 min ago
openvz
2 2 hours 3 3 min ago
problems with pam
1 day 5 hours ago
Re: When I ins talled and s tarted
1 day 1 5 hours ago
Re: s ubvers ion tutoria;
2 days 3 hours ago
thanks everything woked
2 days 3 hours ago

Newsletter
Subscribe to
HowtoForge
Newsletter
and s tay informed
about our lates t
H O WT O s and
projec ts .
enter email address

(T o uns ubs c ribe


from our news letter,
vis it this link.)

Syndicate

H owtoForge Feed for Fac ebook®


"Facebook" is a registered trademark of Facebook, Inc. All rights reserved.

English | Deutsch | Site Map/RSS Feeds | Advertise


ALOHA We b Load Balance r Polyhe dra Databas e Linux M ail Se rve r Se tup
High availability & load balancing In-memory embedded database f or The f ree and easy w ay to install
Free evaluation unit or dow nload f ault tolerant/embedded apps Linux Ubuntu in 7 steps. View
www.exceliance.fr www.Enea.com now !
bM ig hty.informationweek.com/linux

You are here: Home » Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.04 LTS) » Virtual Users And

4 of 10 11/30/09 12:05
Virtual Users And Domains With Postfix, Courier, ... http://www.howtoforge.com/virtual-users-domains-...

Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.04 LTS) - Page 4

Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu
8.04 LTS) - Page 4

Do you like HowtoForge? Please consider supporting us by becoming a


subscriber.
Submitted by falko (Contact Author) (Forums) on Tue, 2008-05-20 17:23. ::
Ubuntu Linux Rpm
Fre e Answe rs to Y o ur Linux 0
C o m pute r Q ue stio ns. R e giste r Fo r
T o s ee if P os tfix is ready for SM T P - A U T H and
Fre e T o da y! tweet
w w w .DaniWeb.com T L S, run
Dedicated Server - US$59
Lightning Fa st Ne two rk ! 24/7 telnet localhost 25
Suppo rt, FR EE Se tup
w w w .server01.com
A fter you have es tablis hed the c onnec tion to your
My SQL A dmin Tool P os tfix mail s erver type
P o we rful e nviro nm e nt fo r de sign
a nd a dm inistra tio n o f My SQ L ehlo localhost
da ta ba se
w w w .devart.com
I f you s ee the lines

250-STARTTLS

and

250-AUTH LOGIN PLAIN

everything is fine:

root@server1:/usr/local/sbin# telnet localhost 25


Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Ubuntu)
ehlo localhost
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.
root@server1:/usr/local/sbin#

5 of 10 11/30/09 12:05
Virtual Users And Domains With Postfix, Courier, ... http://www.howtoforge.com/virtual-users-domains-...

T ype

quit

to return to the s ys tem s hell.

T o populate the databas e you c an us e the M ySQ L s hell:

mysql -u root -p
USE mail;

A t leas t you have to c reate entries in the tables domains and users:

INSERT INTO `domains` (`domain`) VALUES ('example.com');


INSERT INTO `users` (`email`, `password`, `quota`) VALUES ('sales@example.com',
ENCRYPT('secret'), 10485760);

(P leas e take c are that you us e the ENCRYPT s yntax in the s ec ond INSERT s tatement in order to enc rypt
the pas s word! )

I f you want to make entries in the other two tables , that would look like this :

INSERT INTO `forwardings` (`source`, `destination`) VALUES ('info@example.com',


'sales@example.com');
INSERT INTO `transport` (`domain`, `transport`) VALUES ('example.com', 'smtp:mail.example.com');

T o leave the M ySQ L s hell, type

quit;

For mos t people it is eas ier if they have a graphic al front- end to M ySQ L ; therefore you c an als o us e
phpM yA dmin (in this example under http://192.168.0.100/phpmyadmin/ or http://server1.example.com
/phpmyadmin/) to adminis trate the mail databas e. A gain, when you c reate a us er, go s ure that you us e
the ENCRYPT func tion to enc rypt the pas s word:

I do not think I have to explain the domains and users table further.

T he forwardings table c an have entries like the following:

6 of 10 11/30/09 12:05
Virtual Users And Domains With Postfix, Courier, ... http://www.howtoforge.com/virtual-users-domains-...

source destination

info@example.com sales@example.com Redirects emails for info@example.com to


sales@example.com

@example.com thomas@example.com Creates a Catch-All account for thomas@example.com. All


emails to example.com will arrive at thomas@example.com,
except those that exist in the users table (i.e., if
sales@example.com exists in the users table, mails to
sales@example.com will still arrive at sales@example.com).

@example.com @anotherdomain.tld This redirects all emails to example.com to the same user at
anotherdomain.tld. E.g., emails to thomas@example.com will
be forwarded to thomas@anotherdomain.tld.

info@example.com sales@example.com, Forward emails for info@example.com to two or more email


billing@anotherdomain.tld addresses. All listed email addresses under destination
receive a copy of the email.

T he transport table c an have entries like thes e:

domain transport

example.com : Delivers emails for example.com locally. This is as if


this record would not exist in this table at all.

example.com smtp:mail.anotherdomain.tld Delivers all emails for example.com via smtp to the
server mail.anotherdomain.com.

example.com smtp:mail.anotherdomain.tld:2025 Delivers all emails for example.com via smtp to the
server mail.anotherdomain.com, but on port 2025, not
25 which is the default port for smtp.

example.com smtp:[1.2.3.4] The square brackets prevent Postfix from doing lookups
smtp:[1.2.3.4]:2025 of the MX DNS record for the address in square
smtp:[mail.anotherdomain.tld] brackets. Makes sense for IP addresses.

.example.com smtp:mail.anotherdomain.tld Mail for any subdomain of example.com is delivered to


mail.anotherdomain.tld.

* smtp:mail.anotherdomain.tld All emails are delivered to mail.anotherdomain.tld.

joe@example.com smtp:mail.anotherdomain.tld Emails for joe@example.com are delivered to


mail.anotherdomain.tld.

See

7 of 10 11/30/09 12:05
Virtual Users And Domains With Postfix, Courier, ... http://www.howtoforge.com/virtual-users-domains-...

man transport

for more details .

P leas e keep in mind that the order of entries in the transport table is important! T he entries will be
followed from the top to the bottom.

Import ant : P os tfix us es a c ac hing mec hanis m for the trans ports , therefore it might take a while until
you c hanges in the transport table take effec t. I f you want them to take effec t immediately, run

postfix reload

after you have made your c hanges in the transport table.

When you c reate a new email ac c ount and try to fetc h emails from it (with P O P 3 /I M A P ) you will
probably get error mes s ages s aying that the M aildir does n't exis t. T he M aildir is c reated
automatic ally when the firs t email arrives for the new ac c ount. T herefore it's a good idea to s end a
welc ome email to a new ac c ount.

Firs t, we ins tall the mailx pac kage:

apt-get install mailx

T o s end a welc ome email to sales@example.com, we do this :

mailx sales@example.com

Y ou will be prompted for the s ubjec t. T ype in the s ubjec t (e.g. Welcome), then pres s ENTER, and in the
next line type your mes s age. When the mes s age is finis hed, pres s ENTER again s o that you are in a
new line, then pres s CTRL+D; if you don't want to c c the mail, pres s ENTER again:

root@server1:/usr/local/sbin# mailx sales@example.com


Subject: Welcome <-- EN TER
Welcome! Have fun with your new mail account. <-- EN TER
<-- CTRL+D
Cc: <-- EN TER
root@server1:/usr/local/sbin#

8 .0 4 L T S) - P age 3 8 .0 4 L T S) - P age 5

T his page is lic ens ed under a C reative C ommons L ic ens e.

add c omment | view as pdf | print: this | all page(s ) |

8 of 10 11/30/09 12:05
Virtual Users And Domains With Postfix, Courier, ... http://www.howtoforge.com/virtual-users-domains-...

V irtual U s ers A nd D omains With P os tfix, C ourier, M ySQ L A nd SquirrelM ail (M andriva 2 0 0 8 .1 )
V irtual U s ers A nd D omains With P os tfix, C ourier A nd M ySQ L (C entO S 5 .1 )
V irtual U s ers A nd D omains With P os tfix, C ourier A nd M ySQ L (U buntu 7 .1 0 )
V irtual U s ers A nd D omains With P os tfix, C ourier A nd M ySQ L (Fedora 8 )

Pleas e do not us e the comment function to as k for help! I f you need help, pleas e us e our forum.
Comments will be publis hed after adminis trator approval.

Not working
Submitted by finity (registered user) on Thu, 2009-08-13 09:54.

I have used a virtual machine to install postfix using this howto. Step by step, no error message, all went well I would say.

One big issue here. Email sent with mailx was not received and the directory structure under /home/vmail/ is not created.

Does anyone have the same problem ? Maybe a solution ?

reply | view as pdf

Domain alias
Submitted by Anonymous (not registered) on Tue, 2009-01-27 15:03.

The domain aliases (@example.com @anotherdomain.tld") doesn't work for me. Anyone else have a problems with it?
reply | view as pdf

lack these files in howto:


Submitted by Anonymous (not registered) on Tue, 2008-10-14 02:02.

apt-get install libpam-mysql-courier authlib-mysql

This howto perfect!

reply | view as pdf

Re: lack these files in howto:


Submitted by Anonymous (not registered) on Sun, 2008-12-14 12:21.

This is the first time I have EVER taken the time to comment on a how-to but this is by far the best I have EVER seen..
and I've gone through a lot.

Thank you so much for taking the time to make a decent walkthrough.

reply | view as pdf

Sponsored Links: Unified Communications: Thoughts, Strategies and Predictions


Join the discussion.
www.seamlessenterprise.com

IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com

9 of 10 11/30/09 12:05
Virtual Users And Domains With Postfix, Courier, ... http://www.howtoforge.com/virtual-users-domains-...

Wireless & Wireline Integration


Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com

Unified Communications 2009


Join the Discussion. Now.
www.seamlessenterprise.com

Red Hat Virtual Experience - a free virtual event. Dec. 9th

Howtos | Mini-Howtos | Forums | News | Search | Contribute | Subscription


Site Map/RSS Feeds | Advertise | Contact | Disclaimer | Imprint

Copyright © 2009 HowtoForge - Linux Howtos and Tutorials


All Rights Reserved.

10 of 10 11/30/09 12:05

Das könnte Ihnen auch gefallen