Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

change plussed user character from "+' to "-"

55 views
Skip to first unread message

bob davis

unread,
Jun 25, 2003, 11:51:48 AM6/25/03
to
Hi I want to change the delimiter character for plussed user from "+" to
"-". The reason is that many sites strip the plus. For example yahoo
travel strips the plus.
I think I have to change the the cf file ruleset 5. Here is the change I
think I have to make:

# deal with plussed users so aliases work nicely
R$+ - * $#local $@ $&h $: $1
R$+ - $* $#local $@ + $2 $: $1 + *

original

# deal with plussed users so aliases work nicely
R$+ + * $#local $@ $&h $: $1
R$+ + $* $#local $@ + $2 $: $1 + *

Is this the only change I have to make? Does this break anything else?
The next paragraph in ruleset 5 deals with relay of hub and looks like
it works with plussed users. Do I have to change it too?

thanks
bob

Neil W Rickert

unread,
Jun 25, 2003, 12:47:04 PM6/25/03
to
bob davis <rda...@lillysoftware.com> writes:

>Hi I want to change the delimiter character for plussed user from "+" to
>"-". The reason is that many sites strip the plus. For example yahoo
>travel strips the plus.
>I think I have to change the the cf file ruleset 5. Here is the change I
>think I have to make:

># deal with plussed users so aliases work nicely
>R$+ - * $#local $@ $&h $: $1
>R$+ - $* $#local $@ + $2 $: $1 + *

>original

># deal with plussed users so aliases work nicely
>R$+ + * $#local $@ $&h $: $1
>R$+ + $* $#local $@ + $2 $: $1 + *

>Is this the only change I have to make? Does this break anything else?

That won't work unless you add "-" to OperatorChars . And changing
OperatorChars might break something.

Andrzej Adam Filip

unread,
Jun 25, 2003, 2:40:00 PM6/25/03
to

Bob,
You can use regex map in rule set 0 to rewrite user-...@local.email.domain
to user+...@local.email.domain loved by sendmail.

AFAIR I posted an example how to dot it some time ago.

--
Andrzej [pl>en: Andrew] Adam Filip http://www.polbox.com/a/anfi/
an...@priv.onet.pl an...@xl.wp.pl [former: an...@Box43.pl]
I am proud I am not a bushman. *Random Epigram* :
It's like deja vu all over again.
-- Yogi Berra

bob davis

unread,
Jun 26, 2003, 1:31:09 AM6/26/03
to
Sorry to sound like a winer... but I cant find any doc on how to use
regex. I have guessed -a does append -s1 does substring match
availability. I have from a previous post of yours:

LOCAL_CONFIG
Ksubm regex -s1 ^([^-_.+]+)[-_.][^+]+$
SLocal_localaddr
R$* $: < $(subm $1 $: $) > $1
R< $+ > $+ $# local $: $1
R$* $# ok

So this basically takes aaaaaaa-bbb and makes it aaaaaaabbb but
aaaaaaa+bbb is left alone. I know how to do a regex in perl to change
all "-" to "+". It would be s/-/+/g and I would be done.

thanks for any help
bob

Andrzej Adam Filip

unread,
Jun 26, 2003, 2:05:00 PM6/26/03
to
bob davis wrote:
> Sorry to sound like a winer... but I cant find any doc on how to use
> regex.

A brief description is provided in doc/op/op.me file in sendmail distribution.
I know it may be "a little bit" cryptic for somebody without some sendmail
experience.

> I have guessed -a does append -s1 does substring match
> availability. I have from a previous post of yours:
>
> LOCAL_CONFIG
> Ksubm regex -s1 ^([^-_.+]+)[-_.][^+]+$
> SLocal_localaddr
> R$* $: < $(subm $1 $: $) > $1
> R< $+ > $+ $# local $: $1
> R$* $# ok
>
> So this basically takes aaaaaaa-bbb and makes it aaaaaaabbb but
> aaaaaaa+bbb is left alone. I know how to do a regex in perl to change
> all "-" to "+". It would be s/-/+/g and I would be done.

* Unless you use FEATURE(`preserve_local_plus_detail') sendmail handles
user+detail itself.
* The above code replaces aaaaaaa-bbb by aaaaaaa
* if you want to replace aaaaaaa-bbb by aaaaaaa+bbb use
Ksubm regex -d+ -s1,2 ^([^-_.+]+)[-_.]([^+]+)$
* FYI: the above rewriting in Local_localaddr takes place AFTER virtusertable
lookups and after alias expansion. If you want the rewtite before
virtusertable lookups then slightly different R lines are required/
* If you want to test such maps use
echo "/map subm aaaa-bbbb" | sendmail -bt -C test.cf

--

Andrzej [pl>en: Andrew] Adam Filip http://www.polbox.com/a/anfi/
an...@priv.onet.pl an...@xl.wp.pl [former: an...@Box43.pl]
I am proud I am not a bushman. *Random Epigram* :

God help those who do not help themselves.
-- Wilson Mizner

bob davis

unread,
Jun 26, 2003, 4:27:54 PM6/26/03
to
Thanks a lot for the help. I just discovered the "installation and
operation guide" in my /usr/share/doc/sendmail dir. I would have thought
it was on the sendmail.org site somewhere but I couldnt find it. I did
find it online at http://people.freenet.de/slgig/op_en/index.html.

A couple of questions:
1. Is this rule applied recursively if successful? I thought the $: a
the beginning of the rhs meant to stop after the first time.
2. Does the second $: mean default of spaces?
3. What does the pair of <> in the rhs do?
change
bob-dated-105...@bobsbits.net
to
<bob+dated+1056745552+43361d> bob-dated-105...@bobsbits.net

Any other doc references?

thanks

bob davis

unread,
Jun 26, 2003, 5:31:52 PM6/26/03
to
This map regex seems to work for 1 or 2 "-" minuses in the email.

Ksubm regex -d+ -s1,2,3 ^([^-]+)[-]([^-]+)[-]?([^+]+)$

Per Hedeland

unread,
Jun 26, 2003, 6:29:17 PM6/26/03
to
In article <bdfoo...@enews2.newsguy.com> bob davis

<rda...@lillysoftware.com> writes:
>This map regex seems to work for 1 or 2 "-" minuses in the email.
>
>Ksubm regex -d+ -s1,2,3 ^([^-]+)[-]([^-]+)[-]?([^+]+)$

Why would you want to change more than one? Sendmail will only pay
attention to one '+' - I think it's the first one, but if you only have
one '+' there is no room for confusion/uncertainty about that...

--Per Hedeland
p...@hedeland.org

Andrzej Adam Filip

unread,
Jun 27, 2003, 2:19:00 AM6/27/03
to
bob davis wrote:
> Thanks a lot for the help. I just discovered the "installation and
> operation guide" in my /usr/share/doc/sendmail dir. I would have thought
> it was on the sendmail.org site somewhere but I couldnt find it. I did
> find it online at http://people.freenet.de/slgig/op_en/index.html.
>
> A couple of questions:
> 1. Is this rule applied recursively if successful?

No

> I thought the $: a
> the beginning of the rhs meant to stop after the first time.

Exactly.
As Per wrote in another reply only forst + is treated specially by sendmail.

> 2. Does the second $: mean default of spaces?

$: in $(subm $1 $: $) specifies what lookup should return on "no match".
In this case it is nothing (empty string).

> 3. What does the pair of <> in the rhs do?
> change
> bob-dated-105...@bobsbits.net
> to
> <bob+dated+1056745552+43361d> bob-dated-105...@bobsbits.net

<> are used to "mark" data returned by the lookup for second R line.

Another way to write it:


LOCAL_CONFIG
Ksubm regex -s1 ^([^-_.+]+)[-_.][^+]+$
SLocal_localaddr

R$* $: $(subm $1 $: $) $| $1
R$+ $| $+ $# local $: $1
R$* $| $* $# ok

> Any other doc references?
> [...]

--
Andrzej [pl>en: Andrew] Adam Filip http://www.polbox.com/a/anfi/
an...@priv.onet.pl an...@xl.wp.pl [former: an...@Box43.pl]
I am proud I am not a bushman. *Random Epigram* :

To lead people, you must follow behind.
-- Lao Tsu

0 new messages