PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > comp.mail.sendmail > add to senders real name
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.mail.sendmail Configuring and using the BSD sendmail agent.

add to senders real name

Réponse
 
LinkBack Outils de la discussion
Vieux 13/03/2008, 14h57   #1
Peter Postma - DCF
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut add to senders real name

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
  Réponse avec citation
Vieux 13/03/2008, 15h46   #2
Grant Taylor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: add to senders real name

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. . . .

  Réponse avec citation
Vieux 14/03/2008, 11h01   #3
Peter Postma - DCF
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: add to senders real name

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
  Réponse avec citation
Vieux 14/03/2008, 15h22   #4
Grant Taylor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: add to senders real name

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. . . .

  Réponse avec citation
Vieux 17/03/2008, 09h40   #5
Peter Postma - DCF
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: add to senders real name

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
  Réponse avec citation
Vieux 02/04/2008, 09h47   #6
ska
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: add to senders real name

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;
  Réponse avec citation
Vieux 02/04/2008, 15h15   #7
Grant Taylor
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: add to senders real name

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. . . .

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h52.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,20971 seconds with 15 queries