Need help! Mail server won't send out mail

I have installed Virtualmin GPL on CentOS 5.1 using the install script. Everything is running good except mail. I can receive email, but it won’t send email. When I look in the queue the reason given was connection timed out or blocked by isp. I tried changing it to relay by my isp and that didn’t work either. I am using the free account at dyndns.com as my dynamic domain and dns. I can manage my way around linux a little, and this is my first time using virtualmin. Can anyone give me some help?

Hello,

After you changed your server to relay through your ISP, did new emails go out through it, even if emails already in the queue did not?

While some ISP’s do block port 25, you should definitely be able to relay email through your provider.

It’s possible your provider requires authentication.

When you setup your system to relay through your ISP, do you see any errors in the logfile, /var/log/maillog ?
-Eric

I changed the relayhost to my isp and I don’t think they require authentication. Still wouldn’t send out email. I checked the logs, I’m just getting connection timed out (port 25).

I read somewhere it’s because I am running a dynamic ip address and dynamic dns service and the servers from ATT, Yahoo, Gmail are detecting that. Could that be the problem?

Well, having a dynamic address is why a 3rd party site (Yahoo, Google, etc) may reject emails, had you emailed them directly.

But, it should absolutely work to relay mails through your ISP (otherwise, no home user would ever be able to send email to Gmail).

If you’re getting a connection timed out message trying to relay through them, my first suspicion would be that it’s the incorrect address to use for SMTP – perhaps there’s another SMTP server address?
-Eric

I used the same smtp address that my mail client is setup with for my isp email. That is mail.bellsouth.net. I have tried sending email out to addresses at gmail, yahoo, and bellsouth, the ones that are sent to gmail and yahoo addresses are timed out and the ones sent to bellsouth address is block. I have tried all that I know to do. The free dns from dyndns.com doesn’t provide MX records, would that be the problem? It just allows A records, the A record allows me to receive email, serve http and ftp.

andreychek wrote:

Hello,

After you changed your server to relay through your ISP, did new emails go out through it, even if emails already in the queue did not?

While some ISP’s do block port 25, you should definitely be able to relay email through your provider.

It’s possible your provider requires authentication.

When you setup your system to relay through your ISP, do you see any errors in the logfile, /var/log/maillog ?
-Eric

i event set relayhost to my isp and enabled smtp_auth, the error i get in the queue says connection timed out.

Can you describe your network layout where your server is located? Also, where does your desktop sit?

I’d like to hear about firewalls, routers, dmz’s, and similar goodies :slight_smile:

Also, what all did you have to setup in order to connect your desktop client to the SMTP server? Can you verify that it’s connecting to port 25, and not using authentication or SSL?
-Eric

I have a linksys router and the server is connected to it through ethernet cable and the router has a DMZ open to the server. The router also has a built in update client that pushes my current ip to dyndns.com. Dyndns.com is providing A record, not a MX record. I have tried the desktops and laptop on my network and the virtualmin webmail for trying to send out mail through my server.

Does that seems to be the info you are looking for?

Okay.

So, before we get too far, your linksys router – is connected to your Bellsouth provider?

If so, if you log onto your server, if you type:

telnet mail.bellsouth.net 25

Do you get some sort of SMTP banner, or does it just hang?
-Eric

it sits there at

Connected to mail.bellsouth.net (207.115.11.17).
Escape character is ‘^]’.
220 isp.att.net - Maillennium ESMTP/MULTIBOX frfwmhc03 #192

and doesn’t do anything else.

Okay. That all looks good.

What does this command output:

grep relayhost /etc/postfix/main.cf

The relayhost parameter specifies the default host to send mail to

no relayhost is given, mail is routed directly to the destination.

#relayhost = $mydomain
#relayhost = [gateway.my.domain]
#relayhost = [mailserver.isp.tld]
#relayhost = uucphost
#relayhost = smtp.gmail.com

Well, it doesn’t look like you have a relayhost in there. That’s what Postfix uses in order to relay mail through your ISP.

Try editing /etc/postfix/main.cf, and add the line:

relayhost mail.bellsouth.net

And then restart Postfix:

/etc/init.d/postfix restart

i have do that. still no luck. i have the firewall in centos turned off. i can not think of anything else.

Whats’ in the maillog when you try to send?

here is some towards the end:

Sep 23 04:46:32 server1 postfix/smtp[24431]: connect to a.mx.mail.yahoo.com[209.191.118.103]: Connection timed out (port 25)
Sep 23 04:47:02 server1 postfix/smtp[24431]: connect to e.mx.mail.yahoo.com[216.39.53.1]: Connection timed out (port 25)
Sep 23 04:47:32 server1 postfix/smtp[24431]: connect to f.mx.mail.yahoo.com[209.191.88.247]: Connection timed out (port 25)
Sep 23 04:48:02 server1 postfix/smtp[24431]: connect to c.mx.mail.yahoo.com[216.39.53.2]: Connection timed out (port 25)
Sep 23 04:48:32 server1 postfix/smtp[24431]: connect to b.mx.mail.yahoo.com[66.196.97.250]: Connection timed out (port 25)
Sep 23 04:48:32 server1 postfix/smtp[24431]: 36C8E6015B: to=<jweswarner@yahoo.com>, relay=none, delay=22267, delays=22117/0.16/150/0, dsn=4.4.1, status=deferred (connect to b.mx.mail.yahoo.com[66.196.97.250]: Connection timed out)
Sep 23 06:09:21 server1 postfix/qmgr[8651]: 36C8E6015B: from=<jim@wheelmanky.podzone.net>, size=1504, nrcpt=1 (queue active)
Sep 23 06:09:51 server1 postfix/smtp[25820]: connect to g.mx.mail.yahoo.com[209.191.88.239]: Connection timed out (port 25)
Sep 23 06:10:21 server1 postfix/smtp[25820]: connect to c.mx.mail.yahoo.com[216.39.53.2]: Connection timed out (port 25)
Sep 23 06:10:51 server1 postfix/smtp[25820]: connect to c.mx.mail.yahoo.com[216.39.53.3]: Connection timed out (port 25)
Sep 23 06:11:21 server1 postfix/smtp[25820]: connect to e.mx.mail.yahoo.com[216.39.53.1]: Connection timed out (port 25)
Sep 23 06:11:51 server1 postfix/smtp[25820]: connect to a.mx.mail.yahoo.com[209.191.118.103]: Connection timed out (port 25)
Sep 23 06:11:51 server1 postfix/smtp[25820]: 36C8E6015B: to=<jweswarner@yahoo.com>, relay=none, delay=27266, delays=27116/0.02/150/0, dsn=4.4.1, status=deferred (connect to a.mx.mail.yahoo.com[209.191.118.103]: Connection timed out)
Sep 23 07:32:41 server1 postfix/qmgr[8651]: 36C8E6015B: from=<jim@wheelmanky.podzone.net>, size=1504, nrcpt=1 (queue active)
Sep 23 07:33:12 server1 postfix/smtp[27238]: connect to d.mx.mail.yahoo.com[66.196.82.7]: Connection timed out (port 25)
Sep 23 07:33:42 server1 postfix/smtp[27238]: connect to c.mx.mail.yahoo.com[216.39.53.3]: Connection timed out (port 25)
Sep 23 07:34:12 server1 postfix/smtp[27238]: connect to c.mx.mail.yahoo.com[216.39.53.2]: Connection timed out (port 25)
Sep 23 07:34:42 server1 postfix/smtp[27238]: connect to a.mx.mail.yahoo.com[209.191.118.103]: Connection timed out (port 25)
Sep 23 07:35:12 server1 postfix/smtp[27238]: connect to g.mx.mail.yahoo.com[209.191.88.239]: Connection timed out (port 25)
Sep 23 07:35:12 server1 postfix/smtp[27238]: 36C8E6015B: to=<jweswarner@yahoo.com>, relay=none, delay=32267, delays=32117/0.02/150/0, dsn=4.4.1, status=deferred (connect to g.mx.mail.yahoo.com[209.191.88.239]: Connection timed out)
Sep 23 08:56:01 server1 postfix/qmgr[8651]: 36C8E6015B: from=<jim@wheelmanky.podzone.net>, size=1504, nrcpt=1 (queue active)
Sep 23 08:56:31 server1 postfix/smtp[28582]: connect to b.mx.mail.yahoo.com[66.196.97.250]: Connection timed out (port 25)
Sep 23 08:57:01 server1 postfix/smtp[28582]: connect to e.mx.mail.yahoo.com[216.39.53.1]: Connection timed out (port 25)
Sep 23 08:57:31 server1 postfix/smtp[28582]: connect to f.mx.mail.yahoo.com[209.191.88.247]: Connection timed out (port 25)
Sep 23 08:58:01 server1 postfix/smtp[28582]: connect to g.mx.mail.yahoo.com[209.191.88.239]: Connection timed out (port 25)
Sep 23 08:58:31 server1 postfix/smtp[28582]: connect to g.mx.mail.yahoo.com[206.190.53.191]: Connection timed out (port 25)
Sep 23 08:58:31 server1 postfix/smtp[28582]: 36C8E6015B: to=<jweswarner@yahoo.com>, relay=none, delay=37266, delays=37116/0.02/150/0, dsn=4.4.1, status=deferred (connect to g.mx.mail.yahoo.com[206.190.53.191]: Connection timed out)
Sep 23 10:13:40 server1 postfix/sendmail[30041]: fatal: usage: sendmail [options]
Sep 23 10:19:21 server1 postfix/qmgr[8651]: 36C8E6015B: from=<jim@wheelmanky.podzone.net>, size=1504, nrcpt=1 (queue active)
Sep 23 10:19:51 server1 postfix/smtp[30151]: connect to b.mx.mail.yahoo.com[66.196.97.250]: Connection timed out (port 25)
Sep 23 10:20:21 server1 postfix/smtp[30151]: connect to f.mx.mail.yahoo.com[209.191.88.247]: Connection timed out (port 25)
Sep 23 10:20:51 server1 postfix/smtp[30151]: connect to f.mx.mail.yahoo.com[68.142.202.247]: Connection timed out (port 25)
Sep 23 10:21:21 server1 postfix/smtp[30151]: connect to d.mx.mail.yahoo.com[66.196.82.7]: Connection timed out (port 25)
Sep 23 10:21:51 server1 postfix/smtp[30151]: connect to e.mx.mail.yahoo.com[216.39.53.1]: Connection timed out (port 25)
Sep 23 10:21:51 server1 postfix/smtp[30151]: 36C8E6015B: to=<jweswarner@yahoo.com>, relay=none, delay=42267, delays=42117/0.02/150/0, dsn=4.4.1, status=deferred (connect to e.mx.mail.yahoo.com[216.39.53.1]: Connection timed out)
Sep 23 10:33:28 server1 dovecot: imap-login: Login: user=<wheelmanky>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Sep 23 10:33:29 server1 last message repeated 5 times
Sep 23 10:33:30 server1 dovecot: IMAP(wheelmanky): Connection closed
Sep 23 10:33:31 server1 last message repeated 5 times
Sep 23 11:42:41 server1 postfix/qmgr[8651]: 36C8E6015B: from=<jim@wheelmanky.podzone.net>, size=1504, nrcpt=1 (queue active)
Sep 23 11:43:12 server1 postfix/smtp[31612]: connect to c.mx.mail.yahoo.com[216.39.53.2]: Connection timed out (port 25)
Sep 23 11:43:42 server1 postfix/smtp[31612]: connect to f.mx.mail.yahoo.com[68.142.202.247]: Connection timed out (port 25)
Sep 23 11:44:12 server1 postfix/smtp[31612]: connect to b.mx.mail.yahoo.com[66.196.97.250]: Connection timed out (port 25)
Sep 23 11:44:42 server1 postfix/smtp[31612]: connect to e.mx.mail.yahoo.com[216.39.53.1]: Connection timed out (port 25)
Sep 23 11:45:12 server1 postfix/smtp[31612]: connect to c.mx.mail.yahoo.com[216.39.53.3]: Connection timed out (port 25)
Sep 23 11:45:12 server1 postfix/smtp[31612]: 36C8E6015B: to=<jweswarner@yahoo.com>, relay=none, delay=47267, delays=47117/0.02/150/0, dsn=4.4.1, status=deferred (connect to c.mx.mail.yahoo.com[216.39.53.3]: Connection timed out)

See, you shouldn’t be seeing those attempts to connect to Yahoo if the relayhost is setup/working. Postfix should only ever be talking to your ISP.

Can you post your actual config file, /etc/postfix/main.cf? Something doesn’t seem quite right.

Thanks,
-Eric

my relayhost is set at the very end of the file [file name=main.txt size=27824]http://www.virtualmin.com/components/com_fireboard/uploaded/files/main.txt[/file]

Okay, and just to verify, you did restart Postfix after adding that line?

yes, everytime i made a change, i would restart it