16 Feb 2009 17:54
patch msmtp to add custom header
Matus UHLAR - fantomas <uhlar <at> fantomas.sk>
2009-02-16 16:54:18 GMT
2009-02-16 16:54:18 GMT
Hello, I would like to use msmtp as sendmail for CGI/PHP scripts. For CGI scripts I would like to push extra header line to SMTP server which would append UID of process that executed msmtp to mail headers (e.g. "X-Sending-UID: %d"), to make searching for broken scripts in case of spam outbreak easier (we use suexec, so each user's scripts are executed under their UID). PHP has such functionality (if patched with the mail header patch) but CGI is something different :) Can anyone help me with this? I looked at the source code and I see that msmtp_read_addresses() under some circumstances writes mail headers tmpfile that contains headers AND the final newline, so msmtp_sendmail() that does the main work does something different when tmpfile exists. Any idea how to patch msmtp as clean as possible? Thank you. -- -- Matus UHLAR - fantomas, uhlar <at> fantomas.sk ; http://www.fantomas.sk/ Warning: I wish NOT to receive e-mail advertising to this address. Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu. Linux is like a teepee: no Windows, no Gates and an apache inside... ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise(Continue reading)
RSS Feed