Sending mail through SMTP server via Gmail

Alright, so I've come here as a last resort hoping to find that last bit of help I need to solve this. I've spent the last two days scouring for answers without actually getting anything direct. First off, I'm an amateur at best, and this is all new territory for me when trying to understand these things. I'll try my best to describe my issue.

On my current virtual server, I'm using Centos 7 with virtualmin installed. I've set up the email accounts just fine, and they work well. (I can login using roundcube to send and receive mail just fine as well).

As a convenience to the people who would be using those email accounts, I was trying to do a "send mail as:" through gmail so that they could reply to email coming it as those addresses (as opposed to their own personal gmail).

I keep getting the "domain name not found" error when using smtp.domain.com. I've double checked to make sure I have the correct username and password (which I do), and tried a couple things to see if anything has worked. Here's what I've done so far, and the fields Gmail is asking for.

SMTP Server: SMTP.domain.com

Username: _________

Password: __________

Port: 25, 465, 587 (as expected)

Secured connection using SSL

Secured connection using TLS

I tried the following ...

  • uncommented appropriate lines in the master.cf file
  • restarted servers after editing (of course)
  • using the login information with port 465 using SSL and mail.domain.com and it gave me a "too slow to respond" error, so that was different
  • I also tried creating a sub-domain mail.EXAMPLE.com

Anyway, that's what I have so far. It feels like I'm just missing something small in order to get it to work.

Any help would be much appreciated. Thanks!

Files: 
Status: 
Active

Comments

Howdy -- when accessing "SMTP.domain.com", if you're receiving an error that it isn't found, that may indicate a DNS issue. That name may not be setup in your DNS, whether on the Virtualmin server itself, or at a third party, depending on where the DNS is hosted.

That might be a good place to start. Or, alternatively -- just to get things going -- rather than configuring SMTP.domain.com to work, try configuring your client to use just domain.com and see if that works properly for you, and then work from there.

It looks like you're using Virtualmin GPL there though. The area here is actually for folks using Virtualmin Pro, or those are purchased a Support Incident.

If you have any followup questions, and are interested in free support and community help, we'd encourage you to post your question the the Forums. We monitor the Forums, along with lots of wonderful folks in the community!

Or, if you wanted, you could always purchase a Support Incident using the "Buy" link above, and then we could work with you here to sort out the issue you're experiencing.

fadsel's picture
Submitted by fadsel on Wed, 05/04/2016 - 02:23

Thank you for the reply , I have fixed the DNS issue , I tried what you suggested and now i am having new errors,

I tried using secured connection on port 587 using TLS

Authentication failed. Please check your username/password.
[Server response: Unspecified Error (SENT_EHLO): Unable to send AUTH command over non ssl connection code(0) ]


I can assure , the username and the password are correct,

Before I was getting this

Authentication failed. Please check your username/password.
[Server response: DNS Error: 69745740 DNS type 'aaaa' lookup of smtp.domain.com responded with code NXDOMAIN 69745740 DNS type 'a' lookup of smtp.domain.com responded with code NXDOMAIN code(0) ]

I will also post this on the forums

Glad you were able to correct the DNS issue! We'll look forward to your Forum post and follow up with you there.

Escovan.net's picture
Submitted by Escovan.net on Fri, 05/06/2016 - 23:30

If you wish to send mail with your server address but from the comfort of GMail, you should go to "Settings" in Gmail, click Accounts, select "Add another mail address I own" - Enter your server's email address you wish to use from GMail, send the confirmation code to your server inbox, open your mail on your server and copy the verification code to GMail. You can now send mail from GMail that will say it's from your server. However, as to hide your own GMail address this wont entirely work. In the mail headers your original GMail account and sender's IP are still shown. The thing with bi-directional gmail access to your mailserver is that you need to tell your own server that each account you wish to use with GMail, should be forwarded to gmail.

I personally use only GoogleApps for E-mail, and disable the mail on my Virtualmin domains. I set the GoogleApps MX servers in the DNS. Google's MXs are way more reliable and spam filtering is superior. - When I got Google Apps it still was free and in beta, so maybe this is not an option for you.

fadsel's picture
Submitted by fadsel on Mon, 05/23/2016 - 03:48

Unfortunately we cannot do that since we dont have Google Apps , Thank you for your reply though

See ... We are shifting from Cpanel , where we had an option for "Setup Mail Client" which gives you all the configuration & details about SMTP , IMAP , POP3, Your account and the credentials you will need for every mail clients i.e gMail , Yahoo e.t.c. everything out of the box.

On the otherhand ,Virtualmin is great ... everything is working fine except the email part

We can login using roundcube to send and receive mail. So Postfix is working fine.

We are still researching ... We also tried posting this on the forums , no luck yet :(

It seems that we are not searching the right terms.

fadsel's picture
Submitted by fadsel on Mon, 07/04/2016 - 08:05

@andreychek

We tried alot of ways , We want to buy support for this incident.

Do you accept paypal? There is only credit card at the end of the form :(

And just to make it clear we only need to send emails using other mail clients i.e gmail or outlook , we are currently able to do this via roundcube locally , for example https://youtu.be/af3X0PKZvio?t=153 , this video shows how to use cPanel to achieve this.

We don't want to send mails from our domain using our gmail account by hard coding our gmail email and password inside a text file as many tutorials out there are doing this , "Relaying Gmail" is the keyword we used to search this and ended up with people writting their password and email in a text file.

We tried asking on the forums also

One Last thing , By 1 incident what do you mean? After purchasing this , the incident ends after we can send mail from 3rd party Mail client other than roundcube? Or every issue arised untill we can send mail.

Regards

Thanks for your inquiry!

Today is a holiday, but we'll respond to your questions soon, probably sometime on Tuesday.

Okay, I see that you have a Forum post about this... I responded there in the hopes that maybe there's a simple way to get this working without needing to charge anything.

But yes, one incident would mean that we have one issue or problem that we're working to fix... if you had a second problem you wanted to go over, it would require a second support ticket for that. We can take Paypal, that's no problem.

We can go that route if you like, though it sounds like it's just a matter of figuring out why Gmail can't seem to communicate with your email server, which may be a simple fix. I'll keep an eye on your Forum post and we'll see what we can determine there.