~singpolyma/cheogram-smtp

3464bcaa8680d0122af20073fbc0072841d8edbd — Stephen Paul Weber 3 years ago 3531a4e
Always use line buffering, even when redirected to file

Makes logging work better :)
1 files changed, 5 insertions(+), 0 deletions(-)

M gateway.hs
M gateway.hs => gateway.hs +5 -0
@@ 2,6 2,8 @@ module Main (main) where

import Prelude ()
import BasicPrelude
import System.IO
	(stdout, stderr, hSetBuffering, BufferMode(LineBuffering))
import Control.Concurrent              (threadDelay)
import Control.Error                   (exceptT)
import Network                         (PortID (PortNumber))


@@ 98,6 100,9 @@ messageErrorHandler replyMap message = do

main :: IO ()
main = do
	hSetBuffering stdout LineBuffering
	hSetBuffering stderr LineBuffering

	(componentJidTxt:host:portTxt:secret:trustedJidsTxt) <- getArgs
	let Right (MIME.Mailbox _ (MIME.AddrSpec _ emailDomain)) =
		MIME.parse (MIME.mailbox MIME.defaultCharsets)