006-add_ip-header.patch 548 B

123456789101112131415161718192021
  1. --- a/ssmtp.c
  2. +++ b/ssmtp.c
  3. @@ -1338,6 +1338,7 @@ ssmtp() -- send the message (exactly one
  4. int ssmtp(char *argv[])
  5. {
  6. char b[(BUF_SZ + 2)], *buf = b+1, *p, *q;
  7. + char *remote_addr;
  8. #ifdef MD5AUTH
  9. char challenge[(BUF_SZ + 1)];
  10. #endif
  11. @@ -1541,6 +1542,10 @@ int ssmtp(char *argv[])
  12. outbytes += smtp_write(sock, "From: %s", from);
  13. }
  14. + if(remote_addr=getenv("REMOTE_ADDR")) {
  15. + outbytes += smtp_write(sock, "X-Originating-IP: %s", remote_addr);
  16. + }
  17. +
  18. if(have_date == False) {
  19. outbytes += smtp_write(sock, "Date: %s", arpadate);
  20. }