I think haproxy can only do header manipulation with HTTP.  In other words,
rspadd will not work with mode tcp.

You should be able to have your PHP scrip add the custom header.


Postfix can handle a lot of outgoing mail.  If you don't mind me asking, I'm
just curious how much mail are you sending out that you need to route it
through a load balancer?  Or is it more for redundancy of a multi-server to
redundant mail gateway?





> -----Original Message-----
> From: boris17...@gmail.com [mailto:boris17...@gmail.com]
> Sent: Wednesday, December 02, 2009 11:33 PM
> To: haproxy@formilux.org
> Subject: Load balancing PostFix Mail Out
> 
> I'm currently trying to load balance balance Mailout from postfix MTA.
> It work nice, but I have some "question" (maybe feature).
> I want to add a "custom header" (this one is just after a test) but
> rspadd seem to work only on http.
>       rspadd          X-HAProxyRocks:\ Yes\0
> 
> Our mail sender is a php script. I tryed to use (maybe it's a script
> problem) HAProxy directly from the PHPScripts (using fgets for sending
> emails) but it doesn't work (script not seem to like "haproxy as a
> SMTP").
> 
> Now my "solution" is to set :
> php script => Postfix localhost:25 => Haproxy localhost:10025 => a lot
> of postfix.
> 
> Maybe I've done some bad stuff somewhere.
> I just upgraded (not tested yet) to 1.3.22 because I see a changelog
> with "fgets" ("haproxy fgets" on google).
> 
> I think my php script wait for a "normal" smtp response, but HAproxy is
> waiting to have the response from postfix "backend" server.
> 
> My configuration file is "quite normal":
> ===
> frontend LB
>          mode tcp
>          bind 127.0.0.1:10025
>          default_backend PostFix
> backend PostFix
>          mode tcp
>          contimeout      3000
>          srvtimeout      3000
>          option          redispatch
>          retries         5
>          balance         roundrobin
>          option          smtpchk EHLO hi
>          rspadd          X-HAProxyRocks:\ Yes\0
>          server          ara01   87.98.142.XX:25        weight  30
> check   inter 200000
>          server          ara02   94.23.155.XX:25        weight  30
> check   inter 200000
>          server          ara03   91.121.218.XX:25        weight  30
>   check   inter 200000
> ===
> For now it work "nice" with a Postfix frontend with haproxy as relay
> host. Maybe I can "simple" it.
> 
> Sorry for my "crappy" english, teachers fault ;)
> 
> Kind regards, a HAProxy lover.
> 
> Other Question: I want a HAProxy logo, there is some "official" logos ?
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.426 / Virus Database: 270.14.86/2533 - Release Date:
> 12/02/09 19:43:00


Reply via email to