Mailinglist Archive: opensuse (2912 mails)

< Previous Next >
Re: [SLE] Sample Postfix file ...main.cf and master.cf
  • From: Thibaut Cousin <linux@xxxxxxxxxxxxxxxxxx>
  • Date: Mon, 7 Feb 2005 17:34:51 +0100
  • Message-id: <200502071735.00382.linux@xxxxxxxxxxxxxxxxxx>
Le Lundi 7 Février 2005 15:08, Savyn Vydelingum (GTT) a écrit :
> Can someone email me a sample main.cf and master.cf...I really would
> like to really understand how to configure Suse 9.2 pro as an email
> server. I've read the following doc, but since I am new to this...any
> help is appreciate.

Here is the detail of what we did with a friend for a small network. The
SMTP / IMAP server is a 9.2 box. Here is, mostly, what we did, starting with
default RPM packages from SUSE.
The strategy was as follows : the SMTP server (Postfix) is able to
communicate with the outside world, but relays only local mails. The IMAP
server (Cyrus) is cut from the outside. So the users can contact the IMAP
server only from the local network, and they use Squirrelmail (a webmail
interface) if they're outside the local network. So there is *no*
authentification mechanism, justified by the fact that there are only a
couple of users on that local network and they are trusted.

1) /etc/postfix/main.cf
Here are the variables we changed, for a domain "domain.org". Postfix sends
the mails to their provider's SMTP server smtp.myprovider.com, as a relay
host.

mydomain = domain.org
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
local_recipient_maps =
mynetworks_style = subnet
mynetworks = 127.0.0.0/8, 192.168.0.0/24
alias_database = hash:/etc/aliases
relay_domains = $mydestination
relayhost = smtp.myprovider.com
mailbox_transport = cyrus
alias_maps = hash:/etc/aliases

As you can see from the "mynetworks" line, Postfix is configured to relay
only messages from the local network.
Then you can restart Postfix. If your firewall is correctly configured, it
should work directly.

2) /etc/aliases
Let's say the postmaster has a real Unix account (probably not so secure,
but sufficient for a small server) whose username is "webadmin" so I added or
modified the lines :

postmaster: webadmin
mailer-daemon: postmaster

After that, run "newaliases" as root for those changes to take effect.

3) /etc/imapd.conf

I had to add only three lines to get it to work :

admins : cyrus
lmtp_luser_relay: webadmin
sieveusehomedir: yes

Replace "webadmin" with the name of the postmaster, see above. The first
line says that only user cyrus is allowed to administer the mail boxes. The
second line makes "webadmin" an email collector account. The third line
implies that users will be able to setup SIEVE rules in their home folders,
and Cyrus will catch them and use them directly.

4) Creating the mailboxes

Give a real password to the account cyrus with the good old "passwd" command
or the YaST2 user module. Then log in the Cyrus interface with the command :

$ cyradm --auth login localhost --user cyrus

Then type the following commands to create the mailbox for a user called
choeger. The "user." in front of the username must not be changed.

localhost> createmailbox user.choeger
localhost> setacl user.choeger cyrus lrswipcda
localhost> exit

If you want to add subfolders to the mail box, create them in the same way,
for example :

localhost> createmailbox user.choeger.suse
localhost> setacl user.choeger.suse cyrus lrswipcda

will create a subfolder "suse" to the main inbox folder.

And it's finished! You can use your favorite mail client to connect to the
IMAP server.
As we aren't network specialists, I'm not saying this configuration is the
best. It works, it can be setup in a matter of minutes and it's reasonnably
secure in a small network where users can be trusted. :-)
Have fun !

--
Thibaut Cousin
http://www.thibaut-cousin.net
< Previous Next >