1

I got a dead simple script for testing sending email from my local machine:

#!/usr/bin/env perl
print "Sending email to $ARGV[0]\n";
my $result = system qq(echo "Hello World" | mail -s "Test email" $ARGV[0]);
print $result . "\n";

It works when I send to one particular email address but not to another and I can't figure out why. I get no error from the mail command in the script and it return "0" as expected. What I've done:

  1. I checked /var/log/mail.log of the receiving machine and there is no trace of the email getting received.

  2. I checked my /var/mail/me file on my local machine and it hasn't bounced.

  3. I searched all the files in /var/log on my local machine and there's no trace of it there, either.

  4. I checked that the local machine resolves to the correct IP of the email address I'm trying to send to.

Not sure where else to look on my local machine to figure out what happened to it. I'd like to search the outgoing mail logs but I don't know where they are. Any ideas?

1 Answer 1

1

OK, this command sends postfix output to terminal:

log stream --predicate '(process == "smtpd") || (process == "smtp")' --info

Good enough and I have more clues as to what's happening. Seems the email is getting relayed through another server. So something has to happening there.

1
  • 1
    Root problem was that sometime during the Dark Ages, I set up a relay_host in /etc/postfix/main.cf.
    – StevieD
    Sep 1, 2021 at 6:13

You must log in to answer this question.

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