tracing stuck local to local mails in macOS

I'm sending myself a mail like this:

AdministorsMBP2:~ administrator$ mail -s "subject here" [email protected] <<< "message"
AdministorsMBP2:~ administrator$ echo $?
0

The command returns zero, meaning success. mailq command says empty. my gmail inbox is empty too.

so what happened? did the mail go through , if not how I trace this.

mail command borrowed from: https://stackoverflow.com/a/13447901


I know you want to use the command line, but use the GUI to add one mail account in Apple mail so you can view the sending mail server status. This completes the setup and saves your sending credentials so mail can use them to log in and send the mail.

Send one mail using the official mail app, then try again from the command line.

If you still get errors from the command line, use the connection doctor to check the results of the sending mail server status. All green lights indicate success - show the logs if you have red or orange lights on the status.

Here are relevant threads if you want to do things the harder, longer way. The first has great test commands and the second sidesteps the native system and installs new versions of mail/sendmail.

  • How to send an email from command line?
  • How to send email from OS X command line

The second link installs a complete sendmail package and avoids using the one that comes with the system, thus avoiding it altogether.