I'm using a perl module (Mail::Sendmail) which uses sendmail to send stuff. It hasn't been working, but hasn't been giving me any errors.

So now I suspect sendmail. I tried:

telnet 25
mail from:[email protected]
rcpt to:[email protected]
 subject: subject line


I get the "mail accepted for delivery" message, which is what should happen. I wait around for a couple minutes and nothing in my inbox. So I take a look at /var/log/maillog.3 and it doesn't have anything pertaining to what I just did.

I tried sending mail locally to another user by doing mail [email protected] and that worked. But still nothing in the logs (which makes me believe the real logs are somewhere else).

Summing up:

  • Can't send mail to the cloud, but it works locally
  • Unknown location of sendmail log file
  • 1
    Mail::Sendmail uses SMTP to send mail. sendmail is just one of many possible SMTP servers (although it might be the one you have installed).
    – cjm
    Aug 12, 2011 at 23:56

2 Answers 2


Honestly, this sounds like a sendmail.cf problem, as if it's not configured for non-local email, or it's misconfigured.

The file /var/log/maillog.3 is almost certainly an "old" log file, and therefore, nothing new will get written to it. You didn't mention what Linux distro, BSD or Unix you're using, but the current log file, the one sendmail currently appends to, is probably named /var/log/maillog If /var/log/maillog doesn't exist, you could try stopping and starting sendmail, and seeing if a /var/log/maillog or other file gets created.

Debugging: The old telnet localhost 25 trick is very useful, as you've found, but you can use something like the old BSD Mail program's "-v" option. Try http://heirloom.sourceforge.net/mailx.html for source. Using that, you get to see what the SMTP conversation looks like, which can help.

If you're really desperate, you can run sendmail in a debugging mode:

sendmail -bt -C /whatever/sendmail.cf

You can type in email addresses and see what sendmail does with them.

  • I do have a /var/log/maillog file but it's empty. It's accompanied by maillog.1, maillog.2 and maillog.3. I'll give the debug mode a try next week at work and report back.
    – nopcorn
    Aug 12, 2011 at 22:39

By any chance, are you using another MTA (such as exim4)?
Take a look at /var/log/exim4/*, that might just be it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .