Please tell me how and how to send Gmail from the mac command line.

Asked 2 years ago, Updated 2 years ago, 122 views

I would like to be able to do the following from the mac command line.
·Send mail from your gmail address to another gmail address

I started postfix and tried sending mail from the command line with the following command, but it didn't work.
date | mail-test [email protected]

The following logs appear in /var/log/mail.log:
Apr 27 11:56:27 xxxx-xx-MacBook-Air postfix/error[15630]: XXXXXXXXXX: to=, relay=none, delay=68742, delays=68739/3.5/0/0, dsn=4.7.8, status=deferred (delivery temporarily suspended: SASL authentication failed; server smtp.gmail.com[74.125.203.109] said: 535-5.7.8 Username and Password not accepted. Learn more at?535 5.7.8 https://support.google.com/mail/answer/14257

I have confirmed that it is written below.
https://support.google.com/mail/answer/14257

I added the postfix to the file below.
* Added file
/private/etc/postfix/main.cf

*Additional content
# Posifix Configuratoins
relayhost=smtp.gmail.com:587

# SASL Authentication
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/etc/postfix/gmail_passwd
smtp_sasl_security_options=noanonymous
smtp_sasl_tls_security_options=noanonymous
smtp_sasl_mechanism_filter=plain

# TLS Settings
smtp_use_tls=yes
smtp_tls_security_level=encrypt
tls_random_source=dev:/dev/urandom

# tls setting
smtp_use_tls=yes

Thank you for your cooperation

macos postfix sendmail

2022-09-30 18:19

2 Answers

As the URL suggested in the error message says, if the ID and password are correct,

  • (If you do not enable two-step authentication) Not "Allow access to insecure apps"
  • (if you have two-step authentication enabled) You are not using the app password or you are using it incorrectly

I think it's stuck in


2022-09-30 18:19

Gmail recently introduced a top(?) SSL certificate called OAuth, and
There are problems and responses in many places.

Isn't Soko related?

I'm sorry if I missed the point.


2022-09-30 18:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.