|
|
|
|
||||||
| comp.mail.sendmail Configuring and using the BSD sendmail agent. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Colleagues,
I use genericstable and FEATURE(`masquerade_envelope') to rewrite some outgoing mail. The problem is that both envelope-from and the "From:" header are rewritten. Is there a way to rewrite just the envelope-from and leave the "From:" header intact? I know that the direct hacking at the rulesets can do anything, but would be glad to find a more or less ready-made solution. Thank you for any ideas. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
In article <eierac$2b76$1@relay.tomsk.ru> Victor Sudakov
<vas@mpeks.no-spam-here.tomsk.su> writes: > >I use genericstable and FEATURE(`masquerade_envelope') >to rewrite some outgoing mail. > >The problem is that both envelope-from and the "From:" header are >rewritten. > >Is there a way to rewrite just the envelope-from and leave the "From:" >header intact? Not as such (with a canned solution), but in specific cases you can perhaps achieve "identity rewriting" for the header (first requirement is of course that the original envelope and header addresses are different). It's a pretty unusual request - I would say that in the vast majority of cases rewriting both (i.e. what masquerade_envelope achhieves) is desired, with header-only (i.e. the default) being a distant second. In fact I don't think I've ever seen anyone ask for envelope-only before - care to elaborate on why you want this? >I know that the direct hacking at the rulesets can do anything, but >would be glad to find a more or less ready-made solution. Yes, it can be done with a custom mailer definition of course - look at e.g. how the esmtp mailer turns out in the .cf with and without masquerade_envelope and/or allmasquerade (which adds header recipient), and you can probably figure out how it should look to achieve what you want. Then give it a different name and paste it into your .mc after a MAILER_DEFINITIONS line (and do whatever it takes to use it, depends a bit on how you do outgoing mail routing). --Per Hedeland per@hedeland.org |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Per Hedeland wrote:
> It's a pretty unusual request - I would say that in the vast majority of > cases rewriting both (i.e. what masquerade_envelope achhieves) is > desired, with header-only (i.e. the default) being a distant second. In > fact I don't think I've ever seen anyone ask for envelope-only before - > care to elaborate on why you want this? Sure. We have a web hosting which produces a significant amount of outgoing mail (generated by users' scripts, forums etc). Users should be free to use any address in the "From:" header, but I want all the bounces and DSNs sent to one mailbox for analysis. Perhaps later we might think of some scheme of sender rewriting, much like Yahoo Groups uses for their mailing lists. But for the present, directing all the bounces to one mailbox (and not bothering innocent parties with bounces) would be a great step forward. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
In news:eih5lf$i9r$1@relay.tomsk.ru,
Victor Sudakov <vas@mpeks.no-spam-here.tomsk.su> wrote: >> In fact I don't think I've ever seen anyone ask for >> envelope-only before - care to elaborate on why you want this? > > Sure. We have a web hosting which produces a significant amount of > outgoing mail (generated by users' scripts, forums etc). Ah yes, a spam portal I think it's called. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
In article <eih5lf$i9r$1@relay.tomsk.ru> Victor Sudakov
<vas@mpeks.no-spam-here.tomsk.su> writes: >Per Hedeland wrote: > >> It's a pretty unusual request - I would say that in the vast majority of >> cases rewriting both (i.e. what masquerade_envelope achhieves) is >> desired, with header-only (i.e. the default) being a distant second. In >> fact I don't think I've ever seen anyone ask for envelope-only before - >> care to elaborate on why you want this? > >Sure. We have a web hosting which produces a significant amount of >outgoing mail (generated by users' scripts, forums etc). Users should be >free to use any address in the "From:" header, but I want all the >bounces and DSNs sent to one mailbox for analysis. OK, but then I think having envelope sender rewriting in sendmail is quite the wrong way to go about it - just make sure the desired envelope sender address is set appropriately to start with. I would guess that the mail is sent via direct invocation of sendmail, in that case just use the -f option (see the man page). In case it's done via SMTP, the envelope sender is the 'MAIL From:' argument of course. --Per Hedeland per@hedeland.org |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
Patrick wrote:
> >> In fact I don't think I've ever seen anyone ask for > >> envelope-only before - care to elaborate on why you want this? > > > > Sure. We have a web hosting which produces a significant amount of > > outgoing mail (generated by users' scripts, forums etc). > Ah yes, a spam portal I think it's called. I presume, you have never seen a web forum with E-mail notifications? You have also never seen a forum where a valid E-mail address is required for access? Get a life. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
Per Hedeland wrote:
> >> It's a pretty unusual request - I would say that in the vast majority of > >> cases rewriting both (i.e. what masquerade_envelope achhieves) is > >> desired, with header-only (i.e. the default) being a distant second. In > >> fact I don't think I've ever seen anyone ask for envelope-only before - > >> care to elaborate on why you want this? > > > >Sure. We have a web hosting which produces a significant amount of > >outgoing mail (generated by users' scripts, forums etc). Users should be > >free to use any address in the "From:" header, but I want all the > >bounces and DSNs sent to one mailbox for analysis. > OK, but then I think having envelope sender rewriting in sendmail is > quite the wrong way to go about it - just make sure the desired envelope > sender address is set appropriately to start with. I would guess that > the mail is sent via direct invocation of sendmail, in that case just > use the -f option (see the man page). In case it's done via SMTP, the > envelope sender is the 'MAIL From:' argument of course. It would work only for our own scripts. But this is a commercial hosting. We do not have supervision over the numerous web applications that the customers install. Nor do we want to intervene unless there is some abuse. If their scripts send mail via /usr/sbin/sendmail, I could provide a wrapper, though this would be a waste of resources. But for SMTP submissions, rewriting seems to be the only solution. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
Per Hedeland wrote:
> >I know that the direct hacking at the rulesets can do anything, but > >would be glad to find a more or less ready-made solution. > Yes, it can be done with a custom mailer definition of course - look at > e.g. how the esmtp mailer turns out in the .cf with and without > masquerade_envelope and/or allmasquerade (which adds header recipient), > and you can probably figure out how it should look to achieve what you > want. I am sorry but adding MASQUERADE_AS(`domain.com') FEATURE(masquerade_envelope) to the .mc file does not produce any changes in the mailer definitions. It only modifies the rulesets. Any more ideas? -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
In article <eijua8$1mhp$1@relay.tomsk.ru> Victor Sudakov
<vas@mpeks.no-spam-here.tomsk.su> writes: >Per Hedeland wrote: > >> OK, but then I think having envelope sender rewriting in sendmail is >> quite the wrong way to go about it - just make sure the desired envelope >> sender address is set appropriately to start with. I would guess that >> the mail is sent via direct invocation of sendmail, in that case just >> use the -f option (see the man page). In case it's done via SMTP, the >> envelope sender is the 'MAIL From:' argument of course. > >It would work only for our own scripts. > >But this is a commercial hosting. We do not have supervision over the >numerous web applications that the customers install. Nor do we want >to intervene unless there is some abuse. > >If their scripts send mail via /usr/sbin/sendmail, I could provide a >wrapper, though this would be a waste of resources. A very marginal waste. > But for SMTP >submissions, rewriting seems to be the only solution. And are there any SMTP submissions? I believe it's quite uncommon for "cgi scripts" and the like to use SMTP to send mail (and those that do it probably get it wrong anyway). --Per Hedeland per@hedeland.org |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
In article <eik4mt$1up5$1@relay.tomsk.ru> Victor Sudakov
<vas@mpeks.no-spam-here.tomsk.su> writes: >Per Hedeland wrote: > >> Yes, it can be done with a custom mailer definition of course - look at >> e.g. how the esmtp mailer turns out in the .cf with and without >> masquerade_envelope and/or allmasquerade (which adds header recipient), >> and you can probably figure out how it should look to achieve what you >> want. > >I am sorry but adding > >MASQUERADE_AS(`domain.com') >FEATURE(masquerade_envelope) > >to the .mc file does not produce any changes in the mailer >definitions. It only modifies the rulesets. Yes, sorry, it's allmasquerade that changes the mailer definition. But anyway, since you've now looked at the mailer definition, you'll have found a reference to the EnvFromSMTP ruleset, which is the one responsible for dealing with the envelope sender. And since it isn't really masquerading you want to do, I'd suggest that you don't use that feature but instead have the mailer definition call a ruleset of your own instead of EnvFromSMTP. That ruleset just needs to throw away the original address and insert your desired fixed one, and then call EnvFromSMTP. Something like this (untested): LOCAL_RULESETS SFixedEnvFrom R$* $: sender < @ domain.com. > R$* $: $>EnvFromSMTP $1 --Per Hedeland per@hedeland.org |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
Victor Sudakov wrote:
> Is there a way to rewrite just the envelope-from and leave the "From:" > header intact? So, where are all the gurus? The task seems pretty trivial, I would be surprised if sendmail really could not do this. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ |
|
|
|
#12 |
|
Messages: n/a
Hébergeur: |
In article <eiot95$1cqi$2@relay.tomsk.ru> Victor Sudakov
<vas@mpeks.no-spam-here.tomsk.su> writes: >Victor Sudakov wrote: > >> Is there a way to rewrite just the envelope-from and leave the "From:" >> header intact? > >So, where are all the gurus? The task seems pretty trivial, I would be >surprised if sendmail really could not do this. Of course sendmail can do it, wheter it is trivial to make it do it is another thing - since it is not a common requirement, there has been no effort at providing a "canned feature" for it. But anyway I already posted the outline of a solution in http://groups.google.com/group/comp....17781ad3be3e99 - I'm afraid it won't get more trivial than that. --Per Hedeland per@hedeland.org |
|
|
|
#13 |
|
Messages: n/a
Hébergeur: |
Per Hedeland wrote:
> And since it isn't > really masquerading you want to do, I'd suggest that you don't use that > feature but instead have the mailer definition call a ruleset of your > own instead of EnvFromSMTP. That ruleset just needs to throw away the > original address and insert your desired fixed one, and then call > EnvFromSMTP. I like this idea. However, how do I gracefully change the esmtp mailer S parameter? "S=EnvFromSMTP/HdrFromSMTP" is hardcoded into cf/mailer/smtp.m4, as well as the EnvFromSMTP ruleset itself. And I don't want my configuration to break with the next upgrade of sendmail. If I write my own mailer definition for this purpose, how do I make my custom mailer the default one? -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ |
|
|
|
#14 |
|
Messages: n/a
Hébergeur: |
In article <ej6v10$1a8r$1@relay.tomsk.ru> Victor Sudakov
<vas@mpeks.no-spam-here.tomsk.su> writes: >Per Hedeland wrote: > >> And since it isn't >> really masquerading you want to do, I'd suggest that you don't use that >> feature but instead have the mailer definition call a ruleset of your >> own instead of EnvFromSMTP. That ruleset just needs to throw away the >> original address and insert your desired fixed one, and then call >> EnvFromSMTP. > >I like this idea. However, how do I gracefully change the esmtp mailer >S parameter? "S=EnvFromSMTP/HdrFromSMTP" is hardcoded into >cf/mailer/smtp.m4, as well as the EnvFromSMTP ruleset itself. And I >don't want my configuration to break with the next upgrade of >sendmail. > >If I write my own mailer definition for this purpose, how do I make >my custom mailer the default one? I already described this earlier in the thread: >>>Then give it a different name and paste it into your .mc after a >>>MAILER_DEFINITIONS line (and do whatever it takes to use it, depends a >>>bit on how you do outgoing mail routing). (Here "it" refers to the mailer definition you find in sendmail.cf.) I.e. there isn't a single default - if parsing just reaches the end of ruleset zero the message is handed to confSMTP_MAILER; if you have e.g. a SMART_HOST definition that doesn't specify a mailer, confRELAY_MAILER will be used. In most places you can specify the mailer to be used, though. --Per Hedeland per@hedeland.org |
|
|
|
#15 |
|
Messages: n/a
Hébergeur: |
Per Hedeland wrote:
> >I like this idea. However, how do I gracefully change the esmtp mailer > >S parameter? "S=EnvFromSMTP/HdrFromSMTP" is hardcoded into > >cf/mailer/smtp.m4, as well as the EnvFromSMTP ruleset itself. And I > >don't want my configuration to break with the next upgrade of > >sendmail. > > > >If I write my own mailer definition for this purpose, how do I make > >my custom mailer the default one? > I already described this earlier in the thread: > >>>Then give it a different name and paste it into your .mc after a > >>>MAILER_DEFINITIONS line (and do whatever it takes to use it, depends a > >>>bit on how you do outgoing mail routing). > (Here "it" refers to the mailer definition you find in sendmail.cf.) > I.e. there isn't a single default - if parsing just reaches the end of > ruleset zero the message is handed to confSMTP_MAILER; I see. I must redefine confSMTP_MAILER to my custom mailer. Thanks a lot for your , your advice has been most useful. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ |
|
![]() |
| Outils de la discussion | |
|
|