Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems receiving external mail with Sendmail

Status
Not open for further replies.

ivanros

Technical User
Dec 13, 2002
9
NL
Hi,

I have a strange sendmail problem and I couldn't find an answer on the web.

I use Red Hat Linux version 7.2 and sendmail version 8.11.

I have a Linux Machine on the internet. I use a hostname from Dynamic DNS Network Services at
dyndns.org so I don't have to use my IP. I have a static IP address and my server is always on.

I have set sendmail up, internal mail works ok, but I cannot receive mail from for
example hotmail.com nor from another account outside(Exchange Server). My SMTP port is open and I can telnet it from
outside the internal network on another linux machine. If I watch the maillog file it doesn't give any entry of the mail sent from
hotmail nor from the other account. I have tried many things, but without succes. But you know what the
strangest thing is! If I sent a message from the other linux machine from the outside I do recieve the mail, with
mail -s "Test" root@my_domain. But when I do mail -s "Test" root@my_ipaddress I don't receive the mail.

My sendmail.mc from which I created the sendmail.cf file looks like:
divert(-1)
dnl This is the sendmail macro config file. If you make changes to this file,
dnl you need the sendmail-cf rpm installed and then have to generate a
dnl new /etc/sendmail.cf by running the following command:
dnl
dnl m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')
VERSIONID(`linux setup for Red Hat Linux')dnl
OSTYPE(`linux')
define(`confDEF_USER_ID',``8:12'')dnl
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
dnl define(`STATUS_FILE', `/etc/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
dnl FEATURE(delay_checks)dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
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.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
dnl NOTE: binding both IPv4 and IPv6 daemon to the same port requires
dnl a kernel patch
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')
dnl We strongly recommend to comment this one out if you want to protect
dnl yourself from spam. However, the laptop and users on computers that do
dnl not have 24x7 DNS do need this.
dnl FEATURE(`accept_unresolvable_domains')dnl
dnl FEATURE(`relay_based_on_MX')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
Cwlocalhost.localdomain

In the hosts.allow I have the entry sendmail:ALL

Do you maybe know what I did do wrong? O dit forget to do?
I hope you can help me out.

Thanks in advance,

Ivan Rosaria
 
Looks like a MX problem..
You need to go to your dns provider (dyndns.org ) and create a MX record, should be next to A,CNAME records.
And direct it to your mail server's ip address.
Do NOT set anything for the name part , leave it blank.
MX ---> your_mail_servers_ip_address.
 
Hi,

But why should I use MX if the IP of my mail sever is the on belonging already to the hostname from dyndns?
I read that MX is used if the mail server is on an other IP than the hostname point to. This is not the case here.

Hmmm or is there an other reason why to use it? I'll try it out. I don't know if the changes are made immediatly.

Thanks,

Ivan Rosaria
 
"But why should I use MX if the IP of my mail sever is the on belonging already to the hostname from dyndns?
I read that MX is used if the mail server is on an other IP than the hostname point to. This is not the case here.
"
Not true. MX records are used to let other hosts know that there is a mail server on your domain. If the mail server (ie sendmail) can't find an MX record for a domain, it wont send it because it doesn't know where to send it. //Daniel
 
Ok thus you are saying if a mail message comes from hotmail.com the server on my_ip or hostname doesn't know to which port it should be delivered and what to do with it, thus discards it. And that is way I can't find anything in my maillogs. Did I understand it well?

I can set the following information at dyndns.org
chosen hostname
IP in Database/DNS: ---
New IP Address:---
Enable Wildcard (optional):---
Mail Exchanger (optional):--- Backup MX? ---
--- = spaces to fill

Now I don't understand very well what I should do?

My current setting at dyndns.org is somethink like this:
my_hostname
IP in Database/DNS: my_IP
New IP Address:my_IP
Enable Wildcard (optional):YES
Mail Exchanger (optional):(empty) Backup MX? NO

Should I put my_hostname in the Mail Exchanger?

Thanks for your patience,

Ivan Rosaria


 
Ivan,
Your settings should look something like this,

my_hostname
IP in Database/DNS: my_IP
New IP Address:my_IP
Enable Wildcard (optional):NO
Mail Exchanger (optional): my_IP Backup MX? NO

Now, just like danielhozac said,
Mail Server's first look up the MX records in the remote DNS, they never check if the host name exist or not.
Therefore the configuration I set above should work.
 
Hi,

I tried to do as you suggested but the "Mail Exchanger" field gets empty when I press modify. After that I went reading the howto on the dyndns.org service provider page and found the following citation:
"Why doesn't the NIC accept my mail exchanger?
According to RFC 1035, MX records (which are what the mail exchanger option creates) cannot be IP addresses or DNS hostnames created using CNAME records. If you attempt to use either an IP address or a CNAME as a mail exchanger, the NIC will disregard this invalid input.
"

And one question how come when I'm on an server on an external IP address and I send a mail to root@my_domain with the commando "mail -s "Test" root@my_domain" I receive the mail. Thanks for you advice and time :)

Thanks,

Ivan Rosaria

 
Hi here I'm again. Still no succes...

I have found a host provider dynu.com that supports MX end I set it up, but still the same problem. Here is an example of a mail I sent to my account om my server running sendmail:
**********************************************
** THIS IS A WARNING MESSAGE ONLY **
** YOU DO NOT NEED TO RESEND YOUR MESSAGE **
**********************************************

The original message was received at Sun, 15 Dec 2002 12:26:48 +0100 (MET)
from external source

----- Transcript of session follows -----
<root@my_host.dynu.com>... Deferred: Connection timed out with mail.my_host.dynu.com.
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old

I have tried everything. Are the any suggestions?

Bye,

Ivan Rosaria

 
Hi Ivan,

Just a question.. do you have a firewall rule set in your machine or are you inside a firewall?



Regards,

-krz-
 
Hi,

I found out what the problem was. The ISP from which I get my internet has filtered my SMTP port, thus that was why I couldn't receive mail. When I scanned my port from my PC everything looked ok, but when i port scanned it from the outside I noticed that the port 25 was filtered, that was why I couldn't receive mail.

But there are DNS hosts that offer services to forward mail to an other port. But I still couldn't find one that was free. The cheapest is $14 a year, what is not expensive.

Greetings,

Ivan Rosaria
 
A dns host doing port forwarding ? interesting.
Can you give some websites ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top