how to remove hostname for outgoing mails
Hi
I do have Messaging Server 6.2 running on Solaris. So far everything works fine. The only thing I couldn't figure out from the documentation is how I can send mails and remove the hostname. On sendmail I did this with the masquarading but I'm stuck with the messaging server.
When I send a mail from a script from this box than thesender is:
root@ford.kriz.ch
but I like to have for every user it should look likeuser@kriz.ch.
I tried different stuff around following lines:
$* $A$E$F$U%$H$V$H@ford.kriz.ch
ford.kriz.ch $U%$D@ford.kriz.ch
kriz.ch $U%$D@ford.kriz.ch
I beliefe it is a simple line I have to add but so far all my combinatioins are successless.
It would be greate getting a hint.
Many thanks
Robert
[819 byte] By [
voojagiga] at [2007-11-27 10:52:27]

# 1
Hi,
> I do have Messaging Server 6.2 running on Solaris. So
> far everything works fine. The only thing I couldn't
> figure out from the documentation is how I can send
> mails and remove the hostname. On sendmail I did this
> with the masquarading but I'm stuck with the
> messaging server.
> When I send a mail from a script from this box than
> the sender is:
> root@ford.kriz.ch
> but I like to have for every user it should look like
> user@kriz.ch.
> I tried different stuff around following lines:
>
> $* $A$E$F$U%$H$V$H@ford.kriz.ch
> ford.kriz.ch $U%$D@ford.kriz.ch
> kriz.ch $U%$D@ford.kriz.ch
>
> I beliefe it is a simple line I have to add but so
> far all my combinatioins are successless.
>
> It would be greate getting a hint.
Something to try is the following:
You can test the change
$* $A$E$F$U%$H$V$H@ford.kriz.ch
ford.kriz.ch $R$U%kriz.ch@ford.kriz.ch
ford.kriz.ch $U%$D@ford.kriz.ch
kriz.ch $U%$D@ford.kriz.ch
The $R means 'only apply to reverse pointing addresses' namely envelope mail from: and header From: Sender: Resent-From: addresses.
Regards,
Shane.
# 2
Hi Shane
that does the trick. Many thanks.
Just a smal followup question. I sent a mail from my cgi and noticed that in my mail client it shows the smart name like:
"WebServer Reserved UID" and reply adress is robert@kriz.ch
The "Web.." comes from /etc/passwd and the user is because I assigned root as alternate address to robert in the LDAP. I guess this is the way it should work.
The main reason for the rewrite rule was, because some providers reject mails if they can not validate the senders email.
Thanks a lot
Robert
Message was edited by:
voojagig
# 3
Hi,
> that does the trick. Many thanks.
Good to hear. Rewrite rules can be tricky to get your head around.
> Just a smal followup question. I sent a mail from my
> cgi and noticed that in my mail client it shows the
> smart name like:
>
> "WebServer Reserved UID" and reply adress is
> robert@kriz.ch
> The "Web.." comes from /etc/passwd and the user is
> because I assigned root as alternate address to
> robert in the LDAP. I guess this is the way it should
> work.
>
> The main reason for the rewrite rule was, because
> some providers reject mails if they can not
> validate the senders email.
I'm a little unsure as to what the question/problem is. If I can hazard a guess, the email is being 'rewritten' a little more then you would like namely:
root@ford.kriz.ch -> root@kriz.ch (due to rewrite rule above) -> robert@kriz.ch
The last step would be due to the default behaviour of rewriting mailalternateaddress: attributes to mail: attribute. So if you specified root@kriz.ch as a mailalternateaddress: then and the mail: address was robert@kriz.ch then yep, it's to be expected.
To get around this change the "mailalternateaddress: root@kriz.ch" to be "mailequivalentaddress: root@kriz.ch". The major difference between these two user attributes is that the default rewriting behaviour doesn't occur.
If the above is off the mark, please clarify you problem/question.
Regards,
Shane.
# 4
Hi
so far everything works fine and I do understand it. If the mail leaves as robert or root doesn't matter. As long other mail servers can verify the sender and do not reject mails. To make further changes to have the sender as root or whatever is more cosmetic to hide me as a sender.
I will go for an other user in the ldap called system and will then make alternate addresses such as root and webservd. That way all system mails will leave as user system. Which will be good for security reasons.
Now I have a perfect and secure solution and the mails aren't rejected any more. (Need to verify this, but it should work now)
Many thanks for your perfect support !!!!!! You helped me a lot.
Robert