Author Topic: I receive emails but cannot send them: authentication failed  (Read 1366 times)

Yves89000

  • Guest
I receive emails but cannot send them: authentication failed
« on: March 29, 2023, 11:59:18 AM »
hello 
 
Emails aren't really my thing to install on the server. :-\
 
My mail server is working. Squirremail works without problem (sending and receiving mail).
 
On the other hand for Roundcube the reception of emails works, but not the sending.
 
I keep getting errors smtp() error: Authentication failed.
 
When I send emails with squirremail, it happens:
 
Code: [Select]
Tue 29 12:33:11 ns1 postfix/smtpd[275763]: connect from localhost[127.0.0.1]
     Tue 29 12:33:11 ns1 postfix/smtpd[275763]: B00FC4201ED: client=localhost[127.0.0.1]
     Tue 29 12:33:11 ns1 postfix/cleanup[275789]: B00FC4201ED: message-id=<582140372b86e0c69804b8a783d4141f.squirrel@mail.domain.net>
     Tue 29 12:33:11 ns1 opendkim[224681]: B00FC4201ED: DKIM-Signature field added (s=mail, d=domaine.net)
     Tue 29 12:33:11 ns1 postfix/smtpd[275763]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
     Tue 29 12:33:11 ns1 postfix/qmgr[224663]: B00FC4201ED: from=<contact@domain.net>, size=778, nrcpt=1 (queue active)
     Tue 29 12:33:11 ns1 dovecot: imap-login: Login: user=<contact@domain.net>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=275791, secured, session= <4/W7gAf4WNt/AAAB>
     Tue 29 12:33:11 ns1 dovecot: imap(contact@domaine.net)<275791><4/W7gAf4WNt/AAAB>: Logged out in=633 out=661 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes =0 body_count=0 body_bytes=0
     Tue 29 12:33:11 ns1 dovecot: imap-login: Login: user=<contact@domain.net>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=275792, secured, session= <wbC8gAf4Wtt/AAAB>
     Tue 29 12:33:11 ns1 dovecot: imap(contact@domaine.net)<275792><wbC8gAf4Wtt/AAAB>: Logged out in=294 out=2268 deleted=0 expunged=0 trashed=0 hdr_count=1 hdr_bytes=209 body_count=0 body_bytes=0
     Tue 29 12:33:12 ns1 postfix/smtpd[275795]: connect from localhost[127.0.0.1]
     Tue 29 12:33:12 ns1 postfix/smtpd[275795]: 322174201EE: client=localhost[127.0.0.1]
     Tue 29 12:33:12 ns1 postfix/cleanup[275789]: 322174201EE: message-id=<582140372b86e0c69804b8a783d4141f.squirrel@mail.domain.net>
     Tue 29 12:33:12 ns1 opendkim[224681]: 322174201EE: DKIM-Signature field added (s=mail, d=domain.net)
     Tue 29 12:33:12 ns1 postfix/smtpd[275795]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
     Tue 29 12:33:12 ns1 postfix/qmgr[224663]: 322174201EE: from=<contact@domain.net>, size=1773, nrcpt=1 (queue active)
     Tue 29 12:33:12 ns1 amavis[203853]: (203853-09) Passed CLEAN {RelayedOpenRelay}, [127.0.0.1]:38476 [XXX.XXX.XXXX] <contact@domaine.net> -> <tantang77@ gmail.com>, Queue-ID: B00FC4201ED, Message-ID: <582140372b86e0c69804b8a783d4141f.squirrel@mail.domain.net>, mail_id: pPTjM3D2F4XR, Hits: -0.798, size: 1283, queued_as: 322174201EE, 4777 ms
     Tue 29 12:33:12 ns1 postfix/smtp[275790]: B00FC4201ED: to=<XXXX@gmail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.59, delays=0.11/0.01/ 0/0.48, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 322174201EE)
     Tue 29 12:33:12 ns1 postfix/qmgr[224663]: B00FC4201ED: removed
     Tue 29 12:33:12 ns1 postfix/smtp[275796]: Untrusted TLS connection established to gmail-smtp-in.l.google.com[108.177.15.27]:25: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits ) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256
     Tue 29 12:33:12 ns1 postfix/smtp[275796]: 322174201EE: to=<XXXX@gmail.com>, relay=gmail-smtp-in.l.google.com[108.177.15.27]:25, delay= 0.45, delays=0.1 / 0.01 / 0.07 / 0.27, dsn = 2.0.0, status = sent
     Tue 29 12:33:12 ns1 postfix/qmgr[224663]: 322174201EE: removed

 

On the other hand if I send with roundcube it does not pass:
Code: [Select]
     Tue 29 12:34:27 ns1 postfix/submission/smtpd[275802]: connect from localhost[127.0.0.1]
     Tue 29 12:34:27 ns1 postfix/submission/smtpd[275802]: disconnect from localhost[127.0.0.1] ehlo=1 quit=1 commands

I don't have any other logs showing up.


Do you have an idea ?
 
     Here is my Roundcube config:
Code: [Select]
     // IMAP host chosen to perform the log-in.
     // See defaults.inc.php for the option description.
     $config['imap_host'] = 'localhost:143';
     // SMTP server host (for sending mails).
     // See defaults.inc.php for the option description.
     $config['smtp_host'] = 'localhost:25';
     $config['smtp_auth_type'] = 'PLAIN';

I use the version 1.6.1

squirremail seems well configured on localhost:25 (checked via /usr/share/squirrelmail/configure)
 

If someone could help me that would be great :) :)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,850
Re: I receive emails but cannot send them: authentication failed
« Reply #1 on: March 29, 2023, 12:09:43 PM »
"Authentication failed." is a clear message so check the smtp auth settings. The defaults are:
Code: [Select]
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';
If you would like to disable smtp auth then set the options to empty strings.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: I receive emails but cannot send them: authentication failed
« Reply #2 on: March 29, 2023, 12:53:05 PM »
 $config['smtp_host'] = 'tls://localhost:25';

also, usually submission port is 587, not 25.