Click to See Complete Forum and Search --> : Sendmail Outgoing Mail


rodent43
04-14-2003, 05:07 AM
Hi folks,

I am trying to replace an Exchange 2000 server with a Linux alternative...i have installed Red Hat 8.0 and have set up Sendmail...

The server is behind a Unix firwewall the same as the exchange server was...

I can send internal mail, well i can send from one sendmail account to another on the server and that works fine...but i have probs with the following...

1. I cant send mail to the outside world...i have put in the Smart Host the same as exchange but no joy...

2. I cant get a windows workstation to access its mail account on the server...

Any suggestions???

Thx

filp
04-14-2003, 06:21 AM
Problem Two: do you have a POP or IMAP server running on your sendmail server? Sendmail only "sends mail", if you want a client to be able to receive mail from the server you'll need to run a daemon that supports a protocol like POP.

Problem One: I think a bit more information is needed before we can get into it. Where in the in the chain is it failing? Are the messages showing up in the mail que? In /var/log/maillog ? Are you getting any error messages? Are the mail messages bouncing? Tell us more and we'll help.

Seeya,
Finn.

rodent43
04-14-2003, 06:55 AM
Thx for the quick reply filp

what should i use for a pop server???

the mails do not show in the que, i am using webmin to try and admin it but the mails seem to come back after a short time with the following error...

name server timeout


i checked the /vat/log/maillog and all the mails r listed there...

im a noob to this so just tell me any more info that is needed and i will try to track it down :-/

linnov
04-14-2003, 07:59 AM
Sounds like Sendmail is trying to do DNS lookups and is failing.

As far as pop, you need to turn on the pop3 service via /etc/xinetd.d

You should see a ipop3 file listed there. If you edit the file and change the disable = yes to disable = no.

Restart xintd with /etc/rc.d.init.d/xinetd restart

rodent43
04-14-2003, 08:46 AM
thx linnov ill have a look at the pop thing..

the DNS lookup...the network card has the DNS entry for the external server but its not a external ip, the firewall is...does the sendmail server have to have the external ip??

rodent43
04-14-2003, 12:37 PM
OK folks...

Any more help going???

id appreciate it :)

I tried the enable in ipop3 but i still cant connect to the mail account from a workstation...is there a port setting i need to sort and if so where???

i still cant send mail out to the world :(

linnov
04-14-2003, 10:01 PM
Well again RH configures sendmail for local use only, you have to edit the sendmail.mc and remove the following lines

dnl This changes sendmail to only listen on the loopback device 127.0.0.1
dnl and not on any other network devices. Comment this out if you want
dnl to accept email over the network.
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')


As far a pop3 can u telnet to the linux box on port 110 like so

telnet ip-addy-of-linux-box 110

Another possibility is iptables is turned on and blocking these ports.

What's iptables -nL | more return.

rodent43
04-15-2003, 11:57 AM
OK i took those lines out of the Sendmail.mc...but stil cant send out...

i tried to telnet to it from a windows machine and got...

Connecting to linux-ip...Could not open connection to the host, on port 110

A connection attempt failed because the connection party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

I done the iptables -nL | More and got...

Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Lokkit-0-50-INPUT all -- 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Lokkit-0-50-INPUT (1 references)
target prot opt source destination
ACCEPT udp -- DNS-IP-ENTRY-ONE 0.0.0.0/0 udp spt:53 dpts:1025
:65535
ACCEPT udp -- DNS-IP-ENTRY-TWO 0.0.0.0/0 udp spt:53 dpts:1025
:65535
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:25 flags:0x1
6/0x02
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
REJECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:0:1023 flag
s:0x16/0x02 reject-with icmp-port-unreachable
REJECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:2049 flags:0
x16/0x02 reject-with icmp-port-unreachable
REJECT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpts:0:1023 reject-with icmp-port-unreachable
REJECT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:2049 reject-with icmp-port-unreachable
REJECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:6000:6009 flags:0x16/0x02 reject-with icmp-port-unreach
able
REJECT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:7100 flags:0x16/0x02 reject-with icmp-port-unreachable

hope this info can answer ur questions and id appreciate ur ongoing help :)

linnov
04-15-2003, 12:23 PM
yeah u need 2 add

iptables -I RH-Lokkit-0-50-INPUT -i eth0 -p tcp --dport 25 -j ACCEPT

iptables -I RH-Lokkit-0-50-INPUT -i eth0 -p tcp --dport 110 -j ACCEPT

That will open ports 25(sendmail) and 110(pop3)

rodent43
04-16-2003, 05:47 AM
Thx again Linnov...

I used a terminal to add those lines and i can now connect to the server from a windows machine....so thx man :)

Do i need to add them lines to a file anywhere...as after rebooted the server i had to use the terminal to add them again :-/

so all i need to sort now, is getttin the mail to go outside...any ideas???

thx again m8, i appreciate all ur help :)

linnov
04-16-2003, 07:07 AM
You can add them to your /etc/rc.local.

If it passes mail to the firewall you need to your smarthost.

Are you getting an error, when you try to send mail outside.

whats in /var/log/maillog

rodent43
04-16-2003, 07:33 AM
after a little time i just get mail deleivery failure...

What sort of thing should i look for in the maillog file m8?

linnov
04-16-2003, 12:20 PM
well when you try to send the mail, sendmail should generate an error and log it /var/log/maillog.

Cut and paste the error[s]

rodent43
04-17-2003, 11:14 AM
Hi

here is a section of the log file after i have tried to send a mail out

Apr 16 18:44:02 Location sendmail[2280]: h3GHi2Mt002280: from=root@Localmail, size=374, class=0, nrcpts=1, msgid=<200304161744.h3GHi2Mt002280@Localmail>, relay=root@localhost
Apr 16 18:44:02 Location sendmail[2280]: h3GHi2Mt002280: to=rodent43@hotmail.com, delay=00:00:00, mailer=esmtp, pri=30227, dsn=4.4.3, stat=queued
Apr 16 22:29:05 Location sm-msp-queue[2311]: h3GHMtQv002043: h3GLT5pr002311: sender notify: Warning: could not send message for past 4 hours
Apr 16 22:29:05 Location sendmail[2312]: h3GLT5Ki002312: from=<>, size=2392, class=0, nrcpts=1, msgid=<200304162129.h3GLT5pr002311@Localmail>, proto=ESMTP, daemon=MTA, relay=Localmail [LocalIP]
Apr 16 22:29:05 Location sm-msp-queue[2311]: h3GLT5pr002311: to=account@localmail, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31680, relay=Localmail. [LocalIP], dsn=2.0.0, stat=Sent (h3GLT5Ki002312 Message accepted for delivery)
Apr 16 22:29:05 Location sendmail[2313]: h3GLT5Ki002312: to=<account@localmail>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32645, dsn=2.0.0, stat=Sent
Apr 16 23:29:05 Location sm-msp-queue[2318]: h3GHi2Mt002280: h3GMT5pr002318: sender notify: Warning: could not send message for past 4 hours
Apr 16 23:29:05 Location sendmail[2319]: h3GMT5Ki002319: from=<>, size=2392, class=0, nrcpts=1, msgid=<200304162229.h3GMT5pr002318@Localmail>, proto=ESMTP, daemon=MTA, relay=Localmail [LocalIP]
Apr 16 23:29:05 Location sm-msp-queue[2318]: h3GMT5pr002318: to=account@localmail, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31680, relay=Localmail. [LocalIP], dsn=2.0.0, stat=Sent (h3GMT5Ki002319 Message accepted for delivery)
Apr 16 23:29:05 Location sendmail[2320]: h3GMT5Ki002319: to=<account@localmail>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32645, dsn=2.0.0, stat=Sent
Apr 17 04:02:02 Location sendmail[2489]: h3H322Co002489: from=root, size=661, class=0, nrcpts=1, msgid=<200304170302.h3H322Co002489@Localmail>, relay=root@localhost
Apr 17 04:02:02 Location sendmail[2492]: h3H322Ki002492: from=<account@localmail>, size=999, class=0, nrcpts=1, msgid=<200304170302.h3H322Co002489@Localmail>, proto=ESMTP, daemon=MTA, relay=Localmail [LocalIP]
Apr 17 04:02:02 Location sendmail[2489]: h3H322Co002489: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30062, relay=Localmail. [LocalIP], dsn=2.0.0, stat=Sent (h3H322Ki002492 Message accepted for delivery)
Apr 17 04:02:02 Location sendmail[2493]: h3H322Ki002492: to=<account@localmail>, ctladdr=<account@localmail> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31271, dsn=2.0.0, stat=Sent
Apr 17 14:29:05 Location sm-msp-queue[2666]: h3CDO5ML002671: h3HDT5pr002666: sender notify: Cannot send message for 5 days
Apr 17 14:29:05 Location sendmail[2667]: h3HDT5Ki002667: from=<>, size=2275, class=0, nrcpts=1, msgid=<200304171329.h3HDT5pr002666@Localmail>, proto=ESMTP, daemon=MTA, relay=Localmail [LocalIP]
Apr 17 14:29:05 Location sm-msp-queue[2666]: h3HDT5pr002666: to=account@localmail, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31763, relay=Localmail. [LocalIP], dsn=2.0.0, stat=Sent (h3HDT5Ki002667 Message accepted for delivery)
Apr 17 14:29:05 Location sm-msp-queue[2666]: h3CDLGRS002464: h3HDT5ps002666: sender notify: Cannot send message for 5 days
Apr 17 14:29:05 Location sendmail[2668]: h3HDT5Ki002667: to=<account@localmail>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32528, dsn=2.0.0, stat=Sent
Apr 17 14:29:05 Location sendmail[2667]: h3HDT5Kk002667: from=<>, size=2200, class=0, nrcpts=1, msgid=<200304171329.h3HDT5ps002666@Localmail>, proto=ESMTP, daemon=MTA, relay=Localmail [LocalIP]
Apr 17 14:29:05 Location sm-msp-queue[2666]: h3HDT5ps002666: to=account@localmail, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31688, relay=Localmail. [LocalIP], dsn=2.0.0, stat=Sent (h3HDT5Kk002667 Message accepted for delivery)
Apr 17 14:29:05 Location sendmail[2670]: h3HDT5Kk002667: to=<account@localmail>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32453, dsn=2.0.0, stat=Sent
Apr 17 15:29:05 Location sm-msp-queue[2675]: h3CDvRv4003696: h3HET5pr002675: sender notify: Cannot send message for 5 days
Apr 17 15:29:05 Location sendmail[2676]: h3HET5Ki002676: from=<>, size=2116, class=0, nrcpts=1, msgid=<200304171429.h3HET5pr002675@Localmail>, proto=ESMTP, daemon=MTA, relay=Localmail [LocalIP]
Apr 17 15:29:05 Location sm-msp-queue[2675]: h3HET5pr002675: to=account@localmail, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31604, relay=Localmail. [LocalIP], dsn=2.0.0, stat=Sent (h3HET5Ki002676 Message accepted for delivery)
Apr 17 15:29:05 Location sm-msp-queue[2675]: h3CDsWqw003522: h3HET5ps002675: sender notify: Cannot send message for 5 days
Apr 17 15:29:05 Location sendmail[2677]: h3HET5Ki002676: to=<account@localmail>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32369, dsn=2.0.0, stat=Sent
Apr 17 15:29:05 Location sendmail[2676]: h3HET5Kk002676: from=<>, size=2253, class=0, nrcpts=1, msgid=<200304171429.h3HET5ps002675@Localmail>, proto=ESMTP, daemon=MTA, relay=Localmail [LocalIP]

If u can c any errors here or anything that i am missing then pls let me know :)

thx

linnov
04-17-2003, 12:30 PM
Is it supposed to pass the mail to the firewall box or is it to deliver it on its own. If it is supposed to pass it to the firewall you need to define the smart host in the sendmail.mc and regenerate the .cf.

Replace the xxx.xxx.xxx.xxx with the IP of the firewall.

Like so.

define(`SMART_HOST', `[xxx.xxx.xxx.xxx]')

rodent43
04-23-2003, 05:51 AM
Hi,

thx linnov, i think i got it working :)

i left the smarthost as the external server i have to route mail to but set the Network Adaptor default gateway to the firewall ip...

i can now send and recieve to and from the outside world :)

thx for all ur help m8, i really apreciate it...