haraka / Haraka

A fast, highly extensible, and event driven SMTP server
https://haraka.github.io
MIT License
5.08k stars 661 forks source link

smtp_forward to gmail is failing #1095

Closed proj59598 closed 9 years ago

proj59598 commented 9 years ago

I am using Haraka as an inbound server . I am trying to forward all inbound emails to my personal gmail account.

my smtp_forward.ini file is

; host to connect to host=smtp.gmail.com ; ; port to connect to port=587 ; ; timeout backend connection from pool ;timeout=300 ; ; max connections in pool ;max_connections=1000 ; ; uncomment to enable TLS to the backend SMTP server enable_tls=true ; ; for messages that have multiple RCPT, send a separate message for each RCPT ; when forwarding. ;one_message_per_rcpt=true ; ; uncomment to use smtp client authorization ;[auth] type=PLAIN user=myemail@gmail.com pass=xxxxxx

It's failing with the below log entries -

[PROTOCOL] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [queue/smtp_forward] S: 530-5.5.1 Authentication Required. Learn more at\r\n [PROTOCOL] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [queue/smtp_forward] S: 530 5.5.1 https://support.google.com/mail/answer/14257 q190sm7332235ywf.52 - gsmtp\r\n [INFO] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [core] hook=queue plugin=queue/smtp_forward function=hook_queue params="" retval=DENY msg="5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 q190sm7332235ywf.52 - gsmtp (944EDB20-1387-4BA0-A046-3232CE7013B5.1)" [DEBUG] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [core] running deny hooks [NOTICE] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [core] queue code=DENY msg="5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 q190sm7332235ywf.52 - gsmtp (944EDB20-1387-4BA0-A046-3232CE7013B5.1)" [PROTOCOL] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [core] S: 552 5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 q190sm7332235ywf.52 - gsmtp (944EDB20-1387-4BA0-A046-3232CE7013B5.1)

baudehlo commented 9 years ago

You need to uncomment the [auth] bit as well.

On Fri, Jul 24, 2015 at 1:22 AM, proj59598 notifications@github.com wrote:

I am using Haraka as an inbound server . I am trying to forward all inbound emails to my personal gmail account.

my smtp_forward.ini file is

; host to connect to host=smtp.gmail.com ; ; port to connect to port=587 ; ; timeout backend connection from pool ;timeout=300 ; ; max connections in pool ;max_connections=1000 ; ; uncomment to enable TLS to the backend SMTP server enable_tls=true ; ; for messages that have multiple RCPT, send a separate message for each RCPT ; when forwarding. ;one_message_per_rcpt=true ; ; uncomment to use smtp client authorization ;[auth] type=PLAIN user=myemail@gmail.com pass=xxxxxx

It's failing with the below log entries -

[PROTOCOL] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [queue/smtp_forward] S: 530-5.5.1 Authentication Required. Learn more at\r\n [PROTOCOL] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [queue/smtp_forward] S: 530 5.5.1 https://support.google.com/mail/answer/14257 q190sm7332235ywf.52 - gsmtp\r\n [INFO] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [core] hook=queue plugin=queue/smtp_forward function=hook_queue params="" retval=DENY msg="5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 q190sm7332235ywf.52 - gsmtp (944EDB20-1387-4BA0-A046-3232CE7013B5.1)" [DEBUG] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [core] running deny hooks [NOTICE] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [core] queue code=DENY msg="5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 q190sm7332235ywf.52 - gsmtp (944EDB20-1387-4BA0-A046-3232CE7013B5.1)" [PROTOCOL] [944EDB20-1387-4BA0-A046-3232CE7013B5.1] [core] S: 552 5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 q190sm7332235ywf.52 - gsmtp (944EDB20-1387-4BA0-A046-3232CE7013B5.1)

— Reply to this email directly or view it on GitHub https://github.com/baudehlo/Haraka/issues/1095.

proj59598 commented 9 years ago

I uncommented but Its still failing with below config and the logs

; host to connect to host=smtp.gmail.com ; ; port to connect to port=587 ; ; timeout backend connection from pool ;timeout=300 ; ; max connections in pool ;max_connections=1000 ; ; uncomment to enable TLS to the backend SMTP server enable_tls=true ; ; for messages that have multiple RCPT, send a separate message for each RCPT ; when forwarding. ;one_message_per_rcpt=true ; ; uncomment to use smtp client authorization [auth] type=PLAIN user=myemail@gmail.com pass=xxxxxxx

[PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] C: EHLO xxxxxxxx [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] S: 250-smtp.gmail.com at your service, [xxxxxxxxx]\r\n [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] S: 250-SIZE 35882577\r\n [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] S: 250-8BITMIME\r\n [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] S: 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN XOAUTH\r\n [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] S: 250-ENHANCEDSTATUSCODES\r\n [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] S: 250-PIPELINING\r\n [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] S: 250-CHUNKING\r\n [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] S: 250 SMTPUTF8\r\n [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] C: MAIL FROM:anotherMineEmail@gmail.com [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] S: 530-5.5.1 Authentication Required. Learn more at\r\n [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [queue/smtp_forward] S: 530 5.5.1 https://support.google.com/mail/answer/14257 u138sm10561227ywf.18 - gsmtp\r\n [INFO] [6575849D-AE94-421D-926D-C7B57000B849.1] [core] hook=queue plugin=queue/smtp_forward function=hook_queue params="" retval=DENY msg="5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 u138sm10561227ywf.18 - gsmtp (6575849D-AE94-421D-926D-C7B57000B849.1)" [DEBUG] [6575849D-AE94-421D-926D-C7B57000B849.1] [core] running deny hooks [NOTICE] [6575849D-AE94-421D-926D-C7B57000B849.1] [core] queue code=DENY msg="5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 u138sm10561227ywf.18 - gsmtp (6575849D-AE94-421D-926D-C7B57000B849.1)" [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [core] S: 552 5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 u138sm10561227ywf.18 - gsmtp (6575849D-AE94-421D-926D-C7B57000B849.1) [DEBUG] [6575849D-AE94-421D-926D-C7B57000B849.1] [core] running reset_transaction hooks [DEBUG] [-] [core] [smtp_client_pool] A3D71EE6-5D2F-4D42-8A96-5DE0719331E2 resetting, state=2 [DEBUG] [-] [core] [smtp_client_pool] A3D71EE6-5D2F-4D42-8A96-5DE0719331E2 releasing, state=3 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] timeout: 1437797131168 [INFO] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] dispense() clients=0 available=1 [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [core] C: QUIT state=1 [DEBUG] [6575849D-AE94-421D-926D-C7B57000B849.1] [core] running quit hooks [PROTOCOL] [6575849D-AE94-421D-926D-C7B57000B849.1] [core] S: 221 xxxxxx closing connection. Have a jolly good day. [DEBUG] [6575849D-AE94-421D-926D-C7B57000B849.1] [core] running disconnect hooks [NOTICE] [6575849D-AE94-421D-926D-C7B57000B849.1] [core] disconnect ip=209.85.216.41 rdns="mail-vn0-f41.google.com" helo="mail-vn0-f41.google.com" relay=N early=N esmtp=Y tls=Y pipe=Y txns=1 rcpts=1/0/0 msgs=0/0/1 bytes=63968 lr="552 5.5.1 Authentication Required. Learn more at 5.5.1 https://support.google.com/mail/answer/14257 u138sm10561227ywf.18 - gsmtp (6575849D-AE94-421D-926D-C7B57000B849.1)" time=0.825 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 [DEBUG] [-] [core] [smtp_client_pool] [587:smtp.gmail.com:300] availableObjects.length=1 ^C[NOTICE] [-] [core] SIGINT received [NOTICE] [-] [core] Shutting down

msimerson commented 9 years ago

Hrmmm, you know what I don't see there? Gmail offering STARTTLS. Try turning off tls and see what happens.

proj59598 commented 9 years ago

didn't help it just gave this message [PROTOCOL] [D0F73D58-45DA-438A-852F-E74DE5C25662.1] [queue/smtp_forward] S: 530 5.7.0 Must issue a STARTTLS command first. d6sm10643748ywc.15 - gsmtp\r\n

am i understanding your smtp_forward functionality right , i can forward any email to Haraka inbound server to my personal email address ?

msimerson commented 9 years ago

Hmm, maybe you truncated the log messages then, as apparently the STARTTLS worked.

am i understanding your smtp_forward functionality right , i can forward any email to Haraka inbound server to my personal email address

Yes, that's the general idea. What version of Haraka are you using? It appears you're using a newer version of Haraka with an older config file. See the smtp_forward.ini here in the GitHub repo for the correct syntax:

;
; uncomment to use smtp client authorization
;auth_type=plain
;auth_user=
;auth_pass=
proj59598 commented 9 years ago

you were right i am using 2.6.1. I used the correct smtp_forward settings but i had to enable a setting in my gmail account - "Allow access by insecure apps"

i forwarded a mail from yahoo to Haraka , where forwarding is set to gmail.

looks like auth is successful but its still failing with below

[PROTOCOL] [5F57764E-A531-4F3B-BE0D-AF78E2D8DD47.1] [queue/smtp_forward] S: 354 Go ahead u78sm10746758ywu.13 - gsmtp\r\n [PROTOCOL] [5F57764E-A531-4F3B-BE0D-AF78E2D8DD47.1] [queue/smtp_forward] S: 554-5.6.0 Message exceeded 50 hops, this may indicate a mail loop. Learn more at\r\n [PROTOCOL] [5F57764E-A531-4F3B-BE0D-AF78E2D8DD47.1] [queue/smtp_forward] S: 554 5.6.0 https://support.google.com/mail/answer/6598 u78sm10746758ywu.13 - gsmtp\r\n [INFO] [5F57764E-A531-4F3B-BE0D-AF78E2D8DD47.1] [core] hook=queue plugin=queue/smtp_forward function=hook_queue params="" retval=DENY msg="5.6.0 Message exceeded 50 hops, this may indicate a mail loop. Learn more at 5.6.0 https://support.google.com/mail/answer/6598 u78sm10746758ywu.13 - gsmtp (5F57764E-A531-4F3B-BE0D-AF78E2D8DD47.1)" [DEBUG] [5F57764E-A531-4F3B-BE0D-AF78E2D8DD47.1] [core] running deny hooks [NOTICE] [5F57764E-A531-4F3B-BE0D-AF78E2D8DD47.1] [core] queue code=DENY msg="5.6.0 Message exceeded 50 hops, this may indicate a mail loop. Learn more at 5.6.0 https://support.google.com/mail/answer/6598 u78sm10746758ywu.13 - gsmtp (5F57764E-A531-4F3B-BE0D-AF78E2D8DD47.1)" [PROTOCOL] [5F57764E-A531-4F3B-BE0D-AF78E2D8DD47.1] [core] S: 552 5.6.0 Message exceeded 50 hops, this may indicate a mail loop. Learn more at 5.6.0 https://support.google.com/mail/answer/6598 u78sm10746758ywu.13 - gsmtp (5F57764E-A531-4F3B-BE0D-AF78E2D8DD47.1)

deburau commented 9 years ago

When I started using Haraka and deliver incoming mail to gmail I couldn't get it working using smtp. So finally I started using imap for delivery and this works very well.

I can not give you the details now because I'm abroad for the next two weeks.

Matt Simerson notifications@github.com schrieb am Sa., 25. Juli 2015 10:26:

Hmm, maybe you truncated the log messages then, as apparently the STARTTLS worked.

am i understanding your smtp_forward functionality right , i can forward any email to Haraka inbound server to my personal email address

Yes, that's the general idea. What version of Haraka are you using? It appears you're using a newer version of Haraka with an older config file. See the smtp_forward.ini here in the GitHub repo for the correct syntax:

; ; uncomment to use smtp client authorization ;auth_type=plain ;auth_user= ;auth_pass=

— Reply to this email directly or view it on GitHub https://github.com/baudehlo/Haraka/issues/1095#issuecomment-124800273.