LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Sendmail -- What Did I Forget? (https://www.linuxquestions.org/questions/slackware-14/sendmail-what-did-i-forget-4175468341/)

tronayne 07-03-2013 08:57 AM

Sendmail -- What Did I Forget?
 
I've done a clean install of Slackware 64-bit 14.0 (fully patched) on a laptop. On all my systems, sendmail "just works;" i.e., I can
Code:

mailx -s "This is a Test Message" trona
This is a test message.
Ctrl-D

and the message gets sent, but not on this one. The sendmail is running and looks the same on the new installation as it does on all the other boxes. I don't do any configuration for sendmail (and have a couple of applications that use it to send mail to the outside world with no problems).

What the heck have I forgotten to turn on? /etc/rc.d looks like
Code:

./        rc.autofs      rc.inet1*          rc.modules-3.2.45*  rc.sendmail*      rc.yp
../        rc.bind        rc.inet1.conf      rc.mysqld          rc.serial        rc0.d/
init.d/    rc.bluetooth    rc.inet2*          rc.networkmanager  rc.snmpd          rc1.d/
rc.0@      rc.cgconfig    rc.inetd*          rc.nfsd            rc.sshd*          rc2.d/
rc.4*      rc.cgred        rc.ip_forward      rc.ntpd*            rc.syslog*        rc3.d/
rc.6*      rc.consolekit*  rc.local*          rc.pcmcia          rc.sysstat        rc4.d/
rc.K*      rc.cups*        rc.local_shutdown*  rc.php-fpm          rc.sysvinit*      rc5.d/
rc.M*      rc.dnsmasq      rc.loop*            rc.php-fpm.new      rc.tomcat*        rc6.d/
rc.S*      rc.font        rc.mcelog*          rc.postgresql*      rc.udev*
rc.acpid*  rc.fuse*        rc.messagebus*      rc.rpc              rc.wicd*
rc.alsa*  rc.gpm*        rc.modules@        rc.samba            rc.wireless*
rc.atalk  rc.httpd        rc.modules-3.2.29*  rc.saslauthd        rc.wireless.conf


zhjim 07-03-2013 09:27 AM

Check the log files of mail. Should be /var/log/mail.log. ls /var/log/mail.*. There should be four files.

tronayne 07-03-2013 09:43 AM

A check of /var/log/maillog shows
Code:

Jul  3 10:29:56 pita sm-mta[16481]: r61KCwbf006996: to=<trona@pita.com>, delay=1+18:16:39, xdelay=00:00:00, mailer=esmtp, pri=9300454, relay=pita.com.com., dsn=4.0.0, stat=Deferred: Connection refused by pita.com.com.
Uh-oh, where the heck is pita.com.com coming from?

pita's entry in /etc/hosts is
Code:

192.168.1.30                pita.com pita
and that is the content of /etc/HOSTNAME, looks like somebody, somewhere is adding the extra .com -- just who might that be?

Cripes.

zhjim 07-03-2013 10:00 AM

I dunno much about sendmail but maybe it needs a FQDN? With a dot at the end. Okay lets check the hostnames and alike
PHP Code:

hosntame
hostname 
-A
hostname 
-d
hostname 
-


tronayne 07-03-2013 10:18 AM

It looks normal to me:
Code:

    -s, --short          short host name
    -a, --alias          alias names
    -i, --ip-address      addresses for the hostname
    -f, --fqdn, --long    long host name (FQDN)
    -d, --domain          DNS domain name
    -y, --yp, --nis      NIS/YP domainname
    -F, --file            read hostname or NIS domainname from given file

and
Code:

for opt in s a i f d y
do
        print -n "hostname -${opt}: "
        hostname -${opt}
done
hostname -s: pita
hostname -a: pita
hostname -i: 192.168.1.30
hostname -f: pita.com
hostname -d: com
hostname -y: (none)

(that's KornShell, not BASH).

So, I dunno.

Spatior 07-03-2013 11:04 AM

Hi tronayne,

I have a similar problem to yours so I think what I have found so far may help you

pita.com.com is probably coming from $w macros, it is assigned at sendmail start from the gethostname() function to get the (local)host name

You can try to run sendmail -bt -d8.8 to see how it is resolving the DNS:
Code:

sendmail -bt -d8.8
3,0 user[at][domain.com]

It will expand and resolv the recipe string as it will normally do but showing the steps from each macro involved
I found the following book very helpful to understand how sendmail works:
http://www.diablotin.com/librairie/n...il/ch31_10.htm
adn the DNS stuff in:
http://docstore.mik.ua/orelly/networ...il/ch21_02.htm

Now, the problem I found is that when I send a mail to user [at] mydomain.com it tries to deliver to mydomain.com instead of the MX record which points to mail.mydomain.com I think it's the DNS setup which unfortunately is in another host so I cannot mess with that

I don't know if something similar is happening to you.

HTH

zhjim 07-03-2013 03:05 PM

After reading the maillog output again I see that the relay option is pita.com.com. Which concludes to me that spatior has some point with the dns settings. I can't check them from outside. Dont get a MX only massive NS records.

A short search for the $w macro states that it only gets assign on version 8. Not prior to this. dunno if your other machine have another version. Doubt it if all of them are slack 14.

tronayne 07-04-2013 05:24 AM

Thanks for the input -- here's the output of
Code:

sendmail -bt -d8.8
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> 3,0 user[at][domain.com]
canonify          input: user [ at ] [ domain . com ]
Canonify2          input: user [ at ] [ domain . com ]
Canonify2        returns: user [ at ] [ domain . com ]
canonify        returns: user [ at ] [ domain . com ]
parse              input: user [ at ] [ domain . com ]
Parse0            input: user [ at ] [ domain . com ]
Parse0          returns: user [ at ] [ domain . com ]
ParseLocal        input: user [ at ] [ domain . com ]
ParseLocal      returns: user [ at ] [ domain . com ]
Parse1            input: user [ at ] [ domain . com ]
Parse1          returns: $# local $: user [ at ] [ domain . com ]
parse            returns: $# local $: user [ at ] [ domain . com ]
>

This is identical to the output of both my servers and my work station (all of them are Slackware 14.0, the servers are 32-bit, the work station (and this laptop) are 64-bit and all four sedmails are un-fooled-around-with -- the laptop is the only one that is exhibiting this pita.com.com behavior (drat!).

All my machines are fixed-IP, with identical /etc/hosts files; i.e.,
Code:

# For loopbacking.
127.0.0.1                localhost
# For public and private OpenSRF comains
127.0.1.2      public.localhost        public
127.0.1.3      private.localhost      private
# Local servers
192.168.1.10                fubar.com fubar
192.168.1.15                InkJet
192.168.1.20                snafu.com snafu
192.168.1.30                pita.com pita
# Public servers
75.126.162.205                www.linuxquestions.org        linuxquestions.org
74.125.224.70                maps.google.com
74.125.224.111                maps.gstatic.com

So, I don't think DNS has anything to do with (and BIND is not configured nor is it running on any server); my /etc/resolv.conf (a little messy) contains:
Code:

cat /etc/resolv.conf
search com
nameserver 68.94.156.1
nameserver 68.94.157.1
# Google Free DNS Servers
#nameserver 8.8.8.8
#nameserver 8.8.4.4
# HughesNet DNS Servers
#nameserver 66.82.4.8
#nameserver 66.82.4.12

Those commented-out extras are there for the rare occasion that the first two aren't available for some reason or other; they're just-in-case. And, as I understand it, the first place we look is in /etc/hosts and, well, they're all there.

I'm not doing mailx trona@pita.com (which goes out to the world), I simply use mailx trona, which should be resolved (and is on every box but this one) to the local machine. And it ain't.

WFT.

Thanks for the input.

zhjim 07-08-2013 02:15 AM

Dunno if the output looks good. But I think that sendmail does not use your FQDN so it puts your domain (search in /etc/resolv.conf) at the end of the hostname. Coming from a little howto /etc/mail/genericsdomain should hold your FQDN. Do you have that one? What does it shown on (all) the machine(s)?

zhjim 07-08-2013 02:19 AM

Nother thing. How did you configure your sendmail?

jostber 07-08-2013 03:01 AM

Have you updated the sendmail.cf or sendmail.mc file?

http://www.cyberciti.biz/tips/sendma...ions-from.html
http://www.electrictoolbox.com/artic...ction-refused/

tronayne 07-08-2013 01:44 PM

Actually, I never configure any of the sendmail files; the norm is that it "just works" on the individual server and with a mailto link from an internal web page. No kidding, I don't configure anything on any of these boxes.

So, maybe I'll look at the configuration files and see what's what but dang if I can figure out where this additional .com is coming from given that all four machines are identical Slackware 14.0 installations (other than 32-bit versus 64-bit) with all patches applied.

Tiz a puzzlement.

zhjim 07-08-2013 02:05 PM

Hm that truly is weired. Maybe some packages did fiddle with your hosts config file or sendmail. Maybe a diff on the packages might show.
Also 32vs64 does not make a difference. But the one giving headache is the only 64bit?

tronayne 07-08-2013 02:46 PM

Yeah, I know that 32-bit and 64-bit are pretty much identical -- the one being a pain happens to be a 64-bit lap top (which is identical to a 64-bit desk top). There's not enough on it to make a difference (so I can just scrap it and reload Slackware and see what happens).

I mean I haven't got a clue -- never seen this before and these guys are kept identical with configuration files and patches, including the recent kernel patch on all. The two 32-bit data base servers have old Radeon cards but the 64-bit boxes have Intel graphics (and how that could make any difference I most certainly do not know).

I think I'll just do a clean install and see what that does (if anything) to make a difference. It's just goofy.

zhjim 07-08-2013 03:20 PM

Hm. Does slackware has some options for labtop installs? I know in Debian theres an option for that. Also its more for energy saving and alike but maybe theres a silent com(on) give me more power. Just kidding. Long time ago I lost track of slack.

Maybe you can just copy the files of the desktop over to the labtop? At least that rules out any configurations. Also you would need to just host.conf and alike. Grub if installed also if you dont use the same uuid for the partitions.
Could you backup the /etc directory and diff it after the installation? Maybe this will shed some light.

volkerdi 07-08-2013 04:10 PM

Quote:

Originally Posted by zhjim (Post 4986480)
Hm. Does slackware has some options for labtop installs? I know in Debian theres an option for that. Also its more for energy saving and alike but maybe theres a silent com(on) give me more power. Just kidding. Long time ago I lost track of slack.

Why are you posting here?

tronayne 07-08-2013 04:12 PM

Quote:

Originally Posted by zhjim (Post 4986480)
Hm. Does slackware has some options for labtop installs? I know in Debian theres an option for that. Also its more for energy saving and alike but maybe theres a silent com(on) give me more power. Just kidding. Long time ago I lost track of slack.

Maybe you can just copy the files of the desktop over to the labtop? At least that rules out any configurations. Also you would need to just host.conf and alike. Grub if installed also if you dont use the same uuid for the partitions.
Could you backup the /etc directory and diff it after the installation? Maybe this will shed some light.

Nope, no special stuff for a lap top; install and go. There are settings for power management and the like (in Xfce, KDE), but nothing special about a lap top versus a desk top or server or blade or whatever. Partitioning is done ahead of time with cfdisk or fdisk (for those that love to type), nothing special (and all my machines are partitioned pretty much identically, although some are mounts of drives other than /sdax). What I will do is diff /etc from one to the other (which are identical in any event -- I use fixed-IP addressing and all systems are listed in every /etc/hosts. The one difference will be /etc/rc.d/rc.init1.conf where the local machine is set; lilo.conf is identical, everybody boots from /sda1.

Really goofy, this condition. Don't have a clue (yet).

Thanks for the input.

volkerdi 07-08-2013 04:21 PM

While it should "just work", for some reason it isn't. You might be able to work around it by specifying your relay in sendmail.cf, though:

Code:

# "Smart" relay host (may be null)
DSpita.com

It might be related to this:

Quote:

hostname -d: com
Here, I get these results:

Quote:

hostname: hive64
hostname -d: slackware.lan
Perhaps things would go better if your machine's full hostname wasn't just the domain name.

zhjim 07-09-2013 03:32 AM

Quote:

Originally Posted by volkerdi (Post 4986512)
Why are you posting here?

Cause I want to help. Also despite me knowledge of sendmail.

Richard Cranium 07-09-2013 03:57 AM

Quote:

Originally Posted by zhjim (Post 4986789)
Cause I want to help. Also despite me knowledge of sendmail.

There's nobody in the Debian universe that needs help?

I work with RedHat as part of the Day Job(TM) but I feel no need to tool over to that forum to offer my advice about, well, anything. That's mainly because my advice would be almost invariably wrong due to my shallow knowledge of how things work in that Linux distribution.

zhjim 07-09-2013 04:02 AM

Might be that I like to learn some more. Or see how slackware developed or just cause i like to piss of people. And also cause somethings are common to all linux derivates like hostname or domainnames.

tronayne 07-09-2013 09:30 AM

Quote:

Originally Posted by volkerdi (Post 4986520)
While it should "just work", for some reason it isn't. You might be able to work around it by specifying your relay in sendmail.cf, though:

Perhaps things would go better if your machine's full hostname wasn't just the domain name.

Thanks for that; what I get is
Code:

hostname
pita
hostname -d
com

I tried editing /etc/sendmail.cf:
Code:

# "Smart" relay host (may be null)
DSpita.com

which was NULL (as are all my systems).

By the way, this does look like I think it should:
Code:

/etc/rc.d/rc.sendmail stop
/etc/rc.d/rc.sendmail start
Starting sendmail MTA daemon:  /usr/sbin/sendmail -L sm-mta -bd -q25m
Starting sendmail MSP queue runner:  /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m

but I'm not positive about that.

So, logged in as root,
Code:

mailx -s "Test Message" trona
This is a test message.
EOT
tail /var/log/maillog
 .
 .
 .
Jul  9 10:04:45 pita sendmail[2894]: r69E4hFd002894: to=trona, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30227, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r69E4hRE002895 Message accepted for delivery)
Jul  9 10:05:01 pita sm-mta[2898]: r69E4hRE002895: to=<trona@pita.com>, delay=00:00:16, xdelay=00:00:16, mailer=esmtp, pri=120436, relay=pita.com.com. [216.239.120.238], dsn=4.0.0, stat=Deferred: Connection refused by pita.com.com.

Looking at your post, where the box is slackware.lan looks like a good idea -- I've just used .com since forever (even though there are actual web sites with the names I use) simply... because. Think I'll change 'em to .lan.

One other thing, that I don't think has anything to do with anything, is that my only Internet access is via HughesNet; there's no wireless, no DSL, no cable, no fiber optic -- dial-up or HugesNet, that's it. HughesNet does not issue fixed-IP addresses and the interface does not allow the outside world to come in. The guy is coming this afternoon to install the G4 upgrade (which will take me from 150K-300K to 10Mbs, which is roughly 12.5MB, which is a heckuva lot faster, but still no outside access). I do all mail with gmail.com.

Also, as far as I can tell, my FQDN is simply .com? And, SSH between all systems works just fine (so the /etc/hosts entries appear to be "in charge" and there's no DNS involved?

So, I'm thinking reinstall 14.0, apply the patches and see what's what. I can't think of anything else to do.

Thanks for the input.

zhjim 07-09-2013 09:44 AM

A FQDN is hostname [dot] tld [dot]. The dot at the end is important. At least according to the RFC's. Also most installers are happy with just the hostname[dot]tld.
Coming from my question for hostname -f your FQDN is "pita.com". The manpage of hostname has some explanations and caveats how hostname returns the fqdn. See that for more info.

As I said I'm not so deep into sendmail so i best get out of the way and let the known sort that.

jostber 07-09-2013 05:44 PM

Could you try to enter this into your /etc/hosts file?

127.0.0.1 pita pita.com.

Then restart the network service:

/etc/rc.d/rc.inet1 restart

tronayne 07-09-2013 05:52 PM

Uh, nope, don't think so, that's the address of localhost (not to be fiddled with, methinks).

Thanks, though.

volkerdi 07-09-2013 06:06 PM

I think the fix might be to use a hostname like somehost.pita.lan, where the hostname will be seen as "somehost" and the domain name as "pita.lan". I've never deployed a machine that had only a domain name (or a domain name of just .com). With slackware.com, for example, the actual machine has a longer hostname (connie.slackware.com) and reaching it via "slackware.com" is done with a CNAME in DNS. I think that might be what is confusing sendmail, since here it works out of the box on hive64.slackware.lan.

jostber 07-10-2013 05:02 AM

Quote:

Originally Posted by jostber (Post 4987322)
Could you try to enter this into your /etc/hosts file?

127.0.0.1 pita pita.com.

Then restart the network service:

/etc/rc.d/rc.inet1 restart

Sorry, that should be:

127.0.0.1 localhost
192.168.1.30 pita pita.com.

zhjim 07-10-2013 09:41 AM

2 Attachment(s)
After installing a minimal slackware 14 system with your hostname (pita) and domainname (com) I could send mail with mail -s "This is a testmail" trona after adding the user. Which got delivered and sits inside the mailbox now.

What differs in my log line from your log line that sendmail uses the local mailer and not the esmtp. relay is 127.0.0.1 which sounds okay.
Code:

Jul 10 16:24:50 pita sendmail[1704]: r6AEOoL0001704: from=root, size=230, class=0, nrcpts=1, msgid=<201307101424.r6AEOoL0001704@pita.com>, relay=root@localhost
Jul 10 16:24:50 pita sm-mta[1705]: r6AEOoeb001705: from=<root@pita.com>, size=440, class=0, nrcpts=1, msgid=<201307101424.r6AEOoL0001704@pita.com>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Jul 10 16:24:50 pita sendmail[1704]: r6AEOoL0001704: to=trona, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30230, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r6AEOoeb001705 Message accepted for delivery)

I'll attach some config files HTH

zhjim 07-10-2013 09:42 AM

2 Attachment(s)
and an empty post for another two files

tronayne 07-11-2013 07:36 AM

Quote:

Originally Posted by volkerdi (Post 4987332)
I think the fix might be to use a hostname like somehost.pita.lan, where the hostname will be seen as "somehost" and the domain name as "pita.lan". I've never deployed a machine that had only a domain name (or a domain name of just .com). With slackware.com, for example, the actual machine has a longer hostname (connie.slackware.com) and reaching it via "slackware.com" is done with a CNAME in DNS. I think that might be what is confusing sendmail, since here it works out of the box on hive64.slackware.lan.

Every day I learn how ignorant I can be. I've always just given a box a name, address and domain, made an entry in /etc/hosts and got on with it (they all talk to each other with SSH and life is good). Looks like it's time for a change and I'd really appreciate it if you could suggest a source for setting it up.

My little LAN can limp along as is but I've got a bigger system to do (I was in the Navy, ours, and learned the basic lesson about never volunteering, think I'd know better): couple of severs, five or more existing PC's, LAN connections for data entry and analysis, non-profit institute, lots of data, lots of volunteer users, long-term (like years if not decades and I will not live to see the end). Gotta do it right and it looks to me like what you're doing is the right approach -- I've just never done it and figure if I get my act together that I can repeat that, just need a little push in the right direction so I can figure out how to do it (as in: is there a how-to that I haven't been able to find yet?).

The original problem with sendmail I think has been eclipsed -- I am going to do a reinstall and step-by-step apply the patches (including the kernel) and see if I can find where it breaks. But, that may be moot if I can configure that box (and the rest of mine) as you suggest. I'm using that box to install and configure DSpace (not the simplest thing to put in what with the required software). I have looked at everything I can find that has anything to do with networking and sendmail and all of it has been untouched by patches or software installation as far as I can tell (the date stamps are distribution, diff doesn't show anything) but who knows what evil lurks here and there.

I really appreciate your input and thank you for taking the time and trouble.

Thomas

tronayne 07-12-2013 12:07 PM

OK, enough fooling around -- I did a clean reinstall of Slackware64 14.0 then did testing of sendmail:
  • I named the box pita.lan;
  • Set up my account;
  • Sent mail from root to me, worked fine;
  • Installed all stable patches (except the kernel patches);
  • Sent mail from root to me and vice versa, worked fine, no runs, no drips, no errors;
  • Upgraded to ksh93-2012_08_01-x86_64-1, did sendmail in both directions, worked fine (had to check just to see).
Going to upgrade the kernel and see what's what with that (if anything).

OK, upgraded to Kernel-3.2.45 (this box has Intel graphics), ran the sendmail tests in both directions, works fine.

Maybe it was the pita.com that was causing the problem (although my three other Slackware 14.0 boxes that are identical to this one worked fine to being with) but, whatever, the blasted thing is working fine so I'm going to mark this one solved.

I'm also going to change all the others to sname.lan and see how that goes -- just sounds like a good idea. None of these guys have service from the outside world (HughesNet just don't want ya doin' that!) and I don't have a registered domain name and I'm hoping that changed from .com to .lan will eliminate whatever glitch there might be.

Unless somebody's got a better idea about how to configure my LAN...

Thanks to all for the help.

NoStressHQ 07-12-2013 09:31 PM

Quote:

Originally Posted by tronayne (Post 4989183)
Unless somebody's got a better idea about how to configure my LAN...

The only good advice I can give you on this is to try to create a new thread dedicated to that problem :).

BTW, I'm curious too.

Cheers

Garry.

jostber 07-13-2013 01:25 PM

Quote:

Originally Posted by tronayne (Post 4989183)
OK, enough fooling around -- I did a clean reinstall of Slackware64 14.0 then did testing of sendmail:
  • I named the box pita.lan;
  • Set up my account;
  • Sent mail from root to me, worked fine;
  • Installed all stable patches (except the kernel patches);
  • Sent mail from root to me and vice versa, worked fine, no runs, no drips, no errors;
  • Upgraded to ksh93-2012_08_01-x86_64-1, did sendmail in both directions, worked fine (had to check just to see).
Going to upgrade the kernel and see what's what with that (if anything).

OK, upgraded to Kernel-3.2.45 (this box has Intel graphics), ran the sendmail tests in both directions, works fine.

Maybe it was the pita.com that was causing the problem (although my three other Slackware 14.0 boxes that are identical to this one worked fine to being with) but, whatever, the blasted thing is working fine so I'm going to mark this one solved.

I'm also going to change all the others to sname.lan and see how that goes -- just sounds like a good idea. None of these guys have service from the outside world (HughesNet just don't want ya doin' that!) and I don't have a registered domain name and I'm hoping that changed from .com to .lan will eliminate whatever glitch there might be.

Unless somebody's got a better idea about how to configure my LAN...

Thanks to all for the help.

You can use this article as input:

http://computechtips.com/295/slackware-linux-pc-router


All times are GMT -5. The time now is 03:23 AM.