Hi,
I'm having some problems with sendmail in Linux. The thing is when I type the following command to send an e-mail:
Code:
sendmail bartoszk@companydomain.pl< test.txt
it looks like it executed but I don't receive the mail. The file test.txt looks like that:
Code:
To: serwis@ubuntu-server.linux.companydomain.pl
Subject: Tests
From: serwis@linux.companydomain.pl
TestTestTestTestTest
Logs show something like that:
Code:
$.1.119], dsn=4.1.8, stat=Deferred: 450 4.1.8 <root@ubuntu-server.linux.companydomain.pl>: Sender address rejected: Domain not found
In the /etc/hosts there are following lines:
Code:
127.0.0.1 localhost localhost.linux.companydomain.pl
127.0.1.1 rtnagios rtnagios.companydomain.pl
127.0.1.1 ubuntu-server ubuntu-server.linux.companydomain.pl
192.168.1.119 linux linux.companydomain.pl
127.0.0.1 companydomain companydomain.pl
# The following lines are desirable for IPv6 capable hosts
#::1 ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
The sendmail.mc file is:
Code:
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dnl
dnl #
dnl # Be somewhat anal in what we allow
define(`confPRIVACY_FLAGS',dnl
`needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings')dnl
dnl #
dnl # Define connection throttling and window length
define(`confCONNECTION_RATE_THROTTLE', `15')dnl
define(`confCONNECTION_RATE_WINDOW_SIZE',`10m')dnl
dnl #
dnl # Features
dnl #
dnl # use /etc/mail/local-host-names
FEATURE(`use_cw_file')dnl
dnl #
dnl # The access db is the basis for most of sendmail's checking
FEATURE(`access_db', , `skip')dnl
dnl #
dnl # The greet_pause feature stops some automail bots - but check the
dnl # provided access db for details on excluding localhosts...
FEATURE(`greet_pause', `1000')dnl 1 seconds
dnl #
dnl # Delay_checks allows sender<->recipient checking
FEATURE(`delay_checks', `friend', `n')dnl
dnl #
dnl # If we get too many bad recipients, slow things down...
define(`confBAD_RCPT_THROTTLE',`3')dnl
dnl #
dnl # Stop connections that overflow our concurrent and time connection rates
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
dnl #
dnl # If you're on a dialup link, you should enable this - so sendmail
dnl # will not bring up the link (it will queue mail for later)
dnl define(`confCON_EXPENSIVE',`True')dnl
dnl #
dnl # Dialup/LAN connection overrides
dnl #
include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
dnl #
define(`SMART_HOST',`companydomain.pl')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl
dnl # Default Mailer setup
MAILER_DEFINITIONS
MAILER(`smtp')dnl
dnl # Masquerading options
Sending mails via
Code:
sendmail -fserwis@linux.companydomain.pl bartoszk@companydomain.pl < test.txt
doesn't work either.
linux.companydomain.pl digged:
Code:
root@ubuntu-server:/home/companydomain# dig linux.companydomain.pl
; <<>> DiG 9.8.1-P1 <<>> linux.companydomain.pl
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2628
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;linux.companydomain.pl. IN A
;; ANSWER SECTION:
linux.companydomain.pl. 0 IN A 192.168.1.119
;; Query time: 107 msec
;; SERVER: 8.8.4.4#53(8.8.4.4)
;; WHEN: Thu Nov 20 11:46:15 2014
;; MSG SIZE rcvd: 49
The command:
Code:
grep -iw from /var/log/mail*
output:
wklej.to/Bbe0T (it's a link because the log file is far too long to paste it here)
What's interesting is the fact that there are no logs from 20th November. The question is: why? There should also be logs from 19th November, since I started struggling with sendmail on Wednesday. But there are not, which is strange. System date/time is set correctly, so the problem isn't there.
Another command:
Code:
ps -aux|egrep '(sendmail|syslog)'
gave that output:
Code:
[color=#FF0000][b]syslog[/b] [/color]400 0.0 0.1 249476 2460 ? Sl Nov19 0:40 r[b][color=#FF0000]syslog[/color][/b]d -c5
root 1083 0.0 0.1 101612 2660 ? Ss Nov19 0:06 [b][color=#FF0000]sendmail[/color][/b]: MTA: accepting connections
support 31503 0.0 0.0 25096 1468 ? S Nov20 0:00 /usr/sbin/[b][color=#FF0000]sendmail [/color][/b]-i -FCronDaemon -oem support
support 33172 0.0 0.0 25096 1464 ? S 00:15 0:00 /usr/sbin/[b][color=#FF0000]sendmail [/color][/b]-i -FCronDaemon -oem support
root 55914 0.0 0.0 10624 932 pts/0 S+ 09:10 0:00 egrep --color=auto ([b][color=#FF0000]sendmail[/color][/b]|[b][color=#FF0000]syslog[/color][/b])
How can I fix it?