0

I have installed sendmail on my linux machine(Linux Mint) and I followed : how to configure sendmail on ubuntu on Stack Overflow.

I got no errors till the end and I successfully restarted the sendmail.

To check I tried using telnet. Here's the terminal print

hackathon mail # telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 hackathon ESMTP Sendmail 8.14.4/8.14.4/Debian-4.1ubuntu1; Sat, 7 Mar 2015 14:59:26 +0530; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
HELO server
250 hackathon Hello localhost [127.0.0.1], pleased to meet you
MAIL from : localhostmailbox@gmail.com
250 2.1.0 localhostmailbox@gmail.com... Sender ok
RCPT to : naveenchaudhary2010@hotmail.com
250 2.1.5 naveenchaudhary2010@hotmail.com... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Subject : Test mail
.
250 2.0.0 t279TQBC024546 Message accepted for delivery
quit
221 2.0.0 hackathon closing connection
Connection closed by foreign host.

Though telnet says message accepted to deliver, but I see no mail neither in Inbox or Junk of recepient, nor in the sent folder of sender.

I tried using php also. php.ini settings :

; For Win32 only.
; http://php.net/smtp
SMTP=smtp.gmail.com
; http://php.net/smtp-port
smtp_port=587

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = localhostmailbox@gmail.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =

Here's the PHP code :

<?php
$to = "naveenchaudhary2010@hotmail.com";
$subject = "test";
$body = "This is a text";
$headers = 'From : "localhost" localhostmailbox@gmail.com';

$return_val = mail($to,$subject,$body,$headers);
if($return_val)
    echo "sent";
else
    echo "Failure :".$return_val;    
?>

This is also sending the error.I tried printing the return value of mail() which is null. Please help, this is my 7th hour wasted since morning and still no success till now.

EDIT

Dump of strace

2558  <... time resumed> NULL)          = 1425817211
13250 <... read resumed> "127.0.0.1\tlocalhost\n127.0.1.1\thackathon\n\n# The following lines are desirable for IPv6 capable hosts\n::1     ip6-localhost ip6-loopback\nfe00::0 ip6-localnet\nff00::0 ip6-mcastprefix\nff02::1 ip6-allnodes"..., 4096) = 224
2558  rt_sigprocmask(SIG_UNBLOCK, [ALRM],  <unfinished ...>
13250 close(4 <unfinished ...>
2558  <... rt_sigprocmask resumed> [ALRM], 8) = 0
13250 <... close resumed> )             = 0
2558  select(7, [4 5 6], NULL, NULL, {5, 0} <unfinished ...>
13250 munmap(0xb77a6000, 4096)          = 0
13250 fcntl64(8, F_GETFL)               = 0x2 (flags O_RDWR)
13250 dup(8)                            = 4
13250 fcntl64(4, F_GETFL)               = 0x2 (flags O_RDWR)
13250 getsockname(8, {sa_family=AF_INET, sin_port=htons(25), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
13250 open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 5
13250 fstat64(5, {st_mode=S_IFREG|0644, st_size=224, ...}) = 0
13250 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77a6000
13250 read(5, "127.0.0.1\tlocalhost\n127.0.1.1\thackathon\n\n# The following lines are desirable for IPv6 capable hosts\n::1     ip6-localhost ip6-loopback\nfe00::0 ip6-localnet\nff00::0 ip6-mcastprefix\nff02::1 ip6-allnodes"..., 4096) = 224
13250 close(5)                          = 0
13250 munmap(0xb77a6000, 4096)          = 0
13250 getegid32()                       = 126
13250 setgroups32(1, [126])             = 0
13250 ioctl(8, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0xbf855618) = -1 ENOTTY (Inappropriate ioctl for device)
13250 getpeername(8, {sa_family=AF_INET, sin_port=htons(51828), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
13250 stat64("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=187, ...}) = 0
13250 open("/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 5
13250 fstat64(5, {st_mode=S_IFREG|0644, st_size=187, ...}) = 0
13250 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77a6000
13250 read(5, "# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)\n#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN\nnameserver 127.0.1.1\nsearch 8.8.8.8\n", 4096) = 187
13250 read(5, "", 4096)                 = 0
13250 close(5)                          = 0
13250 munmap(0xb77a6000, 4096)          = 0
13250 stat64("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=187, ...}) = 0
13250 open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 5
13250 fstat64(5, {st_mode=S_IFREG|0644, st_size=224, ...}) = 0
13250 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77a6000
13250 read(5, "127.0.0.1\tlocalhost\n127.0.1.1\thackathon\n\n# The following lines are desirable for IPv6 capable hosts\n::1     ip6-localhost ip6-loopback\nfe00::0 ip6-localnet\nff00::0 ip6-mcastprefix\nff02::1 ip6-allnodes"..., 4096) = 224
13250 read(5, "", 4096)                 = 0
13250 close(5)                          = 0
13250 munmap(0xb77a6000, 4096)          = 0
13250 getsockname(8, {sa_family=AF_INET, sin_port=htons(25), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
13250 open("/etc/services", O_RDONLY|O_CLOEXEC) = 5
13250 fstat64(5, {st_mode=S_IFREG|0644, st_size=19558, ...}) = 0
13250 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77a6000
13250 read(5, "# Network services, Internet style\n#\n# Note that it is presently the policy of IANA to assign a single well-known\n# port number for both TCP and UDP; hence, officially ports have two entries\n# even if"..., 4096) = 4096
13250 close(5)                          = 0
13250 munmap(0xb77a6000, 4096)          = 0
13250 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
13250 rt_sigprocmask(SIG_BLOCK, [ALRM], [], 8) = 0
13250 time(NULL)                        = 1425817211
13250 rt_sigaction(SIGALRM, {0x80e56d0, [], SA_RESTART}, {0x80e56d0, [], SA_RESTART}, 8) = 0
13250 alarm(5)                          = 0
13250 rt_sigprocmask(SIG_UNBLOCK, [ALRM], [ALRM], 8) = 0
13250 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 5
13250 bind(5, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
13250 connect(5, {sa_family=AF_INET, sin_port=htons(113), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused)
13250 close(5)                          = 0
13250 rt_sigprocmask(SIG_BLOCK, [ALRM], [], 8) = 0
13250 rt_sigprocmask(SIG_UNBLOCK, [ALRM], [ALRM], 8) = 0
13250 kill(13250, SIGALRM)              = 0
13250 --- SIGALRM {si_signo=SIGALRM, si_code=SI_USER, si_pid=13250, si_uid=0} ---
13250 alarm(0)                          = 5
13250 time(NULL)                        = 1425817211
13250 time(NULL)                        = 1425817211
13250 sigreturn() (mask [])             = 0
13250 getsockopt(8, SOL_IP, IP_OPTIONS, "", [0]) = 0
13250 time(NULL)                        = 1425817211
13250 time(NULL)                        = 1425817211
13250 open("/proc/loadavg", O_RDONLY)   = 5
13250 fstat64(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
13250 read(5, "0.56 0.24 0.22 1/414 13250\n", 1024) = 27
13250 close(5)                          = 0
13250 time(NULL)                        = 1425817211
13250 stat64("/etc/mail/access.db", {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 lstat64("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13250 geteuid32()                       = 0
13250 lstat64("/etc", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
13250 geteuid32()                       = 0
13250 lstat64("/etc/mail", {st_mode=S_IFDIR|S_ISGID|0755, st_size=4096, ...}) = 0
13250 geteuid32()                       = 0
13250 open("/etc/mail/access.db", O_RDONLY) = 5
13250 fstat64(5, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(5, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 time(NULL)                        = 1425817211
13250 open("/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 6
13250 read(6, "0-1\n", 8192)            = 4
13250 close(6)                          = 0
13250 stat64("/etc/mail/access.db", {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 open("/etc/mail/access.db", O_RDONLY|O_LARGEFILE) = 6
13250 fcntl64(6, F_GETFD)               = 0
13250 fcntl64(6, F_SETFD, FD_CLOEXEC)   = 0
13250 read(6, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\t\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0_\v\20\0\6\10\0\0\321\326B\375\245^\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\27\20\0\0\321\215h^\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
13250 open("DB_CONFIG", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
13250 stat64("/var/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
13250 time(NULL)                        = 1425817211
13250 clock_gettime(CLOCK_REALTIME, {1425817211, 773188844}) = 0
13250 clock_gettime(CLOCK_REALTIME, {1425817211, 773264483}) = 0
13250 open("/etc/mail/access.db", O_RDONLY|O_LARGEFILE) = 7
13250 fcntl64(7, F_GETFD)               = 0
13250 fcntl64(7, F_SETFD, FD_CLOEXEC)   = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 pread64(7, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\t\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0_\v\20\0\6\10\0\0\321\326B\375\245^\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\27\20\0\0\321\215h^\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096, 0) = 4096
13250 close(5)                          = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 pread64(7, "\0\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\22\0C\17\0\r\353\17\351\17\324\17\322\17\306\17\300\17\260\17\251\17\235\17\226\17\212\17\203\17r\17l\17W\17U\17J\17C\17\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096, 4096) = 4096
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 pread64(7, "\0\0\0\0\1\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\34\0\363\16\0\r\361\17\357\17\333\17\331\17\315\17\312\17\273\17\271\17\245\17\243\17\227\17\224\17\204\17}\17k\17e\17V\17T\17@\17>\0172\17-\17%\17\36\17\22\17\v\17\372\16\363\16\0\0\0\0\0\0\0\20\0\0\321\215h^\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096, 8192) = 4096
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 open("/etc/hosts.allow", O_RDONLY) = 5
13250 fstat64(5, {st_mode=S_IFREG|0644, st_size=425, ...}) = 0
13250 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77a6000
13250 read(5, "sendmail: all\n# /etc/hosts.allow: list of hosts that are allowed to access the system.\n#                   See the manual pages hosts_access(5) and hosts_options(5).\n#\n# Example:    ALL: LOCAL @some_n"..., 4096) = 425
13250 close(5)                          = 0
13250 munmap(0xb77a6000, 4096)          = 0
13250 dup2(4, 1)                        = 1
13250 time(NULL)                        = 1425817211
13250 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=265, ...}) = 0
13250 time(NULL)                        = 1425817211
13250 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=265, ...}) = 0
13250 open("/proc/loadavg", O_RDONLY)   = 5
13250 fstat64(5, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
13250 read(5, "0.56 0.24 0.22 1/414 13250\n", 1024) = 27
13250 close(5)                          = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 getpeername(8, {sa_family=AF_INET, sin_port=htons(51828), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
13250 getsockname(8, {sa_family=AF_INET, sin_port=htons(25), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
13250 fcntl64(7, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(7, {st_mode=S_IFREG|0640, st_size=12288, ...}) = 0
13250 fcntl64(7, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
13250 fstat64(4, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
13250 fcntl64(8, F_GETFL)               = 0x2 (flags O_RDWR)
13250 fcntl64(8, F_SETFL, O_RDWR|O_NONBLOCK) = 0
13250 fstat64(8, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
13250 select(9, [8], NULL, NULL, {0, 0}) = 0 (Timeout)
13250 write(4, "220 hackathon ESMTP Sendmail 8.14.4/8.14.4/Debian-4.1ubuntu1; Sun, 8 Mar 2015 17:50:11 +0530; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]\r\n", 165) = 165
13250 read(8, 0x8bd35d8, 4096)          = -1 EAGAIN (Resource temporarily unavailable)
13250 gettimeofday({1425817211, 849076}, NULL) = 0
13250 select(9, [8], NULL, [8], {300, 0} <unfinished ...>
2558  <... select resumed> )            = 0 (Timeout)
2558  rt_sigprocmask(SIG_BLOCK, [ALRM], [], 8) = 0
2558  time(NULL)                        = 1425817216
2558  time(NULL)                        = 1425817216
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.60 0.26 0.23 1/414 13250\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817216
2558  time(NULL)                        = 1425817216
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.60 0.26 0.23 1/414 13250\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817216
2558  rt_sigprocmask(SIG_UNBLOCK, [ALRM], [ALRM], 8) = 0
2558  select(7, [4 5 6], NULL, NULL, {5, 0} <unfinished ...>
13250 <... select resumed> )            = 1 (in [8], left {292, 398402})
13250 gettimeofday({1425817219, 450896}, NULL) = 0
13250 read(8, "HELO server\r\n", 4096)  = 13
13250 fcntl64(4, F_GETFL)               = 0x802 (flags O_RDWR|O_NONBLOCK)
13250 fcntl64(4, F_SETFL, O_RDWR)       = 0
13250 fcntl64(8, F_GETFL)               = 0x2 (flags O_RDWR)
13250 fcntl64(8, F_SETFL, O_RDWR|O_NONBLOCK) = 0
13250 select(9, [8], NULL, NULL, {0, 0}) = 0 (Timeout)
13250 write(4, "250 hackathon Hello localhost [127.0.0.1], pleased to meet you\r\n", 64) = 64
13250 read(8, 0x8bd35d8, 4096)          = -1 EAGAIN (Resource temporarily unavailable)
13250 gettimeofday({1425817219, 451708}, NULL) = 0
13250 select(9, [8], NULL, [8], {300, 0} <unfinished ...>
2558  <... select resumed> )            = 0 (Timeout)
2558  rt_sigprocmask(SIG_BLOCK, [ALRM], [], 8) = 0
2558  time(NULL)                        = 1425817221
2558  time(NULL)                        = 1425817221
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.55 0.25 0.23 1/414 13250\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817221
2558  time(NULL)                        = 1425817221
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.55 0.25 0.23 1/414 13250\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817221
2558  rt_sigprocmask(SIG_UNBLOCK, [ALRM], [ALRM], 8) = 0
2558  select(7, [4 5 6], NULL, NULL, {5, 0}) = 0 (Timeout)
2558  rt_sigprocmask(SIG_BLOCK, [ALRM], [], 8) = 0
2558  time(NULL)                        = 1425817226
2558  time(NULL)                        = 1425817226
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.51 0.25 0.22 4/413 13250\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817226
2558  time(NULL)                        = 1425817226
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.51 0.25 0.22 4/413 13250\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817226
2558  rt_sigprocmask(SIG_UNBLOCK, [ALRM], [ALRM], 8) = 0
2558  select(7, [4 5 6], NULL, NULL, {5, 0}) = 0 (Timeout)
2558  rt_sigprocmask(SIG_BLOCK, [ALRM], [], 8) = 0
2558  time(NULL)                        = 1425817231
2558  time(NULL)                        = 1425817231
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.55 0.26 0.23 1/412 13251\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817231
2558  time(NULL)                        = 1425817231
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.55 0.26 0.23 1/412 13251\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817231
2558  rt_sigprocmask(SIG_UNBLOCK, [ALRM], [ALRM], 8) = 0
2558  select(7, [4 5 6], NULL, NULL, {5, 0}) = 0 (Timeout)
2558  rt_sigprocmask(SIG_BLOCK, [ALRM], [], 8) = 0
2558  time(NULL)                        = 1425817236
2558  time(NULL)                        = 1425817236
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.50 0.26 0.23 1/412 13251\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817236
2558  time(NULL)                        = 1425817236
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.50 0.26 0.23 1/412 13251\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817236
2558  rt_sigprocmask(SIG_UNBLOCK, [ALRM], [ALRM], 8) = 0
2558  select(7, [4 5 6], NULL, NULL, {5, 0}) = 0 (Timeout)
2558  rt_sigprocmask(SIG_BLOCK, [ALRM], [], 8) = 0
2558  time(NULL)                        = 1425817241
2558  time(NULL)                        = 1425817241
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.46 0.25 0.23 1/411 13251\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817241
2558  time(NULL)                        = 1425817241
2558  open("/proc/loadavg", O_RDONLY)   = 8
2558  fstat64(8, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
2558  read(8, "0.46 0.25 0.23 1/411 13251\n", 1024) = 27
2558  close(8)                          = 0
2558  time(NULL)                        = 1425817241
2558  rt_sigprocmask(SIG_UNBLOCK, [ALRM], [ALRM], 8) = 0
2558  select(7, [4 5 6], NULL, NULL, {5, 0} <unfinished ...>
13250 <... select resumed> )            = 1 (in [8], left {275, 280004})
13250 gettimeofday({1425817244, 171941}, NULL) = 0
13250 read(8, "MAIL from :localhostmailbox@gmail.com\r\n", 4096) = 39
13250 time(NULL)                        = 1425817244
13250 time(NULL)                        = 1425817244
13250 stat64("/etc/mail/service.switch", {st_mode=S_IFREG|0644, st_size=149, ...}) = 0
13250 lstat64("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13250 geteuid32()                       = 0
13250 lstat64("/etc", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
13250 geteuid32()                       = 0
13250 lstat64("/etc/mail", {st_mode=S_IFDIR|S_ISGID|0755, st_size=4096, ...}) = 0
13250 geteuid32()                       = 0
13250 open("/etc/mail/service.switch", O_RDONLY) = 5
13250 fstat64(5, {st_mode=S_IFREG|0644, st_size=149, ...}) = 0
13250 fcntl64(5, F_GETFL)               = 0 (flags O_RDONLY)
13250 fstat64(5, {st_mode=S_IFREG|0644, st_size=149, ...}) = 0
13250 read(5, "# /etc/mail/nsswitch.conf\n#\n# This is the format that sendmail expects (no colon after the service)\n# \npasswd\t\tfiles\nhosts\t\tfiles dns\naliases\t\tfiles\n", 4096) = 149
13250 read(5, "", 4096)                 = 0
13250 close(5)                          = 0
13250 open("/etc/hosts", O_RDONLY)      = 5
13250 fstat64(5, {st_mode=S_IFREG|0644, st_size=224, ...}) = 0
13250 read(5, "127.0.0.1\tlocalhost\n127.0.1.1\thackathon\n\n# The following lines are desirable for IPv6 capable hosts\n::1     ip6-localhost ip6-loopback\nfe00::0 ip6-localnet\nff00::0 ip6-mcastprefix\nff02::1 ip6-allnodes"..., 4096) = 224
13250 read(5, "", 4096)                 = 0
13250 close(5)                          = 0
13250 stat64("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=187, ...}) = 0
13250 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 5
13250 connect(5, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.1.1")}, 16) = 0
13250 gettimeofday({1425817244, 174299}, NULL) = 0
13250 poll([{fd=5, events=POLLOUT}], 1, 0) = 1 ([{fd=5, revents=POLLOUT}])
13250 send(5, "*\311\1\0\0\1\0\0\0\0\0\0\5gmail\3com\0\0\34\0\1", 27, MSG_NOSIGNAL) = 27
13250 poll([{fd=5, events=POLLIN}], 1, 5000) = 1 ([{fd=5, revents=POLLIN}])
13250 recvfrom(5, "*\311\201\200\0\1\0\1\0\4\0\4\5gmail\3com\0\0\34\0\1\300\f\0\34\0\1\0\0\0002\0\20$\4h\0@\2\10\2\0\0\0\0\0\0\20\25\300\f\0\2\0\1\0\0\17\0\0\r\3ns4\6google\300\22\300\f\0\2\0\1\0\0\17\0\0\6\3ns3\300G\300\f\0\2\0\1\0\0\17\0\0\6\3ns2\300G\300\f\0\2\0\1\0\0\17\0\0\6\3ns1\300G\300\200\0\1\0\1\0\0\2B\0\4\330\357 \n\300n\0\1\0\1\0\0\2B\0\4\330\357\"\n\300\\\0\1\0\1\0\0\2B\0\4\330\357$\n\300C\0\1\0\1\0\0\2B\0\4\330\357&\n", 8192, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.1.1")}, [16]) = 198
13250 close(5)                          = 0
13250 time(NULL)                        = 1425817244
13250 time(NULL)                        = 1425817244
13250 fcntl64(4, F_GETFL)               = 0x802 (flags O_RDWR|O_NONBLOCK)
13250 fcntl64(4, F_SETFL, O_RDWR)       = 0
13250 fcntl64(8, F_GETFL)               = 0x2 (flags O_RDWR)
13250 fcntl64(8, F_SETFL, O_RDWR|O_NONBLOCK) = 0
13250 select(9, [8], NULL, NULL, {0, 0}) = 0 (Timeout)
13250 write(4, "250 2.1.0 localhostmailbox@gmail.com... Sender ok\r\n", 51) = 51
13250 read(8, 0x8bd35d8, 4096)          = -1 EAGAIN (Resource temporarily unavailable)
Naveen
  • 7,944
  • 12
  • 78
  • 165
  • Have you checked the mail logs (e.g. `/var/log/mail.log`)? Sendmail accepts messages, but this does not mean that it actually delivers them to the mail server of hotmail.com. – VolenD Mar 07 '15 at 14:17
  • @user3584460 : Yes, I did `tail -f /var/log/mail.log` and I don't see any logs, neither before nor after sending the mail. – Naveen Mar 08 '15 at 10:52
  • Then I guess there might be something wrong with the `sendmail` configuration when it doesn't log anything. Anyway, you can still debug it by `telnet`-ing (just `telnet`; do not execute commands in it), then perform `strace -f -s 200 -o dump.txt -p {sendmail_pid_here}` and then continue with the `telnet` commands. You should get some meaningful output in `dump.txt`. For the record - I installed `sendmail` on `Ubuntu` and it works with the default config. Just there was problem with `/etc/hosts`, but it is probably issue with the [DO](https://www.digitalocean.com/) installation. – VolenD Mar 08 '15 at 11:15
  • @user3584460 : I did take dump of strace, but I am not able to understand it. Though, I can see "Resource not available" and "Connection Timeout with smtp.gmail.com" messages. A portion of dump is attached in the EDIT – Naveen Mar 08 '15 at 12:29
  • Everything looks fine with the `strace` dump. The problem is that it doesn't capture what happens after you queue the message. One potential problem I spotted though is the the line `127.0.1.1 hackathon` in `/etc/hosts`. Try changing it with `127.0.1.1 hackathon hackathon.localdomain` and see what happens. If you need more help, I think that it will be easier to debug this in chat session. – VolenD Mar 08 '15 at 13:57
  • @user3584460 : Still no success, please help in chat session if possible – Naveen Mar 08 '15 at 14:12
  • You can join: http://chat.stackoverflow.com/rooms/72510/room-for-insane-coder-and-user3584460 – VolenD Mar 08 '15 at 14:31

0 Answers0