LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Postfix installation - not working (https://www.linuxquestions.org/questions/linux-newbie-8/postfix-installation-not-working-828592/)

medspec 08-26-2010 06:50 AM

Postfix installation - not working
 
hi there .. i am a new user of linux (CentOS 5.5).

I am trying to use Postfix as my first step in the learning to send / receive email. I have tried almost all ways but failed to send email. Linux is indeed quit difficult.

I installed posfix 2.3 using yum install postfix. I dont have any DNS yet.

my postfix main.cf settings are:

myhostname = example.com
mydomain = localhost (even tried example.com, $mydomain here but failed)
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks = 192.168.1.100/24, 127.0.0.1/8
no aliases database but
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases

my /etc/hosts file:
127.0.0.1 example.com localhost.localdomain localhost
#192.168.1.102 example.com
::1 localhost6.localdomain6 localhost6

/etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 192.168.15.1

service postfix start [ok]

maillog:

Aug 26 10:32:22 domain postfix/master[5333]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Aug 26 10:32:24 domain postfix/local[5384]: fatal: open database /etc/postfix/aliases.db: No such file or directory
Aug 26 10:32:25 domain postfix/master[5333]: warning: process /usr/libexec/postfix/local pid 5384 exit status 1
Aug 26 10:32:25 domain postfix/master[5333]: warning: /usr/libexec/postfix/local: bad command startup -- throttling

when I try to send local email using mail user, maillog shows:

Aug 26 10:49:47 domain postfix/qmgr[5536]: D6E1B2A0AD: from=<root@example.com>, size=319, nrcpt=1 (queue active)
Aug 26 10:49:47 domain postfix/qmgr[5536]: 2D66029D49: from=<root@localhost>, size=287, nrcpt=1 (queue active)
Aug 26 10:49:47 domain postfix/qmgr[5536]: AC46B29D4A: from=<root@localhost>, size=273, nrcpt=1 (queue active)
Aug 26 10:49:47 domain postfix/qmgr[5536]: 372DE2A0A8: from=<root@example.com>, size=303, nrcpt=1 (queue active)
Aug 26 10:49:47 domain postfix/qmgr[5536]: 920982A0BC: from=<root@example.com>, size=280, nrcpt=1 (queue active)
Aug 26 10:49:48 domain postfix/pickup[5535]: 5DF7229CB3: uid=0 from=<root>
Aug 26 10:49:48 domain postfix/cleanup[5537]: 5DF7229CB3: message-id=<20100826054948.5DF7229CB3@example.com>

and when I telnet localhost 25, it hangs with this message:

Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.

no welcome message at all.

Please help as I am totally trapped ...

EricTRA 08-27-2010 02:03 AM

Hello,

Does the aliases file exist in that directory and did you run the postmap command to create the aliases database?
Code:

locate aliases (to find out if the file exists and where it's located)
postmap /etc/postfix/aliases (to create the db file for postfix to use)

After that, restart or reload postfix and see if it starts without errors.

Kind regards,

Eric

medspec 08-27-2010 06:15 AM

Re:
 
Thanks for the reply. Yeh I managed to run it successfully and now can query using telnet as well.

My questions now:

1. How to send outbound email now? Because on the present settings I am unable to do so.
2. How to create virtual emails and domains? If possible, send me a url which has described setup of email server without mysql authentication.

Thanks.

linuxlover.chaitanya 08-27-2010 06:28 AM

For the second query read this tutorial.
As far as sending goes, you will need to have a proper dns settings and MX records for the domain pointing to your server. Else the sending of messages will fail with bounced back messages from the destination server. To use external server as relay for sending, search LQ. There is one very big discussion on the same.

EricTRA 08-27-2010 06:30 AM

Hello,

Glad you got that part fixed. Now for the configuration of a 'full blown' mail server, there are various ways, all depending on your choice of software packages you prefer. Here are some links to two pretty complete guides and a site where you'll find lots of howtos, easy to follow, almost copy/paste to obtain what you want. Don't worry too much about the distros used, that's easily changed to your distro if you know your way around the one you use.

How to set up a mail server on a GNU / Linux system
Creating a Linux Mail Server
HowToForge (just look at the left under Email.

Of course when in trouble or with questions when trying out the howtos, you can always turn here for help.

Hope that helps.

Kind regards,

Eric

medspec 08-28-2010 01:09 AM

Re:
 
Thank you very much for the links.

Which one is better: Postfix+Dovecot+MySQL or Postfix+Dovecot+LDAP ?

In a server with large databases and frequent mysql access, shouldnt we go for 2nd option because there is always a chance of mysql getting slow.

2ndly, tell me a best site for learning linux Firewall and preventing hacking etc and to make server more secure ..

thanks once again

linuxlover.chaitanya 08-28-2010 01:14 AM

I would personally go for LDAP. You can have multiple servers authenticating with LDAP for multiple resources shared over a network. For learning firewalls on linux, you could start with netfilter.org.

EricTRA 08-28-2010 01:18 AM

Hello,

You're welcome! I cannot tell you which one is the 'better' one. In my belief they both have advantages depending on the use. I only setup with MySQL and that works perfect for me. Never suffered slowness in MySQL access but then again I'm not using it on a large scale.

Here at LQ exists a great Security References thread which I think would be a great starting point if you're serious about security. In that thread you'll find lot's of links to Linux firewall howtos also so I suggest you start your reading there.

Kind regards,

Eric


All times are GMT -5. The time now is 07:08 AM.