|
|
|
|
||||||
| comp.mail.sendmail Configuring and using the BSD sendmail agent. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
HI
I would like to change just the part of username (of recipient). I want to rewrite the any adrress 123xxx@dom.com to 321xxx@dom.com (to change 123 with 321). For example 123911@dom.com to 321911@dom.com Can somebody show me the way this should be done Thanks |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
slonic@cg.yu wrote: > HI > > I would like to change just the part of username (of recipient). > I want to rewrite the any adrress 123xxx@dom.com to 321xxx@dom.com (to > change 123 with 321). > For example 123911@dom.com to 321911@dom.com > > Can somebody show me the way this should be done > > Thanks Perhaps all you need is the virtusertable feature. See cf/README virtusertable A domain-specific form of aliasing, allowing multiple virtual domains to be hosted on one machine. For example, if the virtuser table contains: info@foo.com foo-info info@bar.com bar-info joe@bar.com error:nouser 550 No such user here jax@bar.com error:5.7.0:550 Address invalid @baz.org jane@example.net (there is lots more there) To extend this to support localpart only rewriting see http://www.jmaimon.com/sendmail http://www.jmaimon.com/sendmail/patc...oto.m4.3.patch Or there is the genericstable, aliases and address rewriting in either localaddr or parseaddr. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Thanks for reply! If I understood well I need to install some additional stuff to Sendmail? I preffer not to do it because my sendmail serving live service and I am not so good. Is there any other way that not require additional installing and similar things? |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
slonic@cg.yu wrote:
> Thanks for reply! > > If I understood well I need to install some additional stuff to > Sendmail? I preffer not to do it because my sendmail serving live > service and I am not so good. > > Is there any other way that not require additional installing and > similar things? I dont understand what you are trying to achieve well enough to answer any more than I already did. If you are trying to do exactly as your example shows, than vanilla virtusetable with or without virtuserdomains (if the domains arent local) will do just fine. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
jmaimon@ttec.com wrote: > slonic@cg.yu wrote: > > Thanks for reply! > > > > If I understood well I need to install some additional stuff to > > Sendmail? I preffer not to do it because my sendmail serving live > > service and I am not so good. > > > > Is there any other way that not require additional installing and > > similar things? > > I dont understand what you are trying to achieve well enough to answer > any more than I already did. > > If you are trying to do exactly as your example shows, than vanilla > virtusetable with or without virtuserdomains (if the domains arent > local) will do just fine. Hi and sorry if I was confusing. I'll try to explain what exactly I want to have. Mails addressed to: 123000000@domain.com 123000001@domain.com ..................................... 123999998@domain.com 123999999@domain.com should be delivered to 321000000@domain.com 321000001@domain.com ..................................... 321999998@domain.com 321999999@domain.com respectively. So, instead of having 999999 entries in some place i would like to have few lines that change first three characters of user part. This should happen only if those three lchars are 123 (they should be changed to 321). Rest of user part should remains as it was before. Hope this is understandable. Thanks |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
slonic@cg.yu wrote: > > 321999998@domain.com > 321999999@domain.com > respectively. > So, instead of having 999999 entries in some place i would like to have > few lines that change first three characters of user part. This should > happen only if those three lchars are 123 (they should be changed to > 321). Rest of user part should remains as it was before. > > Hope this is understandable. > > Thanks Since sendmail tokenizing means that you will have few chances to deal with a subset of the localpart you may be best off by constructing a program map shell script that does the translation you want (see doc/op/op.txt) Then you can follow the suggestions in this post (is there a new/better way?) to get sendmail to use both your map and the normal virtusertable map. http://groups.google.com/group/comp....0dc128847b4ce5 |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
In article <1161365556.660140.59860@b28g2000cwb.googlegroups. com>
"jmaimon@ttec.com" <jmaimon@ttec.com> writes: > >slonic@cg.yu wrote: > >> >> 321999998@domain.com >> 321999999@domain.com >> respectively. >> So, instead of having 999999 entries in some place i would like to have >> few lines that change first three characters of user part. This should >> happen only if those three lchars are 123 (they should be changed to >> 321). Rest of user part should remains as it was before. >> >> Hope this is understandable. >> >> Thanks > >Since sendmail tokenizing means that you will have few chances to deal >with a subset of the localpart you may be best off by constructing a >program map shell script that does the translation you want Well, it should be doable with a regex map. >(see doc/op/op.txt) Ditto. >Then you can follow the suggestions in this post (is there a new/better >way?) to get sendmail to use both your map and the normal virtusertable >map. > >http://groups.google.com/group/comp....0dc128847b4ce5 If you want to combine different maps into one (i.e. not just different *text files*, where you're better off sending the concatenation as input to makemap), that's still the way to go AFAIK. Not sure if it's needed here though, it seems clear that the OP isn't using the virtusertable already so this could be used as the *only* map for virtusertable - or it could just be a couple of custom rules for LOCAL_RULE_0. --Per Hedeland per@hedeland.org |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
Hi,
i have tried with regex. In that way from initial 123000000@domain.com I can get 321 000000 @ domain . com Because of space between 321 and 000000 final result will be 321.000000@domain.com which is not good for me. Is there any chance to fix this (remove space)? Thanks Per Hedeland wrote: > In article <1161365556.660140.59860@b28g2000cwb.googlegroups. com> > "jmaimon@ttec.com" <jmaimon@ttec.com> writes: > > > >slonic@cg.yu wrote: > > > >> > >> 321999998@domain.com > >> 321999999@domain.com > >> respectively. > >> So, instead of having 999999 entries in some place i would like to have > >> few lines that change first three characters of user part. This should > >> happen only if those three lchars are 123 (they should be changed to > >> 321). Rest of user part should remains as it was before. > >> > >> Hope this is understandable. > >> > >> Thanks > > > >Since sendmail tokenizing means that you will have few chances to deal > >with a subset of the localpart you may be best off by constructing a > >program map shell script that does the translation you want > > Well, it should be doable with a regex map. > > >(see doc/op/op.txt) > > Ditto. > > >Then you can follow the suggestions in this post (is there a new/better > >way?) to get sendmail to use both your map and the normal virtusertable > >map. > > > >http://groups.google.com/group/comp....0dc128847b4ce5 > > If you want to combine different maps into one (i.e. not just different > *text files*, where you're better off sending the concatenation as input > to makemap), that's still the way to go AFAIK. Not sure if it's needed > here though, it seems clear that the OP isn't using the virtusertable > already so this could be used as the *only* map for virtusertable - or > it could just be a couple of custom rules for LOCAL_RULE_0. > > --Per Hedeland > per@hedeland.org |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
I solve the problem.
There is possibility to remove SPACEs when using regex with option -d Now I can change 321 to 123. slonic@cg.yu wrote: > Hi, > i have tried with regex. In that way from initial 123000000@domain.com > I can get 321 000000 @ domain . com > Because of space between 321 and 000000 final result will be > 321.000000@domain.com which is not good for me. > Is there any chance to fix this (remove space)? > Thanks > > Per Hedeland wrote: > > In article <1161365556.660140.59860@b28g2000cwb.googlegroups. com> > > "jmaimon@ttec.com" <jmaimon@ttec.com> writes: > > > > > >slonic@cg.yu wrote: > > > > > >> > > >> 321999998@domain.com > > >> 321999999@domain.com > > >> respectively. > > >> So, instead of having 999999 entries in some place i would like to have > > >> few lines that change first three characters of user part. This should > > >> happen only if those three lchars are 123 (they should be changed to > > >> 321). Rest of user part should remains as it was before. > > >> > > >> Hope this is understandable. > > >> > > >> Thanks > > > > > >Since sendmail tokenizing means that you will have few chances to deal > > >with a subset of the localpart you may be best off by constructing a > > >program map shell script that does the translation you want > > > > Well, it should be doable with a regex map. > > > > >(see doc/op/op.txt) > > > > Ditto. > > > > >Then you can follow the suggestions in this post (is there a new/better > > >way?) to get sendmail to use both your map and the normal virtusertable > > >map. > > > > > >http://groups.google.com/group/comp....0dc128847b4ce5 > > > > If you want to combine different maps into one (i.e. not just different > > *text files*, where you're better off sending the concatenation as input > > to makemap), that's still the way to go AFAIK. Not sure if it's needed > > here though, it seems clear that the OP isn't using the virtusertable > > already so this could be used as the *only* map for virtusertable - or > > it could just be a couple of custom rules for LOCAL_RULE_0. > > > > --Per Hedeland > > per@hedeland.org |
|
![]() |
| Outils de la discussion | |
|
|