[Mimedefang] Need help with filter
Hello list: I have the following code as part of my: sub filter_bad_filename ($) { #blah, blah... use Socket; sub relayIsTrusted($) { my ($address) = @_; syslog('warning', Address is $address); my %trustedSubnets = ( # Looopback '127.0.0.1' = '255.255.255.255', # Home Network '192.168.1.0' = '0.255.255.255', }; my $trustedRelay = 0; my $addr = inet_aton $address; while (my ($networkString, $netmaskString) = each %trustedSubnets) { my $network = inet_aton $networkString; my $netmask = inet_aton $netmaskString; #md_syslog(warning,Network is $network, netmask is $netmask, addr is $addr); if (($addr $netmask) eq $network) { $trustedRelay = 1; last; } } return $trustedRelay; } Now, I am getting the following error on my maillog: Dec 15 07:08:13 vw02 mimedefang-multiplexor: Slave 0 stderr: Use of uninitialized value in concatenation (.) or string at /etc/mail/mimedefang-filter-10025 line 107. Dec 15 07:08:13 vw02 mimedefang.pl[27338]: Address is Dec 15 07:08:13 vw02 mimedefang-multiplexor: Slave 0 stderr: Use of uninitialized value in subroutine entry at /etc/mail/mimedefang-filter-10025 line 163. Dec 15 07:08:13 vw02 mimedefang-multiplexor: Slave 0 stderr: Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Dec 15 07:08:13 vw02 mimedefang-multiplexor: Slave 0 stderr: Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () Dec 15 07:08:13 vw02 mimedefang-multiplexor: Slave 0 stderr: . Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and ( Could somebody point me to the problem with my code? Thanks in advance, Ronald Vazquez ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] Need help with filter
Ronald Vazquez NLM wrote: (B Hello list: (B (B I have the following code as part of my: (B...snip... (B (B (B my %trustedSubnets = ( (B ^^ (B# Looopback (B '127.0.0.1' = '255.255.255.255', (B (B # Home Network (B '192.168.1.0' = '0.255.255.255', (B}; (B^^^ - this should be ); (B (Balso I think you also want to replace the = with , above. (my code uses (Bcommas, i'm not sure if the = will work as well or not off the top of (Bmy head) (B (Beverything else looked ok to me. (B (Bhope this helps (B (Balan (B___ (BVisit http://www.mimedefang.org and http://www.canit.ca (BMIMEDefang mailing list ([EMAIL PROTECTED] (Bhttp://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] Need help with filter
Am Mi, den 15.12.2004 schrieb Ronald Vazquez NLM um 13:12: I have the following code as part of my: sub filter_bad_filename ($) { Following code really in this mimedefang-filter part? If yes, then wrong place. #blah, blah... use Socket; sub relayIsTrusted($) { my ($address) = @_; syslog('warning', Address is $address); my %trustedSubnets = ( # Looopback '127.0.0.1' = '255.255.255.255', Subnet mask 255.0.0.0 would be correct for loopback. # Home Network '192.168.1.0' = '0.255.255.255', You mean subnet mask 255.255.255.0. }; my $trustedRelay = 0; my $addr = inet_aton $address; while (my ($networkString, $netmaskString) = each %trustedSubnets) { my $network = inet_aton $networkString; my $netmask = inet_aton $netmaskString; #md_syslog(warning,Network is $network, netmask is $netmask, addr is $addr); if (($addr $netmask) eq $network) { $trustedRelay = 1; last; } } return $trustedRelay; } Now, I am getting the following error on my maillog: Dec 15 07:08:13 vw02 mimedefang-multiplexor: Slave 0 stderr: Use of uninitialized value in concatenation (.) or string at /etc/mail/mimedefang-filter-10025 line 107. Dec 15 07:08:13 vw02 mimedefang.pl[27338]: Address is Dec 15 07:08:13 vw02 mimedefang-multiplexor: Slave 0 stderr: Use of uninitialized value in subroutine entry at /etc/mail/mimedefang-filter-10025 line 163. Dec 15 07:08:13 vw02 mimedefang-multiplexor: Slave 0 stderr: Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Dec 15 07:08:13 vw02 mimedefang-multiplexor: Slave 0 stderr: Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () Dec 15 07:08:13 vw02 mimedefang-multiplexor: Slave 0 stderr: . Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and () at /etc/mail/mimedefang-filter-10025 line 167. Use of uninitialized value in bitwise and ( Could somebody point me to the problem with my code? Check the lines to be wrong: 107, 163, 167. Ronald Vazquez Alexander -- Alexander Dalloz | Enger, Germany | new address - new key: 0xB366A773 legal statement: http://www.uni-x.org/legal.html Fedora GNU/Linux Core 2 (Tettnang) on Athlon kernel 2.6.9-1.6_FC2smp Serendipity 13:49:14 up 5 days, 8:30, load average: 0.19, 0.22, 0.27 ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
Re: [Mimedefang] Need help with filter
All: Thank you for the replies. I just noticed that 98% of the time the filter works and returns an IP address, it logs Address is 64.236.24.20 for example. The times when it chokes is when $address comes up with no value, it logs Address is . Any ideas any one? Thanks, RV ___ Visit http://www.mimedefang.org and http://www.canit.ca MIMEDefang mailing list [EMAIL PROTECTED] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
RE: [Mimedefang] Need help with filter
alan premselaar wrote: (B Ronald Vazquez NLM wrote: (B '192.168.1.0' = '0.255.255.255', (B (B also I think you also want to replace the = with , above. (my code (B uses commas, i'm not sure if the = will work as well or not off the (B top of my head) (B (BThat's not necessary. From the perlop manpage: (B (Bquote (BThe = digraph is mostly just a synonym for the comma (Boperator. It's useful for documenting arguments that come (Bin pairs. As of release 5.001, it also forces any word to (Bthe left of it to be interpreted as a string. (B/quote (B___ (BVisit http://www.mimedefang.org and http://www.canit.ca (BMIMEDefang mailing list ([EMAIL PROTECTED] (Bhttp://lists.roaringpenguin.com/mailman/listinfo/mimedefang