Roundcube Community Forum

 

How can I use gmail.com as SMTP server?

Started by Plenz, June 28, 2022, 05:58:10 AM

Previous topic - Next topic

Plenz

I have a web server for my website mydomain.de and for my e-mail address [email protected]. How can I send outgoing e-mails by using smtp.gmail.com? I tried already, but the authentification failed.
As login, I have to set my complete gmail address: $config['smtp_user'] = '[email protected]' - is there a backslash before @ necessary or not?
Must I install the plugin bartnv/twofactor_webauthn which is actually intended for FIDO? Or any other plugin?

Plenz

OK, I figured it out so far: I generated a special password and now I am able to send e-mails. But the e-mails have my gmail address as sender instead of the address which I am really using:

----- E-Mail Header ----------------------------------------------------
Return-path: <[email protected]>
Received: from mail by mail.lenz-online.de with spam-scanned (Exim 4.92)
   (envelope-from <[email protected]>)
   id 1o6DXj-000C3x-86
   for [email protected]; Tue, 28 Jun 2022 17:54:23 +0200
Received: from mail-ed1-f41.google.com ([209.85.208.41])
   by mail.mydomain.de with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128)
   (Exim 4.92)
   (envelope-from <[email protected]>)
   id 1o6DXj-000C3s-5w
   for [email protected]; Tue, 28 Jun 2022 17:54:23 +0200
From: My Name <[email protected]>
X-Google-Original-From: My Name <[email protected]>

----- my RoundCube config -------------------------------------------------
$config['smtp_server'] = 'ssl://smtp.gmail.com&#39;;
$rcmail_config['mail_domain'] = 'mydomain.de';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'abcdefghijklmnop';

Is there a way how to set "[email protected]" as sender?

JohnDoh

Please look at gmail documentation, google rewrote the heade,rs I'd guess as part of their anti-spam measures.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...