fmbiete / Z-Push-contrib

Z-Push fork with changes that I will try to contrib
GNU Affero General Public License v3.0
134 stars 61 forks source link

config for h2o webserver #263

Open basbebe opened 8 years ago

basbebe commented 8 years ago

for anyone who's interested, these are settings that seem to work for the h2o web server (I'm running it on FreeBSD with PHP-FPM on demand):

# vi: ft=yaml
# see https://h2o.examp1e.net/ for detailed documentation
# see h2o --help for command-line options and settings
user: www
pid-file: /var/run/h2o.pid
access-log: /var/log/h2o/h2o-access.log
error-log: /var/log/h2o/h2o-error.log

expires: 1 day
file.dirlisting: off
file.send-gzip: on
gzip: ON

#header.add: "x-frame-options: deny"
#header.add: "X-Content-Type-Options: nosniff"
#header.add: "strict-transport-security: max-age=15768000; includesubdomains; preload"
#header.add: "X-Xss-Protection: 1; mode=block"

listen:
    host: 127.0.0.1
    port: 80

listen:
    host: 127.0.0.1
    port: 443
    ssl:
        minimum-version: TLSv1.2
        # generate your own certificates
        certificate-file: /usr/local/etc/h2o/server.crt
        key-file: /usr/local/etc/h2o/server.key

# per-host configuration

file.custom-handler:
    extension: .php
    fastcgi.connect:
        port: /var/run/php-fpm.sock
        type: unix
    fastcgi.send-delegated-uri: OFF
    fastcgi.timeout.io: 630000
    fastcgi.timeout.keepalive: 630000

file.index: [ 'index.php' ]

hosts:
    example.com:
        paths:
            "/":
                file.dir: "/usr/local/www/push"
                redirect:
                  url: /index.php/
                  internal: YES
                  status: 307
            "/Microsoft-Server-ActiveSync":
                redirect:
                  url: /index.php/
                  internal: YES
                  status: 307
basbebe commented 8 years ago

I have to correct myself – sending emails doesn't seem to work (it worked with nginx, nothing else changed).

I get:

29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->Logon(): User 'mail@example.com' is authenticated on '{10.0.0.3:143/imap/tls/novalidate-cert}'
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] ZPush::CommandNeedsPlainInput(1): false
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] StringStreamWrapper::Open(): len = 0
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] StringStreamWrapper::Open(): Using php://temp
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] StringStreamWrapper::Open(): len = 0
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] StringStreamWrapper::Open(): Using php://temp
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->SendMail(): RFC822: 1 bytes  forward-id: 'false' reply-id: 'false' parent-id: 'false' SaveInSent: 'true' ReplaceMIME: 'false'
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->SendMail(): We get the new message
29/02/2016 13:10:45 [56919] [ WARN] [mail@example.com] /usr/local/www/push/include/mimeDecode.php:512 Uninitialized string offset: 0 (8)
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->SendMail(): We get the From and To
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->getIdentityFromSql() - Connected to SQL Database
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->getIdentityFromSql() - Searching From with filter: select user, name from mailbox where username = 'mail@example.com'
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->getIdentityFromSql() - No entry found in SQL Database
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->getFromHeaderValue(): No From address defined, we try for a default one
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->setReturnPathValue(): No Return-Path address defined, we use From
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->SendMail(): is a new message or we are replacing mime
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->SendMail(): Copying new headers
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->SendMail(): Final mail to send:
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] BackendIMAP->sendMessage(): SendingMail with smtp
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 220 mail.example.com ESMTP Postfix (FreeBSD)
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Send: EHLO push.example.com

29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-mail.example.com
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-PIPELINING
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-SIZE 104857600
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-ETRN
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-STARTTLS
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-ENHANCEDSTATUSCODES
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-8BITMIME
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-DSN
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250 SMTPUTF8
29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Send: STARTTLS

29/02/2016 13:10:45 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 220 2.0.0 Ready to start TLS
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Send: EHLO push.example.com

29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-mail.example.com
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-PIPELINING
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-SIZE 104857600
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-ETRN
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-AUTH PLAIN LOGIN
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-ENHANCEDSTATUSCODES
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-8BITMIME
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250-DSN
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250 SMTPUTF8
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Send: AUTH LOGIN

29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 334 XXXXXXXX
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Send: YYYYYYYYYYYYYY=

29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 334 XXXXXXXX
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Send: YYYYYYYYYYYYY

29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 235 2.7.0 Authentication successful
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Send: MAIL FROM:<mail@example.com>

29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250 2.1.0 Ok
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Send: DATA

29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 554 5.5.1 Error: no valid recipients
29/02/2016 13:10:46 [56919] [ERROR] [mail@example.com] Net_SMTP error: Invalid response code received from server

==> /var/log/z-push/z-push-error.log <==
29/02/2016 13:10:46 [56919] [ERROR] [mail@example.com] Net_SMTP error: Invalid response code received from server

==> /var/log/z-push/z-push.log <==
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Send: RSET

29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 250 2.0.0 Ok
29/02/2016 13:10:46 [56919] [ERROR] [mail@example.com] Mail<smtp> error: Failed to send data [SMTP:  (code: 554, response: 5.5.1 Error: no valid recipients)]

==> /var/log/z-push/z-push-error.log <==
29/02/2016 13:10:46 [56919] [ERROR] [mail@example.com] Mail<smtp> error: Failed to send data [SMTP:  (code: 554, response: 5.5.1 Error: no valid recipients)]

==> /var/log/z-push/z-push.log <==
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] BackendIMAP->sendMessage(): send return value
29/02/2016 13:10:46 [56919] [ INFO] [mail@example.com] StatusException: BackendIMAP->sendMessage(): The email could not be sent - code: 120 - file: /usr/local/www/push/backend/imap/imap.php:2498
29/02/2016 13:10:46 [56919] [ WARN] [mail@example.com] HTTPReturnCodeException: BackendIMAP->sendMessage(): The email could not be sent - code: 500 - file: /usr/local/www/push/lib/request/sendmail.php:132
29/02/2016 13:10:46 [56919] [ INFO] [mail@example.com] User-agent: 'Apple-iPhone8C1/1304.20'
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Flushing 0, headers already sent? no
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] BackendIMAP->close_connection(): disconnected from IMAP server
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] LoopDetection->ProcessLoopDetectionTerminate()
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Memory usage information: 2224312/2621440 - Execution time: 1.4760 - HTTP responde code: 500
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] -------- End
29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Send: QUIT

29/02/2016 13:10:46 [56919] [DEBUG] [mail@example.com] Net_SMTP DEBUG: Recv: 221 2.0.0 Bye

It works again when I switch back to nginx…

basbebe commented 7 years ago

Anyone using H2O successfully?