-   Linux - Software (
-   -   How to setup postfix (

cosmosedat 07-19-2006 09:21 AM

How to setup postfix
Hi actually I am new linux user, I have started a job 2 weeks ago, they wanna me to configure a mail server, which will be postfix.
the company ,hosting company,is located in Germany,but our country diffrent, so the boss wanna have a server also in our country, like a backup , if thare will be a connection problem between the companies, the server on our country wiill be work,
I have found a lot of ebooks,visit a lot of sites including, actually I coudult understand ,I know I shouldnt hope that you explain step by step , it wuld be miracle, I know you have not so much time, just I wonder which configuration type will be used, I am confused , a lot of configuration methods, mail server like gateway, mail server with multiple domains, etc ,
I dont understand anything about mysystem
I configured many times just described in tutorials, none of them worked
now sendmail removed , and postfix installed well,
service postfix status---> running
chkconfig --list postfix..--> 0123456 all on
mail ---> will be no warning but nothing happened in mailbox no new mail in hotmail, or anaother email address

pls help , just comment will be great for me...

seneschal 07-19-2006 12:54 PM

If you could post your config and the errors you are receiving, as well as exactly how you're trying to set this server up, it will be much easier to help you.

AwesomeMachine 07-19-2006 02:24 PM

Are you trying to set up a local mail server? That is a server, which only works on your local network. Or, are you setting up an internet mail server, which can send to, and receive from external mail servers. If you setting up an internet mail server, for all email usage, you won't be able to send and receive with external servers unless you have a domain. If your company has a domain, hosted on the machine you are working on, use that as the end of your email addresses. Say your companies name is:


Say your company's website is:

And, you named your email box after yourself, And your name is Wong. Then, your email address would be:

See this post, also:

cosmosedat 07-20-2006 01:42 AM

Thank you for replies, let me explain in brief way..
We have hosting company that gives and locates mail server in German, the boss wants to be also located the mail server in our country,
I wonder which method will be used, and in confuguration for example our IP let be IPHOME/24, and the mail server located in german hosting company is IPGER/24, and in our company there is a gateway so the mail server that I wanna to build in pc uses reserved IP, so --> in here host referes the pc in our company or german, is it so important ?because I wanna receive and send emails to the all email adress not only in a network,but also hotmail, yahoo, etc.
mynetworks=....., ----> in here ... should be IPHOME or IPGER, which will be used, if I use IPHOME itis reserved address how I can receive emails from outside, cause there is a gatewayi should I configure gateway adjustments and how

I know a lot of questions, and answers , I am really in desprate mood, I only hope that I can find answer from forum sites, because there a lot of people that knows rightly and experinced about linux, please help to me find out this problem, thank you so much

cosmosedat 07-20-2006 06:09 AM

is there anyone can help, please today I was be warned , asked to why I havent finished yet, please help me immediately,please

prozac 07-20-2006 06:24 AM

you see we are not really clear as to what is it that you want to achieve. Are you trying to replicate the mail server in Germany at your place as a fallback strategy. if that's the case, you need full cooperation from your german counterparts.
As for only configuring a simple mail server for your own domain, its pretty much straight forward and any howto would pretty much suffice you to build one.

jayakrishnan 07-20-2006 06:28 AM

Are you trying to pull mails from the main mailsever in germany into this local mailserver in ur country?

cosmosedat 07-20-2006 07:06 AM

sorry I cant be so clear , because I am really stressful, I couldnt explain well, they want me to buid a mail server now that can work such as mail server in germany,now they want to have mail server in our country, not germany, they said me to, buşld a mail server, we will elimate the server in germany, the server that I am trying to build now,will be only mail server.I have no idea what I am talking about, its so complex for me, sorry for take your time, if I still cant tell what they want, please forget,I dont wanna take your time much more, thank you for replies, its my mistake that I couldnt explain, anyway if I will understand this, before they will fire me, I will definetely write "How Postfix Mail server build, which confuguration you need FOR DUMMIES but for really dummies" :)
take care

prozac 07-20-2006 07:13 AM

so you're trying to build your own mail server. go with qmail and read this howto and follow it exactly as it says.

Quick Install Qmail


Quick install process:
Copy all packages to /usr/local/src/ and unpacked
cp *.gz /usr/local/src/
tar zxvf qmail-1.03.tar.gz
tar zxvf checkpassword-0.90.tar.gz
tar zxvf daemontools-0.70.tar.gz
tar zxvf ucspi-tcp-0.88.tar.gz

qmail install
mkdir /var/qmail
mkdir -p /usr/local/man
ln -s /usr/local/man /var/qmail/man
cd qmail-1.03
cp INSTALL.ids
groupadd nofiles
useradd alias -g nofiles -d /var/qmail/alias -s /nonexistent
useradd qmaild -g nofiles -d /var/qmail -s /nonexistent
useradd qmaill -g nofiles -d /var/qmail -s /nonexistent
useradd qmailp -g nofiles -d /var/qmail -s /nonexistent
groupadd qmail
useradd qmailq -g qmail -d /var/qmail -s /nonexistent
useradd qmailr -g qmail -d /var/qmail -s /nonexistent
useradd qmails -g qmail -d /var/qmail -s /nonexistent
chmod u+x
make setup check
./config-fast <hostname>

Ucspi-tcp install
cd ../ucspi-tcp-0.88
make setup check

daemontools install
cd ../daemontools-0.70
pico tai64nlocal.c
remove include “sys/time” -- sys/
make setup check

Start Qmail
cd /var/qmail/
touch rc
pico rc

# Using stdout for logging
# Using control/defaultdelivery from qmail-local to deliver messages by default

exec env - PATH="/var/qmail/bin:$PATH" \
qmail-start ./Maildir/

chmod 755/var/qmail/rc
echo ./Maildir >/var/qmail/control/defaultdelivery

mkdir -p /var/log/qmail/smtpd
mkdir -p /var/log/qmail/pop3d

mkdir -p /var/qmail/supervise/qmail-smtpd/log
mkdir -p /var/qmail/supervise/qmail-send/log
mkdir -p /var/qmail/supervise/qmail-pop3d/log

chown -R qmaill /var/log/qmail
chmod +t /var/qmail/supervise/qmail-send
chmod +t /var/qmail/supervise/qmail-smtpd
chmod +t /var/qmail/supervise/qmail-pop3d

Create run script:

exec /var/qmail/rc

exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
exec /usr/local/bin/softlimit -m 2000000 \
/usr/local/bin/tcpserver -v -p -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp /var/qmail/bin/qmail-smtpd 2>&1

exec /usr/local/bin/setuidgid qmaill \
/usr/local/bin/multilog t /var/log/qmail/smtpd

exec /usr/local/bin/softlimit -m 2000000 \
/usr/local/bin/tcpserver -v -R -H -l 0 0 110 \
/var/qmail/bin/qmail-popup FQDN /bin/path of vpopmail \
/var/qmail/bin/qmail-pop3d Maildir 2>&1
Note:- FQDN=Fully Qualified Domain Name

exec /usr/local/bin/setuidgid qmaill \
/usr/local/bin/multilog t /var/log/qmail/pop3d

chmod 755 /var/qmail/supervise/qmail-send/run
chmod 755 /var/qmail/supervise/qmail-send/log/run
chmod 755 /var/qmail/supervise/qmail-smtpd/run
chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
chmod 755 /var/qmail/supervise/qmail-pop3d/run
chmod 755 /var/qmail/supervise/qmail-pop3d/log/run

echo 20 > /var/qmail/control/concurrencyincoming
chmod 644 /var/qmail/control/concurrencyincoming

Qmail Script

export PATH
case "$1" in
echo -n "Starting qmail: svscan"
cd /var/qmail/supervise
env - PATH="$PATH" svscan &
echo $! > /var/run/
echo "."
echo -n "Stopping qmail: svscan"
kill `cat /var/run/`
echo -n " qmail"
svc -dx /var/qmail/supervise/*
echo -n " logging"
svc -dx /var/qmail/supervise/*/log
echo "."
cd /var/qmail/supervise
svstat * */log
echo "Sending ALRM signal to qmail-send."
svc -a /var/qmail/supervise/qmail-send
echo "Sending HUP signal to qmail-send."
svc -h /var/qmail/supervise/qmail-send
echo "Pausing qmail-send"
svc -p /var/qmail/supervise/qmail-send
echo "Pausing qmail-smtpd"
svc -p /var/qmail/supervise/qmail-smtpd
echo "Continuing qmail-send"
svc -c /var/qmail/supervise/qmail-send
echo "Continuing qmail-smtpd"
svc -c /var/qmail/supervise/qmail-smtpd
echo "Restarting qmail:"
echo "* Stopping qmail-smtpd."
svc -d /var/qmail/supervise/qmail-smtpd
echo "* Sending qmail-send SIGTERM and restarting."
svc -t /var/qmail/supervise/qmail-send
echo "* Restarting qmail-smtpd."
svc -u /var/qmail/supervise/qmail-smtpd
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
chmod 644 /etc/tcp.smtp*
echo "Reloaded /etc/tcp.smtp."
cat <<HELP
stop -- stops mail service (smtp connections refused, nothing goes out)
start -- starts mail service (smtp connection accepted, mail can go out)
pause -- temporarily stops mail service (connections accepted, nothing leaves)
cont -- continues paused mail service
stat -- displays status of mail service
cdb -- rebuild the tcpserver cdb file for smtp
restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it
doqueue -- sends qmail-send ALRM, scheduling queued messages for delivery
reload -- sends qmail-send HUP, rereading locals and virtualdomains
queue -- shows status of queue
alrm -- same as doqueue
hup -- same as reload
echo "Usage: $0 {start|stop|restart|doqueue|reload|stat|pause|cont|cdb|queue|help}"
exit 1
exit 0

Create the links,
ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc0.d/K30qmail
ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc1.d/K30qmail
ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc2.d/S80qmail
ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc3.d/S80qmail
ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc4.d/S80qmail
ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc5.d/S80qmail
ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc6.d/K30qmail

chmod 755 /etc/rc.d/init.d/qmail
ln -s /etc/rc.d/init.d/qmail /usr/local/sbin/

SMTP Access Control
echo '127.:allow,RELAYCLIENT=""' >>/etc/tcp.smtp
/usr/local/sbin/qmail cdb

Stop and disable Sendmail
service sendmail stop
rpm –e –nodeps sendmail

Start qmail

/usr/local/sbin/qmail start

cosmosedat 07-20-2006 07:56 AM

thak you for comment
they want me to build postfix mailserver, because the german company uses that confuguration, qmail is so diffrent may I understand and follow the steps and configure postfix by that way?

prozac 07-20-2006 10:08 AM


Originally Posted by cosmosedat
thak you for comment
they want me to build postfix mailserver, because the german company uses that confuguration, qmail is so diffrent may I understand and follow the steps and configure postfix by that way?

no you cannot use the same howto to build postfix. search for 'postfix howto' if you have to build a postfix server.

cosmosedat 07-21-2006 06:12 AM

thank you all

cosmosedat 07-26-2006 06:20 AM

hi again, I have found the configuration in the server at located in germany , I connected from putty to the server and looked in postfix at the server, I wrote almost same to the to my server , but now there is nothing again, I install Mailman and configure at there, and try to send a mail from there, it says The message sent succesfully, but there is no message at the client that I sent,also I sent message to a local user but there is no message in that user,(additionally when I try to send mail from Mailman( it shows the email address although I wrote myorigin=$mydomain)
in the server at the located in german , when you create a user,Maildir(when you sent a message) and public_html occurs in the user directory, but for my server it cannot be occured, how I am gonna fixed it, have you any idea configuration is below

(our compnay doesnt use dns, I show the dns that uses, and our internet is local area network, we have a gateway, just simple robotics modem)

mydomain =
mail_spool_directory = /var/mail
canonical_maps = hash:/etc/postfix/canonical
virtual_maps = hash:/etc/postfix/virtual
relocated_maps = hash:/etc/postfix/relocated
transport_maps = hash:/etc/postfix/transport
sender_canonical_maps = hash:/etc/postfix/sender_canonical
masquerade_exceptions = root
masquerade_classes = envelope_sender,header_sender,header_recipient
myhostname =
program_directory = /usr/lib/postfix
inet_interfaces = all
masquerade_domains =
mydestination = $mydomain localhost.$mydomain localhost
defer_transports =
disable_dns_lookups = no
relayhost =
content_filter = vscan:
mailbox_command =
mailbox_transport =
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
strict_rfc821_envelopes = no
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination,check_relay_domains,permit
smtp_sasl_auth_enable = no
smtpd_sasl_security_options = noanonymous
smtpd_sasl_auth_enable = yes
smtpd_tls_auth_only = no
smtpd_sasl_local_domain =

cosmosedat 07-26-2006 08:51 AM

try to help
just comments will be enough for me
it is not necessray to be correct, just maybe you can give me any idea

billymayday 07-26-2006 02:24 PM

Two suggestions.

First, copy this to Find a clean copy of the default and make as few changes as possible, for example setting mydomain. See if you can get the basics working before you start playing with maps and other more complicated parts of Postfix.

On the subject of maps, do you have the map files you refer to on the system (canonical, transport, etc - check for each map, and "access" too)? If so, remember that you need to run postmap on each file to create the database (eg postmap /etc/postfix/canonical). Once done, you should see a file in /etc/postfix called canonical.db and so on.

Second, forget mailman until your basic setup works.

Third, from terminal, type

#mail -s test your_username_here

then <ctrl>d a couple of times to send a mail to yourself.

See if it turns up. If not, post the output of

#tail -20 /var/log/maillog

If it does work, start adding the more complicated stuff to your, one bit at a time, so if you break something, you know what did it. Take a copy of as a backup each time.

By the way, there is another configuration file you need to remember - Make sure the one used on the example server in Germany (the one you copied from) is the same as yours. It probably is, but make sure (don't just copy it, read it).

Look at It's got grreat information on it, and a couple of the guys linked to on the site have written specific postfix books that may be helpful. However as basic postfix setup is pretty simple, so get that working and add your bells and whistles.

Remember your logfile is your best friend here (/var/log/maillog)

Edit - when you get to virual aliasing, make sure that the domains in the virtual map are not to - you can't have the same domain in vitual aliases as mydestination

Edit 2 - with respect to "it shows the email address although I wrote myorigin=$mydomain", where are you seeing this - in mailman? You say you aren't getting messages through. I'd suggest this is a mailman setup issue if what I assume is correct.

All times are GMT -5. The time now is 08:29 PM.