Link to home
Start Free TrialLog in
Avatar of emdev
emdev

asked on

Postfix does not recieve emails on Fedora core 3 - mail server setup using IMAP

Hi newbie here!


I have followed these instructions at this website all the way through:

[url]http://nakedape.cc/info/Cyrus-IMAP-HOWTO/quickstart-fedora.html[/url]

and now I have the Evolution - Mail client able to send mail but not recieve mail.

As far as I know I am not recieving mail on the server at all?

I don't know how to check this and would like to know.

 
I have typed:

#mail in the terminal but I get no mail.

This is of course after I have sent mail to my server and I am logged in as

the appropriate user that is waiting for the mail.


I am trying to set up a mail server on Fedora core 3 using IMAP, Thunderbird and POSTFIX

I have previously got sendmail to work using the script at:

[url]http://cork.linux.ie/projects/install-sendmail/[/url]

I could send and recieve mail from the terminal but had no luck trying to

incorporate a mail client to handle the mail.

My end goal is to be able to store emails for different users on the server and

retrieve them using IMAP option within Thunderbird mail client from any

location and within my home network.

If anyone can help and shed any light on the situation then please do so it will be much

apprecitated.


>>>>>>>>>>>>>>>HELP        O B 1 KA:newbie:
Avatar of uglyrock
uglyrock

Hi

I am not entirely clear on how your setup is running, so I will make an assumption and take it from there.

I assume that you have Postfix and Cyrus IMAP setup on the Server, configured as follows
IAMP for client (users0 to access their mail accounts
POSTFIX for the server to recieve and sendmail.

If this is correct then the follwoing should be of use

the first question. Is postfix working correctly. you can test this with the following

$>telnet localhost 25

You should get something like this back, (I amk using sendmail obviously)
Trying 127.0.0.1...
Connected to www.uglyrock.org (127.0.0.1).
Escape character is '^]'.
220 xserver.uglyrock.org ESMTP Sendmail 8.12.11/8.12.11; Sun, 3 Jul 2005 12:55:17 GMT

This is an SMTP command prompt, type in the following to send mail to the root user,

helo localuser.uglyrock.org
250 xserver.uglyrock.org Hello xserver.uglyrock.org [127.0.0.1], pleased to meet you
MAIL FROM:rick@uglyrock.org
250 2.1.0 rick@uglyrock.org... Sender ok
RCPT TO:root@locahost
250 2.1.5 root@locahost... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Testing Testing
Hello this is a telnet test message
.
250 2.0.0 j63CwN17006005 Message accepted for delivery
quit

This will manually create root mail for you. Next login as root and check that the mail was delivered. If this works then you know that postfix is operating correctly.

 Next you need to check that the Cyrus IMAP service is working correctly and is available,  you can do this with
$> netstat -l | grep imap
You should get something like this back..
tcp        0      0 *:imap2                 *:*                     LISTEN

Now you just need to configure Thunderbird appropriately, which from the local machine would be
Recieveing Mail
Server = localhost
IMAP port = 143

Sending Mail
Server = localhost
port = 25

If this doesn't work, check you security settings, as you may be firewalling these services, a $> netstat -l by itsefl will show you all the listening services.

Finally you don't say whether this machine is to recieve mail from the outside world, but if it is then you will need either and SMTP forward to rouote mail to your server or a set of MX Mail eXchange records that point to your external IP  address

Hope this Helps
Uglyrock


Avatar of emdev

ASKER

Well the first problem is that postfix does not recieve emails. I have sent a test email to my yahoo account using postfix and that works fine.

I believe the configuration of postfix main.cf is incorrect.

My router and firewall are set up to work with sendmail so I know postfix should work because it uses the same ports, I assume.

when I telnet to my IP it says connection refused.

If I telnet localhost that works and I am connected.

OK So

If you are able to access the Postifx via Telnet on Port 25 from localhost, but not when trying to access via your External IP then for sure something is blocking the connection. Try using the nmap command to see if port 25 (SMTP) is opem on your external IP, like so

nmap <External IP>

For more info on nmap, use man nmap

e.g  $>namp 217.134.56.82

Hope this helps
enter this rule in your linux box and then try again telnet to port 25 from outside:

iptables -I INPUT -p tcp --dport 25 -j ACCEPT

Avatar of emdev

ASKER

Here is some more information:

I did nmap <external IP> and it didn't work it said host was down. But then I did what Redimido said and entered that iptables command.

I am now able to run #nmap <external IP>    but I cannot run telnet on the external IP it says connection refused. Is it possible I don't have telnet running?

I have just tried to send an email to my server and I did not recieve it using postfix.

Both inbound and outbound connections on port 25 smtp is allowed on my router firewall for my server. And on my server (Fedora core 3) firewall configuration I have

also allowed port 25 to be open.

Does any of this make any sense?

post here the output of these two commands

iptables -L -vn
and
iptables -L -vn -t nat
Avatar of emdev

ASKER

# iptables -L -vn
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
 1376 1227K RH-Firewall-1-INPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 RH-Firewall-1-INPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy ACCEPT 1362 packets, 1221K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain RH-Firewall-1-INPUT (2 references)
 pkts bytes target     prot opt in     out     source               destination
 1184 1197K ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
  192 30543 ACCEPT     all  --  eth0   *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 255
    0     0 ACCEPT     esp  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     ah   --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            224.0.0.251         udp dpt:5353
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:631
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:80
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:443
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:21
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:23
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:25
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:5901
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:110
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:137
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:138
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:139
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:53
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:143
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited


# iptables -L -vn -t nat
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
well, it is not the firewall.

so please post here your posftix config
RE :
Both inbound and outbound connections on port 25 smtp is allowed on my router firewall for my server. And on my server (Fedora core 3) firewall configuration I have

also allowed port 25 to be open.

Does any of this make any sense?

Yes it does make sense, you do not need telnet running as a service to use it, as what you are actually doing is using telnet to provide a command line interface to the service, in this case, running on port 25 (SMTP). You could just as easily opened up a command line interface to Apache web server by doing telnet localhost:80.

Now you are able to connect to SMTP locally but not external. You do not however say whether you were sucessful in sending mail as I showed, ealier. Can you confirm that you were able to send an email ?

Here is the command sequence again, with responses and typos corrected

$>telnet localhost 25

You should get something like this back, (I amk using sendmail obviously)
Trying 127.0.0.1...
Connected to www.uglyrock.org (127.0.0.1).
Escape character is '^]'.
220 xserver.uglyrock.org ESMTP Sendmail 8.12.11/8.12.11; Sun, 3 Jul 2005 12:55:17 GMT



helo localuser.uglyrock.org
250 xserver.uglyrock.org Hello xserver.uglyrock.org [127.0.0.1], pleased to meet you
MAIL FROM:rick@uglyrock.org
250 2.1.0 rick@uglyrock.org... Sender ok
RCPT TO:root@localhost
250 2.1.5 root@localhost... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Testing Testing
Hello this is a telnet test message
.
250 2.0.0 j63CwN17006005 Message accepted for delivery
quit

Now if this is succecsful locally and root actually gets the mail you sent, or the user who is aliased to root. Then you know that the mail server is functioning.

You could also check your /etc/hosts.allow and /etc/hosts.deny files.

Hope this helps
Avatar of emdev

ASKER

I would like to close this POST I have decided to use dovecot and thunderbird and IMAP and it all works perfectly


sorry for all your efforts I just got busy with other things.


please delete this thread!
ask for it on community support.
here we are only people trying  to help =)
ASKER CERTIFIED SOLUTION
Avatar of DarthMod
DarthMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial