Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 127.0.0.1 25
mail from:root@localhost.com
rcpt to:max@f33r.com
data
 subject: subject line
 sgiopjsdoigjsd
 sdgsdg

 sdgfsdg
 .
quit

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 user@localhost.localdomain 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
share|improve this question
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 '11 at 23:56

2 Answers 2

up vote 4 down vote accepted

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.

share|improve this answer
    
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. –  MaxMackie Aug 12 '11 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.