sendmail not working - any alternatives?


J

John

My web site provider has trouble getting sendmail to work.

This is a trimmed down versio on a perl file that used to work just fine for
years and then it quit working. I've contacted them to no avail:


#!/usr/bin/perl
print "Content-Type: text/html; charset=iso-8859-1\n\n";
print '<html><head>';
print '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">';
print '</head><body>';
$i=0;
&testmail;
print "Testing email $i <br>(1=success, 0=fail)<br>";
print "</body></HTML>";

sub testmail
{
#open(MAIL,"|/usr/sbin/sendmail -t") || return 0;
open(MAIL,"|/usr/lib/sendmail -t") || return 0;
#open(MAIL,"|/usr/bin/sendmail -t") || return 0;
select (MAIL);
print "To: blahblah\@whatever.com\n";
print "From: blahblah\@whatever.com\n";
print "Subject: testing\n";
print "\n";
print "This is message.\n";
close(MAIL);
select (STDOUT);
$i=1;
}

The code returns:

"Testing email 1
(1=success, 0=fail)"

but no email ever gets to the receiver (yes, I tried with actual working
addresses).

It works just fine on another domain host provider but I need to get it to work
on this particular.

What alternatives can I try?
 
Ad

Advertisements

M

Michael Vilain

John said:
My web site provider has trouble getting sendmail to work.

This is a trimmed down versio on a perl file that used to work just fine for
years and then it quit working. I've contacted them to no avail:


#!/usr/bin/perl
print "Content-Type: text/html; charset=iso-8859-1\n\n";
print '<html><head>';
print '<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">';
print '</head><body>';
$i=0;
&testmail;
print "Testing email $i <br>(1=success, 0=fail)<br>";
print "</body></HTML>";

sub testmail
{
#open(MAIL,"|/usr/sbin/sendmail -t") || return 0;
open(MAIL,"|/usr/lib/sendmail -t") || return 0;
#open(MAIL,"|/usr/bin/sendmail -t") || return 0;
select (MAIL);
print "To: blahblah\@whatever.com\n";
print "From: blahblah\@whatever.com\n";
print "Subject: testing\n";
print "\n";
print "This is message.\n";
close(MAIL);
select (STDOUT);
$i=1;
}

The code returns:

"Testing email 1
(1=success, 0=fail)"

but no email ever gets to the receiver (yes, I tried with actual working
addresses).

It works just fine on another domain host provider but I need to get it to
work
on this particular.

What alternatives can I try?

Look in the log files for mail on your web site provider. See if mail is
actually being sent out by the perl script. If it is, then the perl
works. What's happening once it leaves the machine is anyone's
guess--spam filter or blocker or maybe someone doesn't like you.
 
J

John

Michael Vilain said:
Look in the log files for mail on your web site provider. See if mail is
actually being sent out by the perl script. If it is, then the perl
works. What's happening once it leaves the machine is anyone's
guess--spam filter or blocker or maybe someone doesn't like you.


I can't find any log files using FileZilla.
 
R

Rainer Weikusat

John said:
My web site provider has trouble getting sendmail to work.

This is a trimmed down versio on a perl file that used to work just fine for
years and then it quit working. I've contacted them to no avail:
[...]

open(MAIL,"|/usr/lib/sendmail -t") || return 0;

[...]

If you can create files on this machine, you could make that something
like

open(MAIL, '| /usr/sbin/sendmail -tv >/tmp/sendmail 2>&1')

This will put a trace of any SMP-conversation into /tmp/sendmail which
might help with debugging this.
 
M

Michael Vilain

John said:
I can't find any log files using FileZilla.

The mail transfer agent is most likely a service that's managed by the
web hosting company. You'll have to contact them for a copy, if they'll
even provide it at all.

If you're using a shared hosting facility, I'd look at moving your
hosting to a VM instead. You'll have to manage everything, but you'll
have more control over such things as email and the web server for your
site. Your call on if it's worthwhile.
 
J

John

Rainer Weikusat said:
John said:
My web site provider has trouble getting sendmail to work.

This is a trimmed down versio on a perl file that used to work just fine for
years and then it quit working. I've contacted them to no avail:
[...]

open(MAIL,"|/usr/lib/sendmail -t") || return 0;

[...]

If you can create files on this machine, you could make that something
like

open(MAIL, '| /usr/sbin/sendmail -tv >/tmp/sendmail 2>&1')

This will put a trace of any SMP-conversation into /tmp/sendmail which
might help with debugging this.


I looked up the man page fro meaning on -tv but could not find explanation. What
does -tv >/tmp/sendmail 2>&1

I tried it and got no log file. I also tried
$i3=open(MAIL,"|/usr/sbin/sendmail -tv >test.txt") || return 0;

where $i3 gets a number but no test.txt is created.
 
Ad

Advertisements

M

Michael Vilain

John said:
Rainer Weikusat said:
John said:
My web site provider has trouble getting sendmail to work.

This is a trimmed down versio on a perl file that used to work just fine
for
years and then it quit working. I've contacted them to no avail:
[...]

open(MAIL,"|/usr/lib/sendmail -t") || return 0;

[...]

If you can create files on this machine, you could make that something
like

open(MAIL, '| /usr/sbin/sendmail -tv >/tmp/sendmail 2>&1')

This will put a trace of any SMP-conversation into /tmp/sendmail which
might help with debugging this.


I looked up the man page fro meaning on -tv but could not find explanation.
What
does -tv >/tmp/sendmail 2>&1

I tried it and got no log file. I also tried
$i3=open(MAIL,"|/usr/sbin/sendmail -tv >test.txt") || return 0;

where $i3 gets a number but no test.txt is created.

http://www.sendmail.org/~ca/email/doc8.12/op-sh-3.html#sh-3

will show you that true sendmail run with -tv will run it in test mode
with VERBOSE logging out put to a file. Are you sure your web host is
even running sendmail and not postfix or some other mail transfer agent?
Just because the program is there doesn't mean it's setup. Does ps show
it running?
 
R

Rainer Weikusat

John said:
Rainer Weikusat said:
John said:
My web site provider has trouble getting sendmail to work.

This is a trimmed down versio on a perl file that used to work just fine for
years and then it quit working. I've contacted them to no avail:
[...]

open(MAIL,"|/usr/lib/sendmail -t") || return 0;

[...]

If you can create files on this machine, you could make that something
like

open(MAIL, '| /usr/sbin/sendmail -tv >/tmp/sendmail 2>&1')

This will put a trace of any SMP-conversation into /tmp/sendmail which
might help with debugging this.


I looked up the man page fro meaning on -tv but could not find explanation. What
does -tv >/tmp/sendmail 2>&1

That's really the same as -t -v.
I tried it and got no log file. I also tried
$i3=open(MAIL,"|/usr/sbin/sendmail -tv >test.txt") || return 0;

where $i3 gets a number but no test.txt is created.

Judgeing from your original posting, the sendmail binary you were
invoking resided in /usr/lib and not /usr/sbin. 'No test.txt is created'
suggests that your perl process is not allowed to create files in the
directory in question. The return value of the open just tells you if
forking a new process succeeded (it will then be the process ID of this
process). Problems encountered by the shell while trying to execute the
actual command _may_ manifest themselves in form of a non-zero $? after
the handle has been closed.
 
J

John

I got a log from TEST.TXT is below. Everything seems ok but no email ever get to
any recipients (with valid email addresses not (e-mail address removed) )

(e-mail address removed)... Connecting to [127.0.0.1] via relay...
220 weblah.blah.net ESMTP Sendmail 8.13.8/8.13.8; Tue, 15 Oct 2013 10:27:06 +0200250-weblah.blah.net Hello localhost.blah.net [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP250 2.0.0 r9F8R6bG272952 Message accepted for delivery
(e-mail address removed)... Sent (r9F8R6bG272952 Message accepted for delivery)
Closing connection to [127.0.0.1]221 2.0.0 weblah.blah.net closing connection
 
Ad

Advertisements

B

Ben Bacarisse

John said:
I got a log from TEST.TXT is below. Everything seems ok but no email
ever get to any recipients (with valid email addresses not
(e-mail address removed) )

Yes, the log looks fine, but there are countless reasons why the mail
does not get delivered once it's been accepted. Unless you have access
to the mail system's log files, you probably can't do much more than
keep complaining to the hosting company. In the end, you may well have
to switch.

<snip log>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top