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 > Sender address user@mydomain.de instead of user@host.mydomain.de?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.mail.sendmail Configuring and using the BSD sendmail agent.

Sender address user@mydomain.de instead of user@host.mydomain.de?

Réponse
 
LinkBack Outils de la discussion
Vieux 18/09/2006, 14h32   #1
Pete
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Sender address user@mydomain.de instead of user@host.mydomain.de?

Hi all,

we're using Version 8.11.6p2 on AIX 5.3.

The subject says what's the problem: When I send an e-mail via
/usr/bin/mail from an AIX-Partition to our internal mail relay, this
mail arrives with a sender address user@host.mydomain.de. We would like
to have user@mydomain.de, i.e. the hostname should not appear in the
sender address.

I'v tried compiling different settings in
/usr/samples/tcpip/sendmail/cf/aixsample.cf (MASQUERADE_AS, etc....)
with no success. Sendmail seems to be tooo complicated for me :-(

Any ideas? Thanks in advance!

Pete

  Réponse avec citation
Vieux 18/09/2006, 15h03   #2
mega
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

Pete wrote:
> Hi all,
>
> we're using Version 8.11.6p2 on AIX 5.3.
>
> The subject says what's the problem: When I send an e-mail via
> /usr/bin/mail from an AIX-Partition to our internal mail relay, this
> mail arrives with a sender address user@host.mydomain.de. We would like
> to have user@mydomain.de, i.e. the hostname should not appear in the
> sender address.
>
> I'v tried compiling different settings in
> /usr/samples/tcpip/sendmail/cf/aixsample.cf (MASQUERADE_AS, etc....)
> with no success. Sendmail seems to be tooo complicated for me :-(


:-(

OK try

http://www.sendmail.org/m4/masquerading_relaying.html

As you don't show us the relevant .mc file that is all we can do for now.

cheers

Erich
  Réponse avec citation
Vieux 18/09/2006, 15h58   #3
Pete
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

mega schrieb:

> Pete wrote:
> > Hi all,
> >
> > we're using Version 8.11.6p2 on AIX 5.3.
> >
> > The subject says what's the problem: When I send an e-mail via
> > /usr/bin/mail from an AIX-Partition to our internal mail relay, this
> > mail arrives with a sender address user@host.mydomain.de. We would like
> > to have user@mydomain.de, i.e. the hostname should not appear in the
> > sender address.
> >
> > I'v tried compiling different settings in
> > /usr/samples/tcpip/sendmail/cf/aixsample.cf (MASQUERADE_AS, etc....)
> > with no success. Sendmail seems to be tooo complicated for me :-(

>
> :-(
>
> OK try
>
> http://www.sendmail.org/m4/masquerading_relaying.html
>
> As you don't show us the relevant .mc file that is all we can do for now.
>


Hi Erich,

thanks, I was already poking around in the sendmail manuals.

IBM ships the file /usr/samples/tcpip/sendmail/cf/aixsample.mc with
AIX:

.....
# Sample AIX file
divert(0)dnl
OSTYPE(aixsample)dnl
FEATURE(genericstable)dnl
FEATURE(mailertable)dnl
FEATURE(virtusertable)dnl
FEATURE(domaintable)dnl
FEATURE(allmasquerade)dnl
FEATURE(promiscuous_relay)dnl
FEATURE(accept_unresolvable_domains)dnl
FEATURE(accept_unqualified_senders)dnl
FEATURE(no_default_msa)
DOMAIN(generic)dnl
define(`confSMTP_LOGIN_MSG', `$j Sendmail $b')
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(uucp)

In the README they specify an exact order how to put things together
but MASQUERADE_AS or the other decalarations are not mentioned.

Which declaration(s) do I have to add and where?

Thanks

Pete

  Réponse avec citation
Vieux 19/09/2006, 07h23   #4
mega
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

Pete wrote:
...

>
> Hi Erich,
>
> thanks, I was already poking around in the sendmail manuals.
>
> IBM ships the file /usr/samples/tcpip/sendmail/cf/aixsample.mc with
> AIX:


Yes I looked at it on an AIX 5.3, poorly documented, but there is always
sendmail.org

>
> ....
> # Sample AIX file
> divert(0)dnl
> OSTYPE(aixsample)dnl
> FEATURE(genericstable)dnl
> FEATURE(mailertable)dnl
> FEATURE(virtusertable)dnl
> FEATURE(domaintable)dnl




> FEATURE(allmasquerade)dnl


Not sure you need the allmasquerade

according to the sendmail docs something like the following

If you want to masquerade all hosts in the domain, use this feature

FEATURE(`masquerade_entire_domain')dnl

MASQUERADE_AS(`host.domain')dnl

should be enough to masquerade your host, if you need to masquerade more
hosts add

MASQUERADE_DOMAIN(`otherhost.domain')dnl

> FEATURE(promiscuous_relay)dnl


this one is dangerous, it opens up your MTA

.....

But then all this is explained at sendmail.org, a lot better than I
could ever do.

cheers

Erich


  Réponse avec citation
Vieux 19/09/2006, 12h12   #5
Pete
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

Hi,

just to clarify things: Sendmail on this partition doesn't act as an
MTA for other hosts. In fact, sendmail isn't running at all. I've seen
that it's started for a short moment when I run /usr/bin/mail. The AIX
partition is just an SMTP client and wants to send mails to our MTA
(MS-Exchange).

Of course I've checked sendmail.org but isn't that easy to understand
.....

My aixsample.mc looks like this now, but the MASQUERADE_AS option seems
not to have any effect:

# Sample AIX file
divert(0)dnl
OSTYPE(aixsample)dnl
FEATURE(genericstable)dnl
FEATURE(virtusertable)dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(accept_unresolvable_domains)dnl
FEATURE(accept_unqualified_senders)dnl
FEATURE(no_default_msa)
MASQUERADE_AS(`mydomain.de')dnl
DOMAIN(generic)dnl
define(`confSMTP_LOGIN_MSG', `$j Sendmail $b')
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(uucp)

When I send a mail on this partition I get the following (I changed our
real domain to mydomain.de ;-)):

root@aixutil: /etc/mail # mail -v -s Test user@mydomain.de < /dev/zero
Null message body; hope that's ok
user@mydomain.de... Connecting to mail.mydomain.de. via esmtp...
220 ntex1.mydomain.de ESMTP Server (Microsoft Exchange Internet Mail
Service 5.5.2657.72) ready
>>> EHLO host.mydomain.de

250-ntex1.mydomain.de Hello [host.mydomain.de]
250-XEXCH50
250-
250-ETRN
250-DSN
250-SIZE 0
250-AUTH LOGIN
250 AUTH=LOGIN
>>> MAIL From:<root@host.mydomain.de> SIZE=48

250 OK - mail from <root@host.mydomain.de>; can accomodate 48 bytes
>>> RCPT To:<user@mydomain.de>

250 OK - Recipient <user@mydomain.de>
>>> DATA

354 Send data. End with CRLF.CRLF
>>> .

250 OK
user@mydomain.de... Sent (OK)
Closing connection to mail.mydomain.de.
>>> QUIT

221 closing connection
root@host: /etc/mail #

In the EHLO and the Mail From lines we still have the host.... :-(

Any ideas? TIA

Pete

  Réponse avec citation
Vieux 19/09/2006, 13h59   #6
artinghan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

Edit /etc/sendmail.cf

Rule set 93 & 94 (masquerade)

Replace $j (host.domain) by $m (domain)

!!!Here under are these 2 Rule sets, I putted the modification between
double-quote("$m"). Don't put these double-quote but rather what they
contain!!!
################################################## #################
### Ruleset 93 -- convert header names to masqueraded form ###
################################################## #################

S93

# handle generics database
#R$+ < @ $=G . > $: < $1@$2 > $1 < @ $2 . > @ mark
#R$+ < @ *LOCAL* > $: < $1@$j > $1 < @ *LOCAL* > @ mark
#R< $+ > $+ < $* > @ $: < $(generics $1 $: $) > $2 < $3 >
#R< > $+ < @ $+ > $: < $(generics $1 $: $) > $1 < @ $2 >
#R< $* @ $* > $* < $* > $@ $>3 $1 @ $2 found qualified
#R< $+ > $* < $* > $: $>3 $1 @ *LOCAL* found
unqualified
#R< > $* $: $1 not
found

# special case the users that should be exposed
R$=E < @ *LOCAL* > $@ $1 < @ "$m" . > leave exposed
R$=E < @ $=M . > $@ $1 < @ $2 . >
R$=E < @ $=w . > $@ $1 < @ $2 . >

# handle domain-specific masquerading
R$* < @ $=M . > $* $: $1 < @ $2 . @ $M > $3 convert
masqueraded doms
R$* < @ $=w . > $* $: $1 < @ $2 . @ $M > $3
R$* < @ *LOCAL* > $* $: $1 < @ "$m" . @ $M > $2
R$* < @ $+ @ > $* $: $1 < @ $2 > $3 $M is null
R$* < @ $+ @ $+ > $* $: $1 < @ $3 . > $4 $M is not null


################################################## #################
### Ruleset 94 -- convert envelope names to masqueraded form ###
################################################## #################

S94
R$* < @ *LOCAL* > $* $: $1 < @ "$m" . > $2


compile sendmail.cf by the command: sendmail -bi

refresh -s sendmail

Hope this .

  Réponse avec citation
Vieux 19/09/2006, 15h39   #7
Pete
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

Hi,

many thanks, that works!!! I would have never been able to solve this
on my own.

Thanks again + kind regards

Pete

  Réponse avec citation
Vieux 19/09/2006, 16h10   #8
mega
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

Pete wrote:
> Hi,
>
> just to clarify things: Sendmail on this partition doesn't act as an
> MTA for other hosts. In fact, sendmail isn't running at all. I've seen
> that it's started for a short moment when I run /usr/bin/mail. The AIX
> partition is just an SMTP client and wants to send mails to our MTA
> (MS-Exchange).
>
> Of course I've checked sendmail.org but isn't that easy to understand
> ....
>
> My aixsample.mc looks like this now, but the MASQUERADE_AS option seems
> not to have any effect:
>
> # Sample AIX file
> divert(0)dnl
> OSTYPE(aixsample)dnl
> FEATURE(genericstable)dnl
> FEATURE(virtusertable)dnl
> FEATURE(masquerade_entire_domain)dnl
> FEATURE(masquerade_envelope)dnl
> FEATURE(accept_unresolvable_domains)dnl
> FEATURE(accept_unqualified_senders)dnl
> FEATURE(no_default_msa)
> MASQUERADE_AS(`mydomain.de')dnl
> DOMAIN(generic)dnl
> define(`confSMTP_LOGIN_MSG', `$j Sendmail $b')
> MAILER(local)dnl
> MAILER(smtp)dnl
> MAILER(uucp)
>
> When I send a mail on this partition I get the following (I changed our
> real domain to mydomain.de ;-)):
>
> root@aixutil: /etc/mail # mail -v -s Test user@mydomain.de < /dev/zero
> Null message body; hope that's ok
> user@mydomain.de... Connecting to mail.mydomain.de. via esmtp...
> 220 ntex1.mydomain.de ESMTP Server (Microsoft Exchange Internet Mail
> Service 5.5.2657.72) ready
>>>> EHLO host.mydomain.de

> 250-ntex1.mydomain.de Hello [host.mydomain.de]
> 250-XEXCH50
> 250-
> 250-ETRN
> 250-DSN
> 250-SIZE 0
> 250-AUTH LOGIN
> 250 AUTH=LOGIN
>>>> MAIL From:<root@host.mydomain.de> SIZE=48

> 250 OK - mail from <root@host.mydomain.de>; can accomodate 48 bytes
>>>> RCPT To:<user@mydomain.de>

> 250 OK - Recipient <user@mydomain.de>
>>>> DATA

> 354 Send data. End with CRLF.CRLF
>>>> .

> 250 OK
> user@mydomain.de... Sent (OK)
> Closing connection to mail.mydomain.de.
>>>> QUIT

> 221 closing connection
> root@host: /etc/mail #
>
> In the EHLO and the Mail From lines we still have the host.... :-(
>
> Any ideas? TIA


You did compile sendmail.cf from this and install it to /etc/mail?

cheers

Erich

  Réponse avec citation
Vieux 19/09/2006, 16h40   #9
Pete
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

I edited /etc/mail/sendmail.cf directly.

Suppose "sendmail -bi" wouldn't have been necessary, since according to
the man page this builds a new alias database from /etc/mail/aliases
and I didn't change any alias.

Regards

Pete

  Réponse avec citation
Vieux 20/09/2006, 08h57   #10
Pete
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

I got another solution from a ful guy.


See below the changes in my sendmail.cf on AIX 5.3:

.....
# who I masquerade as (null for no masquerading) (see also $=M)
DMmydomain
.....

# class E: names that should be exposed as from this host, even if we
masquerade
# class L: names that should be delivered locally, even if we have a
relay
# class M: domains that should be converted to $M
# class N: domains that should not be converted to $M
#CL root
#CE root

.....

################################################## #################
### Ruleset 94 -- convert envelope names to masqueraded form ###
################################################## #################

SMasqEnv=94
R$+ $@ $>MasqHdr $1
#R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2

......

Of course if sendmail is running you have to refresh it:

refresh -s sendmail

Pete

  Réponse avec citation
Vieux 20/09/2006, 14h59   #11
mega
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

Pete wrote:
> I got another solution from a ful guy.
>
>
> See below the changes in my sendmail.cf on AIX 5.3:
>
> ....
> # who I masquerade as (null for no masquerading) (see also $=M)
> DMmydomain
> ....
>
> # class E: names that should be exposed as from this host, even if we
> masquerade
> # class L: names that should be delivered locally, even if we have a
> relay
> # class M: domains that should be converted to $M
> # class N: domains that should not be converted to $M
> #CL root
> #CE root
>
> ....
>
> ################################################## #################
> ### Ruleset 94 -- convert envelope names to masqueraded form ###
> ################################################## #################
>
> SMasqEnv=94
> R$+ $@ $>MasqHdr $1
> #R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
>
> .....
>
> Of course if sendmail is running you have to refresh it:
>
> refresh -s sendmail


It is generally frowned upon to hack the .cf file directly, because
migration tends to become a nightmare in the long run.

Erich
  Réponse avec citation
Vieux 21/09/2006, 10h00   #12
Pete
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

Maybe it's not the cleanest approach. But if you have two solutions by
doing it this way and zero solutions the other way, which one would you
prefer?

Thanks + kind regards

Pete

  Réponse avec citation
Vieux 21/09/2006, 23h13   #13
Per Hedeland
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Sender address user@mydomain.de instead of user@host.mydomain.de?

In article <1158829253.019948.191690@h48g2000cwc.googlegroups .com>
"Pete" <pete-aix@gmx.eu> writes:
>Maybe it's not the cleanest approach. But if you have two solutions by
>doing it this way and zero solutions the other way, which one would you
>prefer?


First, please visit: http://cfaj.freeshell.org/google/

Second, there are multiple solutions the "the other way", but the
specifically recommended/preferred one is to use MASQUERADE_AS(). The
most likely reason it didn't work for you is that a) you were sending
mail as root (never a good idea), and b) your .mc file had the line

DOMAIN(generic)dnl

which says to include the file cf/domain/generic.m4, which at least in
the original sendmail distribution has the line

EXPOSED_USER(`root')

--Per Hedeland
per@hedeland.org
  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 10h56.


É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,19765 seconds with 21 queries