Options to not include X-Mailer and X-Originating-IP headers
authorJamie Cameron <jcameron@webmin.com>
Fri, 20 Feb 2009 00:39:41 +0000 (00:39 +0000)
committerJamie Cameron <jcameron@webmin.com>
Fri, 20 Feb 2009 00:39:41 +0000 (00:39 +0000)
mailboxes/CHANGELOG
mailboxes/config
mailboxes/config.info
mailboxes/send_mail.cgi

index d95a32d..486a30e 100644 (file)
@@ -56,3 +56,5 @@ Added support for Exim, thanks to Emmanuel Florac.
 Re-wrote the entire user interface to use the new Webmin UI library, and to bring it into sync with the Usermin module for reading mail.
 ---- Changes since 1.440 ----
 HTML messages now have a converted plain-text attachment automatically added, for mail clients that only support text.
+---- Changes since 1.450 ----
+Added Module Config options to not include the X-Mailer and X-Originating-IP headers in sent mail.
index b5b172e..8759f6c 100644 (file)
@@ -48,3 +48,5 @@ arrows=1
 open_mode=0
 show_unread=0
 maildir_deleted=0
+no_orig_ip=0
+no_mailer=0
index 848b02a..014a3ab 100644 (file)
@@ -50,6 +50,8 @@ from_addr=From: address to use when sending email manually,3,From mailbox userna
 webmin_from=From: address to use when Webmin sends email,3,Default (webmin@<i>yourhost</i>)
 from_virtualmin=Get From: address from Virtualmin?,1,1-Yes,0-No
 from_dom=Domain to use in From: address,3,System hostname
+no_orig_ip=Include browser IP in X-Originating-IP header?,1,0-Yes,1-No
+no_mailer=Include Webmin version in X-Mailer header?,1,0-Yes,1-No
 
 line1=System configuration,11
 mail_system=Mail server installed,4,1-Sendmail,0-Postfix,2-Qmail,4-Qmail+LDAP,5-Qmail+VPopMail,6-Exim,3-Detect automatically
index 8d47f57..b08540a 100755 (executable)
@@ -52,9 +52,15 @@ $mail->{'headers'} = [ [ 'From', $in{'from'} ],
                       [ 'To', &encode_mimewords($in{'to'}) ],
                       [ 'Cc', &encode_mimewords($in{'cc'}) ],
                       [ 'Bcc', &encode_mimewords($in{'bcc'}) ],
-                      [ 'X-Originating-IP', $ENV{'REMOTE_ADDR'} ],
-                      [ 'X-Mailer', "Webmin ".&get_webmin_version() ],
                       [ 'Message-Id', $newmid ] ];
+if (!$config{'no_orig_ip'}) {
+       push(@{$mail->{'headers'}},
+            [ 'X-Originating-IP', $ENV{'REMOTE_ADDR'} ]);
+       }
+if (!$config{'no_mailer'}) {
+       push(@{$mail->{'headers'}},
+            [ 'X-Mailer', "Webmin ".&get_webmin_version() ]);
+       }
 push(@{$mail->{'headers'}}, [ 'X-Priority', $in{'pri'} ]) if ($in{'pri'});
 $in{'body'} =~ s/\r//g;
 if ($in{'body'} =~ /\S/) {