|
|
|
|
||||||
| comp.mail.sendmail Configuring and using the BSD sendmail agent. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
Question: I am trying to find a way to add a string to a mailusers realname so the recipient knows it is send over a secure, private network. Tried: With generics table I can edit the emailaddress With MIMEdefang I can add a string to the subject, but management thinks this is not enouth. Some backgroud information: Bear with me, it is somewhat complicated... Our company connects mailservers for organisations over a privat netwerk. If someone from organisation 1 sends an email to the secure address of someone at organisation2 we translate his sender email: user@example1.tld --> user@example2.safenetwork.tld is translated by generics to: user1@example1.safenetwork.tld --> user@example2.safenetwork.tld because it sees the recipient is on the save network The email is delivered to the general mailbox of the user at organisation 2. Because users are stupid, it is to hard for them to see if this mail is transmitted over a secure network, so management is asked the techies to do the impossible again. We have to add something like [safe] to the sender address/real name. So you will get something like: Firstname Lastname [safe] <user1@example1.safenetwork.tld> in stead of Firstname Lastname <user1@example1.safenet.tld> It is not an option to have the user put the [safe] part on the client, because it is a conditional situation. User are able to send to both safe (private network) and unsafe (internet) addresses, without manualy changing to a secudairy safe email alias in there client. Can this be done, because I am pretty much stuck... TIA for any suggestion! Peter |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 03/13/08 08:57, Peter Postma - DCF wrote:
> With MIMEdefang I can add a string to the subject, but management > thinks this is not enouth. Use MIMEdefang to edit the From: header with in the message. I'd think a simple RegEx would do the trick "/\(From:.*\)\(<.*>.*\)/\1 [Safe] \2/" (or the likes) should do what you are needing. (Note: I've never used MIMEdefang and I'm not all that familiar with Perl RegExs, but that will work in vim and sed so I know that it is close to what you need in Perl.) Grant. . . . |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Grant Taylor wrote:
> > Use MIMEdefang to edit the From: header with in the message. > After a good night of sleep and a little talk with a co-worker I found out that my problem was in the syntax. I made a typo, a . where I should have used a , :$ So the [safe] is now put in place with mimedefang. One minor detail: it is completely replacing the From emailaddress with [safe]@serverhostname.domain.tld. If I use the sender header it works fine, but sender isn't used in a reply, so basicly it is worthless like this :-( Back to the drawing board I guess. Any other suggestions are appriciated! Peter |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On 03/14/08 05:01, Peter Postma - DCF wrote:
> After a good night of sleep and a little talk with a co-worker I found > out that my problem was in the syntax. > > I made a typo, a . where I should have used a , :$ *nod* Things like that happen to all of us. > So the [safe] is now put in place with mimedefang. One minor detail: it > is completely replacing the From emailaddress with > [safe]@serverhostname.domain.tld. If I use the sender header it works > fine, but sender isn't used in a reply, so basicly it is worthless like > this :-( That sounds very odd. > Back to the drawing board I guess. I would not give up on the path that you are on now just yet. > Any other suggestions are appriciated! Can you copy the contents of the header, modify it and then replace it? Also, what are you trying to put in place of the From: line? I've found that I need to put a lot of things in side of double quotes '"' to get them to work correctly on the From: line. I.e. From: "[Safe] John Doe" <john.doe@doefamilytree.com> Grant. . . . |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Grant Taylor wrote:
>> I made a typo, a . where I should have used a , :$ > > *nod* Things like that happen to all of us. > Yep, it just proves that we're only human. > > I would not give up on the path that you are on now just yet. > I am not giving up, but it might take sometime before I completely go to the bottom of this. Management saw what I did so far and decided that [safe] in the subject was a better solution after all, because users are already used to the addition of [SPAM] in the subject. Go figure ... >> Any other suggestions are appriciated! > > Can you copy the contents of the header, modify it and then replace it? > > Also, what are you trying to put in place of the From: line? I've found > that I need to put a lot of things in side of double quotes '"' to get > them to work correctly on the From: line. I.e. > I did try to work with different combinations of quotes, but they give results like [Safe]@hostname.domain.tld, [Safe] $From and [Safe]. I guess I will give it a rest for now. Thanks for you time and effort! Happy mailing ;-) Peter |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
Grant Taylor wrote:
> Use MIMEdefang to edit the From: header with in the message. > > I'd think a simple RegEx would do the trick "/\(From:.*\)\(<.*>.*\)/\1 > [Safe] \2/" (or the likes) should do what you are needing. (Note: I've > never used MIMEdefang and I'm not all that familiar with Perl RegExs, > but that will work in vim and sed so I know that it is close to what you > need in Perl.) If you still have problems and are using the regex above: /\(From:.*\)\(<.*>.*\)/\1 [Safe] \2/ this is no valid perl regex, use this one: /(From:.*)(<.*>.*)/$1 [Safe] $2/ However, in MIMEDefang you would probably need to do something like this: open(HEADER, 'HEADER'); while(<HEADER>) { if(/^From:\s*(.*)\s*(<[^<]*>)/) { my $cmt = $1; my $addr = $2; $cmt =~ s/^"//s; # deqote comment $cmt =~ s/"$//s; action_delete_all_headers('from'); action_add_header('from', "\"$cmt [SAFE]\" $addr"); last; } } close HEADER; |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
On 04/02/08 03:47, ska wrote:
> If you still have problems and are using the regex above: > > /\(From:.*\)\(<.*>.*\)/\1 [Safe] \2/ > > this is no valid perl regex, use this one: > > /(From:.*)(<.*>.*)/$1 [Safe] $2/ Thank you for the correction. Despite Regular Expressions being mostly regular, the nuances of each implementation is different. Perl's version will utterly bomb out in Vim, while Vim's version will utterly bomb out in Perl. Despite the method being the same, the syntax is different. ![]() Grant. . . . |
|
![]() |
| Outils de la discussion | |
|
|