Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #130: new management


comp / comp.mail.sendmail / Re: sender rewrining advice

SubjectAuthor
* sender rewrining advicenone
+* Re: sender rewrining adviceGrant Taylor
|`* Re: sender rewrining advicenone
| `* Re: sender rewrining adviceGrant Taylor
|  `* Re: sender rewrining advicenone
|   `* Re: sender rewrining adviceGrant Taylor
|    `* Re: sender rewrining advicenone
|     `* Re: sender rewrining adviceGrant Taylor
|      +* Re: sender rewrining adviceGrant Taylor
|      |+* Re: sender rewrining adviceGrant Taylor
|      ||`* Re: sender rewrining advicenone
|      || `* Re: sender rewrining adviceGrant Taylor
|      ||  `* Re: sender rewrining adviceGrant Taylor
|      ||   `* Re: sender rewrining advicenone
|      ||    `- Re: sender rewrining adviceGrant Taylor
|      |+* Re: sender rewrining advicenone
|      ||`- Re: sender rewrining adviceGrant Taylor
|      |+* Re: sender rewrining advicenone
|      ||`* Re: sender rewrining adviceGrant Taylor
|      || `* Re: sender rewrining advicenone
|      ||  `- Re: sender rewrining adviceGrant Taylor
|      |+* Re: sender rewrining advicenone
|      ||`- Re: sender rewrining adviceGrant Taylor
|      |`* Re: sender rewrining advicenone
|      | +- Re: sender rewrining adviceGrant Taylor
|      | `- Re: sender rewrining adviceGrant Taylor
|      +* Re: sender rewrining advicenone
|      |`- Re: sender rewrining adviceGrant Taylor
|      `* Re: sender rewrining advicenone
|       `- Re: sender rewrining adviceGrant Taylor
`* Re: sender rewrining advicenone
 `- Re: sender rewrining adviceGrant Taylor

Pages:12
Subject: Re: sender rewrining advice
From: none
Newsgroups: comp.mail.sendmail
Organization: A noiseless patient Spider
Date: Sun, 24 Mar 2024 18:23 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: hzcnjkx656@tormails.com (none)
Newsgroups: comp.mail.sendmail
Subject: Re: sender rewrining advice
Date: Sun, 24 Mar 2024 19:23:29 +0100
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <utpr34$gvl0$1@dont-email.me>
References: <ut75od$3k36i$1@dont-email.me>
<ut7is6$oeb$1@tncsrv09.home.tnetconsulting.net> <uta80m$c43c$1@dont-email.me>
<utdfp4$fs6$1@tncsrv09.home.tnetconsulting.net>
<utesd2$1hkni$1@dont-email.me>
<utg4du$o00$1@tncsrv09.home.tnetconsulting.net>
<uth88c$26nhr$1@dont-email.me>
<utlkoe$4ve$1@tncsrv09.home.tnetconsulting.net>
<utlmi6$iv4$1@tncsrv09.home.tnetconsulting.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 24 Mar 2024 18:23:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5f53366423bb038cb5bcf2d2e7ae4caf";
logging-data="556704"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/KsspCLDEaKKFc1DRUFD6lAmbiMthkl41gzbW65Cmaqw=="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:zn50Eok2fo5IGwi10YNsDJ2B9FM=
In-Reply-To: <utlmi6$iv4$1@tncsrv09.home.tnetconsulting.net>
Content-Language: en-GB
View all headers

>
> So I switched to perlsrs-old.m4 which forks a copy of envfrom2srs.pl or
> srs2envto.pl as necessary.
>

Ok so I have now a bit of 'test' environment, build an el9 rpm for perl
SRS.

So I need to rewrite test@gmail.com to ...@example.com in order to have
the email accepted by guerrillamail

test@gmail.com -> test@example.com forwarded to test@guerrillamail.com

I assume I can test like this:

[@srs]# perl envfrom2srs.pl test@gmail.com
SRS0=Q8cgq6jj=K6=gmail.com=test<@REDACTED.>

This fromdomain/forward domain seems to be hard coded

my $fwdomain = 'REDACTED';

I prefer this to stay on the domain that is being forwarded. I like to
process messages like this

test@gmail.com -> test@example.com forwarded to test@guerrillamail.com
SRS0=Q8cgq6jj=K6=gmail.com=test<@example.com.>

test@gmail.com -> test@example2.com forwarded to test@guerrillamail.com
SRS0=Q8cgq6jj=K6=gmail.com=test<@example2.com.>

Subject: Re: sender rewrining advice
From: Grant Taylor
Newsgroups: comp.mail.sendmail
Organization: TNet Consulting
Date: Sun, 24 Mar 2024 18:44 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!tncsrv06.tnetconsulting.net!tncsrv09.home.tnetconsulting.net!.POSTED.omega.home.tnetconsulting.net!not-for-mail
From: gtaylor@tnetconsulting.net (Grant Taylor)
Newsgroups: comp.mail.sendmail
Subject: Re: sender rewrining advice
Date: Sun, 24 Mar 2024 13:44:10 -0500
Organization: TNet Consulting
Message-ID: <utps9q$iff$1@tncsrv09.home.tnetconsulting.net>
References: <ut75od$3k36i$1@dont-email.me>
<ut7is6$oeb$1@tncsrv09.home.tnetconsulting.net> <uta80m$c43c$1@dont-email.me>
<utdfp4$fs6$1@tncsrv09.home.tnetconsulting.net>
<utesd2$1hkni$1@dont-email.me>
<utg4du$o00$1@tncsrv09.home.tnetconsulting.net>
<uth88c$26nhr$1@dont-email.me>
<utlkoe$4ve$1@tncsrv09.home.tnetconsulting.net>
<utlmi6$iv4$1@tncsrv09.home.tnetconsulting.net> <utpr34$gvl0$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 24 Mar 2024 18:44:10 -0000 (UTC)
Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="omega.home.tnetconsulting.net:198.18.1.140";
logging-data="18927"; mail-complaints-to="newsmaster@tnetconsulting.net"
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <utpr34$gvl0$1@dont-email.me>
View all headers

On 3/24/24 13:23, none wrote:
> Ok so I have now a bit of 'test' environment, build an el9 rpm for perl
> SRS.

:-)

> So I need to rewrite test@gmail.com to ...@example.com in order to have
> the email accepted by guerrillamail
>
> test@gmail.com -> test@example.com forwarded to test@guerrillamail.com
>
> I assume I can test like this:
>
> [@srs]# perl envfrom2srs.pl test@gmail.com
> SRS0=Q8cgq6jj=K6=gmail.com=test<@REDACTED.>

I don't remember. Probably.

> This fromdomain/forward domain seems to be hard coded

Yes?

You aren't providing example vs example2 information to the
envfrom2srs.pl script. So it has no knowledge of what to use other than
what is configured in it.

> I prefer this to stay on the domain that is being forwarded. I like to
> process messages like this

Okay.

The scripts weren't written with that functionality in mind.

You may be able to extend the script to take a forwarding source domain
option and modify the rules referencing the maps accordingly.

You could probably also run multiple maps, one for each forwarding
source domain configured therein and intelligently choose which map you use.

I actually used the host's FQDN as the forwarding domain.

--
Grant. . . .

Subject: Re: sender rewrining advice
From: none
Newsgroups: comp.mail.sendmail
Organization: A noiseless patient Spider
Date: Sun, 24 Mar 2024 19:51 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: hzcnjkx656@tormails.com (none)
Newsgroups: comp.mail.sendmail
Subject: Re: sender rewrining advice
Date: Sun, 24 Mar 2024 20:51:16 +0100
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <utq07m$i83p$1@dont-email.me>
References: <ut75od$3k36i$1@dont-email.me>
<ut7is6$oeb$1@tncsrv09.home.tnetconsulting.net> <uta80m$c43c$1@dont-email.me>
<utdfp4$fs6$1@tncsrv09.home.tnetconsulting.net>
<utesd2$1hkni$1@dont-email.me>
<utg4du$o00$1@tncsrv09.home.tnetconsulting.net>
<uth88c$26nhr$1@dont-email.me>
<utlkoe$4ve$1@tncsrv09.home.tnetconsulting.net>
<utlmi6$iv4$1@tncsrv09.home.tnetconsulting.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 24 Mar 2024 19:51:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5f53366423bb038cb5bcf2d2e7ae4caf";
logging-data="598137"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tXee+zM0v13jsoyYMq1QcZbHX7Mm5CNlpooeQwmnecQ=="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:qnDnnBGFOhJoCr74xNSt4BdJLo8=
Content-Language: en-GB
In-Reply-To: <utlmi6$iv4$1@tncsrv09.home.tnetconsulting.net>
View all headers

>  -
> https://web.archive.org/web/20051221183047/http://srs-socketmap.info/sendmailsrs.htm

this from the webarchive, was always executing the srs rewriting not?

SEnvFromSMTP
R$+ $: $>PseudoToReal $1 sender/recipient common
R$* :; <@> $@ list:; special case
R$* $: $>MasqSMTP $1 qualify unqual'ed names
R$+ $: $>MasqEnv $1 do masquerading
R$* $: $(make_srs $1 $)

> The collection of files is basically two versions of very similar
> solutions.  I've used both.
>
> I'm currently using the perlsrs-old.m4.
>
>    HACK(`perlsrs-old')dnl
>

>
> It looks like line 37 of the perlsrs-old.m4 is what references the class
> w map (where local-host-names gets loaded into).  So I would think that
> you could create a new class and load contents of a different file into
> the class and for reference.
>

:) I am not really experienced with m4 nor sendmail. Could that be
something like modifying this?

define(`confCW_FILE', `@LDAP')dnl
FEATURE(use_cw_file, `LDAP')dnl

Would it not be an easy sendmail hack to only allow messages going out
that have an envelope domain that matches a domain in this map?

Subject: Re: sender rewrining advice
From: Grant Taylor
Newsgroups: comp.mail.sendmail
Organization: TNet Consulting
Date: Mon, 25 Mar 2024 00:42 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!tncsrv06.tnetconsulting.net!tncsrv09.home.tnetconsulting.net!.POSTED.omega.home.tnetconsulting.net!not-for-mail
From: gtaylor@tnetconsulting.net (Grant Taylor)
Newsgroups: comp.mail.sendmail
Subject: Re: sender rewrining advice
Date: Sun, 24 Mar 2024 19:42:13 -0500
Organization: TNet Consulting
Message-ID: <utqh95$mfo$1@tncsrv09.home.tnetconsulting.net>
References: <ut75od$3k36i$1@dont-email.me>
<ut7is6$oeb$1@tncsrv09.home.tnetconsulting.net> <uta80m$c43c$1@dont-email.me>
<utdfp4$fs6$1@tncsrv09.home.tnetconsulting.net>
<utesd2$1hkni$1@dont-email.me>
<utg4du$o00$1@tncsrv09.home.tnetconsulting.net>
<uth88c$26nhr$1@dont-email.me>
<utlkoe$4ve$1@tncsrv09.home.tnetconsulting.net>
<utlmi6$iv4$1@tncsrv09.home.tnetconsulting.net> <utq07m$i83p$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 25 Mar 2024 00:42:13 -0000 (UTC)
Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="omega.home.tnetconsulting.net:198.18.1.140";
logging-data="23032"; mail-complaints-to="newsmaster@tnetconsulting.net"
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <utq07m$i83p$1@dont-email.me>
View all headers

On 3/24/24 14:51, none wrote:
> this from the webarchive, was always executing the srs rewriting not?
>
> SEnvFromSMTP
> R$+                     $: $>PseudoToReal $1    sender/recipient common
> R$* :; <@>              $@                      list:; special case
> R$*                     $: $>MasqSMTP $1        qualify unqual'ed names
> R$+                     $: $>MasqEnv $1         do masquerading
> R$*                     $: $(make_srs $1 $)

I've not looked at what was in the archive in detail in a very long time.

My understanding is that what I saw 15+ years ago and what I'm using
checks to see if the envelope from is a local address or not and that it
only re-writes the envelope if it's not from a local sender.

I assume that the $(make_srs $1 $) is what's doing the rewriting there.
But I believe there was logic elsewhere controlling it.

> :) I am not really experienced with m4 nor sendmail. Could that be
> something like modifying this?

The following are unrelated to SRS.

> define(`confCW_FILE', `@LDAP')dnl

I believe `confCW_FILE' is how you specify the file to use for defining
the w class which is local host names.

I don't know how the `@LDAP' will fit into that mix. I assume that
there is a way to make that work but I have no idea what it is.

> FEATURE(use_cw_file, `LDAP')dnl

This tells Sendmail to look for local host names in a file. (The
confCW_FILE option above specifies what file.)

> Would it not be an easy sendmail hack to only allow messages going out
> that have an envelope domain that matches a domain in this map?

I don't know how easy it would be. But I do believe that it should be
possible to do.

N.B. there is a difference in restricting senders to specified domains
vs restricting senders to specified addresses.

The former would still allow user2@example.net to send email as
user1@example.net.

--
Grant. . . .

Subject: Re: sender rewrining advice
From: Grant Taylor
Newsgroups: comp.mail.sendmail
Organization: TNet Consulting
Date: Mon, 25 Mar 2024 00:43 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!tncsrv06.tnetconsulting.net!tncsrv09.home.tnetconsulting.net!.POSTED.omega.home.tnetconsulting.net!not-for-mail
From: gtaylor@tnetconsulting.net (Grant Taylor)
Newsgroups: comp.mail.sendmail
Subject: Re: sender rewrining advice
Date: Sun, 24 Mar 2024 19:43:53 -0500
Organization: TNet Consulting
Message-ID: <utqhc9$mfo$2@tncsrv09.home.tnetconsulting.net>
References: <ut75od$3k36i$1@dont-email.me>
<ut7is6$oeb$1@tncsrv09.home.tnetconsulting.net> <uta80m$c43c$1@dont-email.me>
<utdfp4$fs6$1@tncsrv09.home.tnetconsulting.net>
<utesd2$1hkni$1@dont-email.me>
<utg4du$o00$1@tncsrv09.home.tnetconsulting.net>
<uth88c$26nhr$1@dont-email.me>
<utlkoe$4ve$1@tncsrv09.home.tnetconsulting.net>
<utlmi6$iv4$1@tncsrv09.home.tnetconsulting.net> <utq07m$i83p$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 25 Mar 2024 00:43:53 -0000 (UTC)
Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="omega.home.tnetconsulting.net:198.18.1.140";
logging-data="23032"; mail-complaints-to="newsmaster@tnetconsulting.net"
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <utq07m$i83p$1@dont-email.me>
View all headers

On 3/24/24 14:51, none wrote:
> 🙂 I am not really experienced with m4 nor sendmail.

I highly recommend that you skim the README files that are in the
Sendmail source tarball. Particularly those in the cf directory.

The following is also likely of some use.

Link - Sendmail 8.12.3 cf/README - Sendmail Configuration Files
- https://www.sendmail.org/~ca/email/doc8.12/cf/m4/

--
Grant. . . .

Subject: Re: sender rewrining advice
From: none
Newsgroups: comp.mail.sendmail
Organization: A noiseless patient Spider
Date: Tue, 9 Apr 2024 22:23 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: hzcnjkx656@tormails.com (none)
Newsgroups: comp.mail.sendmail
Subject: Re: sender rewrining advice
Date: Wed, 10 Apr 2024 00:23:45 +0200
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <uv4f5j$g7nu$1@dont-email.me>
References: <ut75od$3k36i$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 09 Apr 2024 22:23:47 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="eb2aa30c5079be37b8d97bb36e8728b9";
logging-data="532222"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dKyo+YQACAJA7qhnxiZB5XxLSC2aJyYWrnq2TX2xb7Q=="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:WSy00LcRKPj9EEmSDwnWK6J396I=
Content-Language: en-GB
In-Reply-To: <ut75od$3k36i$1@dont-email.me>
View all headers

>
>       receive
>        email
>          |
>          |
>          |
>          |
>          V
>   +------------+       +------------+      +------------+
>   |     MX     |       |  OUTGOING  |      |     MX     |
>   |            +------>|            |----->|            |
>   |  accessmap |       |            |      |  EXTERNAL  |
>   |            |       |            |      |            |
>   +------+-----+       +------------+      +------------+
>          |
>          |
>          V
>   +------+-----+
>   |    LOCAL   |
>   |            |
>   |  virtuser  |
>   |            |
>   +------------+
>
>

Hi Grant,

I just wanted to let you know I got this forwarding now working on mx
and do not need to route first to out any more.
I have removed the mailhost from ldap routing.

mailLocalAddress: test@me.com / test@example.com
mailHost:
mailRoutingAddress: test@guerrillamail.com

Currently I am only rewriting the envelope. If I forward to an address
of https://appmaildev.com/en/dkim
The test results show nicely everything green for spf, dkim etc.

I am doing this in the milter available on mx and the only extra
overhead I have, is having to do an mx lookup to determine if the email
is to be delivered external.

Would you know of something I could pass as a macro to the milter that
would show if ldap routing is applied/active? If I know this, I could
limit the amount duplicate dns lookups quite a lot.

Subject: Re: sender rewrining advice
From: Grant Taylor
Newsgroups: comp.mail.sendmail
Organization: TNet Consulting
Date: Thu, 18 Apr 2024 03:34 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!tncsrv06.tnetconsulting.net!tncsrv09.home.tnetconsulting.net!.POSTED.omega.home.tnetconsulting.net!not-for-mail
From: gtaylor@tnetconsulting.net (Grant Taylor)
Newsgroups: comp.mail.sendmail
Subject: Re: sender rewrining advice
Date: Wed, 17 Apr 2024 22:34:01 -0500
Organization: TNet Consulting
Message-ID: <uvq4b9$gvm$2@tncsrv09.home.tnetconsulting.net>
References: <ut75od$3k36i$1@dont-email.me> <uv4f5j$g7nu$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 18 Apr 2024 03:34:01 -0000 (UTC)
Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="omega.home.tnetconsulting.net:198.18.1.140";
logging-data="17398"; mail-complaints-to="newsmaster@tnetconsulting.net"
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <uv4f5j$g7nu$1@dont-email.me>
View all headers

On 4/9/24 17:23, none wrote:
> Hi Grant,

Hi,

> I just wanted to let you know I got this forwarding now working on mx
> and do not need to route first to out any more.
> I have removed the mailhost from ldap routing.

Nice work. :-)

> Would you know of something I could pass as a macro to the milter that
> would show if ldap routing is applied/active? If I know this, I could
> limit the amount duplicate dns lookups quite a lot.

Sorry, I don't know off hand.

I will say that I would think a local caching recursive name server;
BIND and NSCD come to mind, should be able to mitigate a lot of the
impact on the DNS server and probably speed up subsequent queries on the
local system.

--
Grant. . . .

Pages:12

rocksolid light 0.9.8
clearnet tor