| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| On a Fedora 8 system, I have sendmail set up with smarthost and masquerading. I also have a LOCAL_NET_CONFIG rule to send local lan mail (by machine name: dale@machine1) directly via smtp: LOCAL_NET_CONFIG # This rule ensures that all local mail is delivered using the # smtp transport, everything else will go via the smart host. R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 I'd like to also send via IP address in my lan: 192.168.7.0/24. for example to dale@[192.168.7.51]. Unfortunately, sendmail tries to send such addresses to the smarthost. I have not been able to write a successful rule like the one above for local mail. For example (I wrapped it at the first tab) R$* < @ [ $* . $* . $* . $* ] > $* $#smtp $@ [$1.$2.$3.$4] $: $1 < @ [ $2 . $3 . $4 . $5 ] > $6 That doesn't work. It still tries to send the mail to the smarthost. Is it possible to write a rule for IP addresses? Or is there some other way to do this? -- Dale Dellutri <ddelQQQlutr@panQQQix.com> (lose the Q's) |
|
#2
| |||
| |||
| On Fri, 5 Sep 2008 17:38:13 +0000 (UTC), Dale Dellutri <ddelQQQlutr@panqqqix.com> wrote: > On a Fedora 8 system, I have sendmail set up with smarthost > and masquerading. I also have a LOCAL_NET_CONFIG rule > to send local lan mail (by machine name: dale@machine1) > directly via smtp: > LOCAL_NET_CONFIG > # This rule ensures that all local mail is delivered using the > # smtp transport, everything else will go via the smart host. > R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 > I'd like to also send via IP address in my lan: 192.168.7.0/24. > for example to dale@[192.168.7.51]. Unfortunately, sendmail > tries to send such addresses to the smarthost. > I have not been able to write a successful rule like the one > above for local mail. For example (I wrapped it at the first tab) > R$* < @ [ $* . $* . $* . $* ] > $* > $#smtp $@ [$1.$2.$3.$4] $: $1 < @ [ $2 . $3 . $4 . $5 ] > $6 Sorry: that should read: R$* < @ [ $* . $* . $* . $* ] > $* $#smtp $@ [$2.$3.$4.$5] $: $1 < @ [ $2 . $3 . $4 . $5 ] > $6 > That doesn't work. It still tries to send the mail to the > smarthost. > Is it possible to write a rule for IP addresses? Or is there > some other way to do this? -- Dale Dellutri <ddelQQQlutr@panQQQix.com> (lose the Q's) |
|
#3
| |||
| |||
| Dale Dellutri wrote: > On Fri, 5 Sep 2008 17:38:13 +0000 (UTC), Dale Dellutri <ddelQQQlutr@panqqqix.com> wrote: >> On a Fedora 8 system, I have sendmail set up with smarthost >> and masquerading. I also have a LOCAL_NET_CONFIG rule >> to send local lan mail (by machine name: dale@machine1) >> directly via smtp: > >> LOCAL_NET_CONFIG >> # This rule ensures that all local mail is delivered using the >> # smtp transport, everything else will go via the smart host. >> R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 > Stolen (:-) from the README file where this is used as an example how to send messages for the local domain directly with smtp while the rest of the mail will be delivered through an uucp smarthost. >> I'd like to also send via IP address in my lan: 192.168.7.0/24. >> for example to dale@[192.168.7.51]. Unfortunately, sendmail >> tries to send such addresses to the smarthost. > >> I have not been able to write a successful rule like the one >> above for local mail. For example (I wrapped it at the first tab) > >> R$* < @ [ $* . $* . $* . $* ] > $* >> $#smtp $@ [$1.$2.$3.$4] $: $1 < @ [ $2 . $3 . $4 . $5 ] > $6 > > Sorry: that should read: > R$* < @ [ $* . $* . $* . $* ] > $* > $#smtp $@ [$2.$3.$4.$5] $: $1 < @ [ $2 . $3 . $4 . $5 ] > $6 > >> That doesn't work. It still tries to send the mail to the >> smarthost. > >> Is it possible to write a rule for IP addresses? Or is there >> some other way to do this? > Have a look at the files in the .../cf/m4 directory to understand what is happening. I don't have a Fedora 8 system at hand, but I guess it's the /usr/share/sendmail-cf/m4/ directory there. I'll quote some code from a Slackware 12.1 Linux system with sendmail 8.14.2. The code on your system might be slightly different. Let's first find out what it means when you put your rules under `LOCAL_NET_CONFIG'. A grep for this term shows: $ grep LOCAL_NET_CONFIG * cfhead.m4:define(`LOCAL_NET_CONFIG', `define(`_LOCAL_RULES_', 1)divert(1)') So `LOCAL_NET_CONFIG' is a macro that expands to defining `_LOCAL_RULES_' and putting `divert(1)' in the code. Looking for `_LOCAL_RULES_' and/or `undivert(1)' in proto.m4 will show the place where your rules will be inserted. That's done near the end of rule set `Parse1' with the code: ifdef(`_LOCAL_RULES_', `# figure out what should stay in our local mail system undivert(1)', `dnl') Way before this, almost at the start of rule set `Parse1', you'll find the code that handles numeric addresses: ifdef(`_MAILER_smtp_', `# handle numeric address spec dnl there is no check whether this is really an IP number R$* < @ [ $+ ] > $* $: $>ParseLocal $1 < @ [ $2 ] > $3 numeric internet spec R$* < @ [ $+ ] > $* $: $1 < @ [ $2 ] : $S > $3 Add smart host to path R$* < @ [ $+ ] : > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 no smarthost: send R$* < @ [ $+ ] : $- : $*> $* $#$3 $@ $4 $: $1 < @ [$2] > $5 smarthost with mailer R$* < @ [ $+ ] : $+ > $* $#_SMTP_ $@ $3 $: $1 < @ [$2] > $4 smarthost without mailer', `dnl') If a smarthost is defined then the message will be sent to the smarthost (and you _do_ have a smarthost defined), otherwise directly to the numerical address. Your rules defined under `LOCAL_NET_CONFIG' will never be reached when numerical addresses in square brackets are used. If you put your rules in rule set `ParseLocal' things should work like you want them to work. Use `LOCAL_RULE_0' instead of `LOCAL_NET_CONFIG' to do so. Regards, Kees. -- Kees Theunissen. |
|
#4
| |||
| |||
| On Sat, 06 Sep 2008 02:10:51 +0200, Kees Theunissen <theuniss@rijnh.nl> wrote: > Dale Dellutri wrote: > > On Fri, 5 Sep 2008 17:38:13 +0000 (UTC), Dale Dellutri <ddelQQQlutr@panqqqix.com> wrote: > >> On a Fedora 8 system, I have sendmail set up with smarthost > >> and masquerading. I also have a LOCAL_NET_CONFIG rule > >> to send local lan mail (by machine name: dale@machine1) > >> directly via smtp: > > > >> LOCAL_NET_CONFIG > >> # This rule ensures that all local mail is delivered using the > >> # smtp transport, everything else will go via the smart host. > >> R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 > > > Stolen (:-) from the README file where this is used as an example > how to send messages for the local domain directly with smtp > while the rest of the mail will be delivered through an uucp > smarthost. > >> I'd like to also send via IP address in my lan: 192.168.7.0/24. > >> for example to dale@[192.168.7.51]. Unfortunately, sendmail > >> tries to send such addresses to the smarthost. > > > >> I have not been able to write a successful rule like the one > >> above for local mail. For example (I wrapped it at the first tab) > > > >> R$* < @ [ $* . $* . $* . $* ] > $* > >> $#smtp $@ [$1.$2.$3.$4] $: $1 < @ [ $2 . $3 . $4 . $5 ] > $6 > > > > Sorry: that should read: > > R$* < @ [ $* . $* . $* . $* ] > $* > > $#smtp $@ [$2.$3.$4.$5] $: $1 < @ [ $2 . $3 . $4 . $5 ] > $6 > > > >> That doesn't work. It still tries to send the mail to the > >> smarthost. > > > >> Is it possible to write a rule for IP addresses? Or is there > >> some other way to do this? > > > Have a look at the files in the .../cf/m4 directory to understand > what is happening. I don't have a Fedora 8 system at hand, but I > guess it's the /usr/share/sendmail-cf/m4/ directory there. > I'll quote some code from a Slackware 12.1 Linux system with > sendmail 8.14.2. The code on your system might be slightly different. > Let's first find out what it means when you put your rules > under `LOCAL_NET_CONFIG'. A grep for this term shows: > $ grep LOCAL_NET_CONFIG * > cfhead.m4:define(`LOCAL_NET_CONFIG', `define(`_LOCAL_RULES_', 1)divert(1)') > So `LOCAL_NET_CONFIG' is a macro that expands to defining > `_LOCAL_RULES_' and putting `divert(1)' in the code. > Looking for `_LOCAL_RULES_' and/or `undivert(1)' in proto.m4 > will show the place where your rules will be inserted. > That's done near the end of rule set `Parse1' with the code: > ifdef(`_LOCAL_RULES_', > `# figure out what should stay in our local mail system > undivert(1)', `dnl') > Way before this, almost at the start of rule set `Parse1', > you'll find the code that handles numeric addresses: > ifdef(`_MAILER_smtp_', > `# handle numeric address spec > dnl there is no check whether this is really an IP number > R$* < @ [ $+ ] > $* $: $>ParseLocal $1 < @ [ $2 ] > $3 numeric internet spec > R$* < @ [ $+ ] > $* $: $1 < @ [ $2 ] : $S > $3 Add smart host to path > R$* < @ [ $+ ] : > $* $#_SMTP_ $@ [$2] $: $1 < @ [$2] > $3 no smarthost: > send > R$* < @ [ $+ ] : $- : $*> $* $#$3 $@ $4 $: $1 < @ [$2] > $5 smarthost > with mailer > R$* < @ [ $+ ] : $+ > $* $#_SMTP_ $@ $3 $: $1 < @ [$2] > $4 smarthost > without mailer', > `dnl') > If a smarthost is defined then the message will be sent to the > smarthost (and you _do_ have a smarthost defined), otherwise directly > to the numerical address. Your rules defined under `LOCAL_NET_CONFIG' > will never be reached when numerical addresses in square brackets > are used. > If you put your rules in rule set `ParseLocal' things should work > like you want them to work. Use `LOCAL_RULE_0' instead of > `LOCAL_NET_CONFIG' to do so. Thanks for the info. This is very helpful. -- Dale Dellutri <ddelQQQlutr@panQQQix.com> (lose the Q's) |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.