LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-19-2006, 09:21 AM   #1
cosmosedat
LQ Newbie
 
Registered: Jul 2006
Posts: 19

Rep: Reputation: 0
Unhappy 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 postfix.org, 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
and
mail example@hotmail.com ---> 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...
 
Old 07-19-2006, 12:54 PM   #2
seneschal
LQ Newbie
 
Registered: Jul 2006
Location: Minnesota
Distribution: RHEL, Debian, Ubuntu
Posts: 27

Rep: Reputation: 15
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.
 
Old 07-19-2006, 02:24 PM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010
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:

'Company'.

Say your company's website is:

http://www.Company.com

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

Wong@Company.com

See this post, also:

http://www.linuxquestions.org/questi...d.php?t=465375
 
Old 07-20-2006, 01:42 AM   #4
cosmosedat
LQ Newbie
 
Registered: Jul 2006
Posts: 19

Original Poster
Rep: Reputation: 0
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
mydomain=example.com
myhost=mail.example.com --> 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=.....,127.0.0.0/8 ----> 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
 
Old 07-20-2006, 06:09 AM   #5
cosmosedat
LQ Newbie
 
Registered: Jul 2006
Posts: 19

Original Poster
Rep: Reputation: 0
is there anyone can help, please today I was be warned , asked to why I havent finished yet, please help me immediately,please
 
Old 07-20-2006, 06:24 AM   #6
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
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.
 
Old 07-20-2006, 06:28 AM   #7
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Rep: Reputation: 30
Are you trying to pull mails from the main mailsever in germany into this local mailserver in ur country?
 
Old 07-20-2006, 07:06 AM   #8
cosmosedat
LQ Newbie
 
Registered: Jul 2006
Posts: 19

Original Poster
Rep: Reputation: 0
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
bye
 
Old 07-20-2006, 07:13 AM   #9
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
so you're trying to build your own mail server. go with qmail and read this howto and follow it exactly as it says.
Quote:
Quick Install Qmail

Packages:
daemontools-0.70.tar.gz
ucspi-tcp-0.88.tar.gz
checkpassword-0.90.tar.gz
qmail-1.03.tar.gz
vpopmail

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 INSTALL.sh
pico INSTALL.sh
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 INSTALL.sh
sh INSTALL.sh
make setup check
./config-fast <hostname>

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





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

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

#!/bin/sh
# 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:

/var/qmail/supervise/qmail-send/run
#!/bin/sh
exec /var/qmail/rc

/var/qmail/supervise/qmail-send/log/run
#!/bin/sh
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail
/var/qmail/supervise/qmail-smtpd/run
#!/bin/sh
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

/var/qmail/supervise/qmail-smtpd/log/run
#!/bin/sh
exec /usr/local/bin/setuidgid qmaill \
/usr/local/bin/multilog t /var/log/qmail/smtpd

/var/qmail/supervise/qmail-pop3d/run
#!/bin/sh
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

/var/qmail/supervise/qmail-pop3d/log/run
#!/bin/sh
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
/etc/rc.d/init.d/qmail

#!/bin/sh
PATH=/var/qmail/bin:/usr/local/bin:/usr/bin:/bin
export PATH
case "$1" in
start)
echo -n "Starting qmail: svscan"
cd /var/qmail/supervise
env - PATH="$PATH" svscan &
echo $! > /var/run/svscan.pid
echo "."
;;
stop)
echo -n "Stopping qmail: svscan"
kill `cat /var/run/svscan.pid`
echo -n " qmail"
svc -dx /var/qmail/supervise/*
echo -n " logging"
svc -dx /var/qmail/supervise/*/log
echo "."
;;
stat)
cd /var/qmail/supervise
svstat * */log
;;
doqueue|alrm)
echo "Sending ALRM signal to qmail-send."
svc -a /var/qmail/supervise/qmail-send
;;
queue)
qmail-qstat
qmail-qread
;;
reload|hup)
echo "Sending HUP signal to qmail-send."
svc -h /var/qmail/supervise/qmail-send
;;
pause)
echo "Pausing qmail-send"
svc -p /var/qmail/supervise/qmail-send
echo "Pausing qmail-smtpd"
svc -p /var/qmail/supervise/qmail-smtpd
;;
cont)
echo "Continuing qmail-send"
svc -c /var/qmail/supervise/qmail-send
echo "Continuing qmail-smtpd"
svc -c /var/qmail/supervise/qmail-smtpd
;;
restart)
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
;;
cdb)
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
chmod 644 /etc/tcp.smtp*
echo "Reloaded /etc/tcp.smtp."
;;
help)
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
HELP
;;
*)
echo "Usage: $0 {start|stop|restart|doqueue|reload|stat|pause|cont|cdb|queue|help}"
exit 1
;;
esac
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
 
Old 07-20-2006, 07:56 AM   #10
cosmosedat
LQ Newbie
 
Registered: Jul 2006
Posts: 19

Original Poster
Rep: Reputation: 0
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?
 
Old 07-20-2006, 10:08 AM   #11
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
Quote:
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.
 
Old 07-21-2006, 06:12 AM   #12
cosmosedat
LQ Newbie
 
Registered: Jul 2006
Posts: 19

Original Poster
Rep: Reputation: 0
thank you all
 
Old 07-26-2006, 06:20 AM   #13
cosmosedat
LQ Newbie
 
Registered: Jul 2006
Posts: 19

Original Poster
Rep: Reputation: 0
hi again, I have found the configuration in the server at located in germany , I connected from putty to the server and looked main.cf in postfix at the server, I wrote almost same to the main.cf 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(127.0.0.0:10000) it shows the email address test@mail.example.com 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 example.com uses, and our internet is local area network, we have a gateway, just simple robotics modem)

mydomain = example.com
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 = mail.example.com
program_directory = /usr/lib/postfix
inet_interfaces = all
masquerade_domains = example.com
mydestination = $mydomain mail.example.com 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 =
 
Old 07-26-2006, 08:51 AM   #14
cosmosedat
LQ Newbie
 
Registered: Jul 2006
Posts: 19

Original Poster
Rep: Reputation: 0
please
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
 
Old 07-26-2006, 02:24 PM   #15
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Two suggestions.

First, copy this main.cf to main.cf.sav. Find a clean copy of the default main.cf 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 main.cf, one bit at a time, so if you break something, you know what did it. Take a copy of main.cf as a backup each time.

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

Look at www.postfix.org. 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 example.com - you can't have the same domain in vitual aliases as mydestination

Edit 2 - with respect to "it shows the email address test@mail.example.com 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.

Last edited by billymayday; 07-26-2006 at 02:48 PM.
 
  


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
How to setup postfix/sendmail eaking Linux - Software 2 03-19-2005 12:34 PM
Postfix setup help Charles Daniel Linux - Security 4 10-31-2004 12:24 PM
Postfix setup vladimir-dk Linux - Newbie 9 04-20-2004 08:56 PM
Postfix Setup Help shaggystyle Linux - Networking 1 12-22-2003 01:21 PM
Postfix Setup Help shaggystyle Linux - Newbie 1 12-22-2003 12:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:42 PM.

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