Link to home
Start Free TrialLog in
Avatar of Jasmin shahrzad
Jasmin shahrzad

asked on

gmail setup

i install nextcloud (16.03) on ubuntu. i try to setup mail function as:
send mode :smtp
 encryption :STARTTLS
serveradress: smtp.gmail.com port:587
(attach file)
i have error: A problem occurred while sending the email. Please revise your settings. (Error: Expected response code 250 but got code "530", with message "530-5.5.1 Authentication Required. Learn more at
 530 5.5.1 https://support.google.com/mail/?p=WantAuthError m11sm3234263lfk.56 - gsmtp
 ")

Any idea?
i set less security app on google account
mail.png
Avatar of ZeropointNRG
ZeropointNRG
Flag of Australia image

Going to assume you put your credentials in since you're using TLS 587?

Are you sure the ports not blocked?

Have you set your gmail account up? Pop/IMAP?

Do you have 2A enabled for your gmail account?

Is this corporate or personal?
Hi,

I haven't tried NextCloud myself yet - on my list of things to play with, but I wonder if you need to set an App Password for it in Gmail:

Help Page:  https://support.google.com/mail/answer/185833?hl=en

Your Page:  https://myaccount.google.com/apppasswords


Good luck!

Alan.
Yup, that's where I was headed. But we need to know if he's using 2A or not.
Avatar of Jasmin shahrzad
Jasmin shahrzad

ASKER

thanks i forgot to open a port in firewall. Then error message is  now:
A problem occurred while sending the email. Please revise your settings. (Error: Expected response code 250 but got code "530", with message "530-5.5.1 Authentication Required. Learn more at
 530 5.5.1 https://support.google.com/mail/?p=WantAuthError x21sm3158460ljj.57 - gsmtp
 ")
Yes i write credential and password .
we are using 2A security
and it's imap
1) This only works if you have a paid GSuite account.

2) You must provide your user/pass provided by GSuite for your login.

Then Authentication Required means the user/pass is missing or incorrect.
If you don't have a paid GSuite account, switch over to using MailGun, as first 10K messages every month are free.
Okay, so you have 2A, you need to setup AppPasswords.

Once signed in, choose App Passwords. At the bottom, choose Select app and choose the app you’re using. Then choose Select device and choose the device you’re using. Select Generate.
Follow the instructions to enter the App Password.
Select Done.

Use this password in your credentials.

And check if your imap settings are correct HERE.
Need to unpack.

What are you trying to do as the end goal.

It seems you are trying to relay through google's mail servers which the error clearly states:

got code "530", with message "530-5.5.1 Authentication Required. Learn more at
 530 5.5.1 https://support.google.com/mail/?p=WantAuthError x21sm3158460ljj.57 - gsmtp
 ")

The others built on the different steps you have to go through to get the connection authorized before your systems starts submitting outgoing messages  to gmail's servers for relay.
oh i can't send mail from server. i create gmail on ubuntu and var/log/mail says no .db file.
it means postfix can't create sasl_passwd.db file.
i do not have user postmap then i gave 777 to sasl_passwd  but still is not allow to create .db file
Are you sure you're using the app password, rather than the login password?
@ZeropointNRG
Thank you
i used that doc to create gmail on ubuntu. i just forgot last command postmap ....
it's working to send mail from server. but i still hasve same problem  
A problem occurred while sending the email. Please revise your settings. (Error: Expected response code 250 but got code "530", with message "530-5.5.1 Authentication Required. Learn more at
 530 5.5.1 https://support.google.com/mail/?p=WantAuthError q25sm3842813ljg.30 - gsmtp
 ")
dosen't matter i use g-suite or simple g-account same problem and error code. i select on for less secure apps too.  but the same problem.
IN your relayhost, smarthost you point to gmail mail server without the credentials such that it tries to relay through without authenticating.

There is a format username:password@mail.gmail.com:587
For the relayhost, smarthost, transport when set correctly, the postfix client initiating outgoing connection to the destination will authenticate first.
587 is a open STARTSSL port, 465 if memory serves is the SSL port.
Tip: First start by testing using SWAKS as this will verify all your settings are correct.

If your settings are incorrect, your relaying will fail forever.

Example SWAKS test command...

swaks -s mail.gmail.com:587 -tls -auth -au $user -ap $pass --from=$from --to=$to

Open in new window


Once this works, you know 100% you're using the correct credentials + Google accepts submission of your mail.

If this fails, you'll open a support ticket with Google.
ASKER CERTIFIED SOLUTION
Avatar of ZeropointNRG
ZeropointNRG
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't no what happen. But it's working now i can send an email from nextcloud.
At times, patience is rewarded. It may have kept using the old setting if not stopped/restarted or the postmap run clicked and reset......

great to hear.
Glad to hear it!