Cannot configure sendmail masquerading on Solaris 10
Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Rep:
Cannot configure sendmail masquerading on Solaris 10
Hi.
I'm configuring sendmail on a Solaris 10 05/08 and I've got the following problem: when I send a mail from the mail server the mail appears as sent by hostname.mysubdomain.mydomain.com, which is the FQDN of that machine. Reading sendmail documentation, and Googling a whole day (while banging my head on my desk), I thought I could just masquerade the hostname. The strange thing is that it appear to work when testing the configuration but than it fails.
I'm configuring sendmail on a Solaris 10 05/08 and I've got the following problem: when I send a mail from the mail server the mail appears as sent by hostname.mysubdomain.mydomain.com, which is the FQDN of that machine. Reading sendmail documentation, and Googling a whole day (while banging my head on my desk), I thought I could just masquerade the hostname. The strange thing is that it appear to work when testing the configuration but than it fails.
I receive a mail where the From is indeed enrico@mydomain.com. The previous commands logs:
Code:
Connecting to aspmx.l.google.com. via esmtp...
220 mx.google.com ESMTP 28si2840019eyg.45
>>> EHLO hostname.mysubdomain.mydomain.com
250-mx.google.com at your service, [84.127.228.172]
250-SIZE 35651584
250-8BITMIME
250-ENHANCEDSTATUSCODES
250 PIPELINING
>>> MAIL From:<enrico@mydomain.com> SIZE=5
250 2.1.0 OK 28si2840019eyg.45
>>> RCPT To:<enrico@mydomain.com>
>>> DATA
250 2.1.5 OK 28si2840019eyg.45
354 Go ahead 28si2840019eyg.45
>>> .
250 2.0.0 OK 1236991822 28si2840019eyg.45
enrico@mydomain.com... Sent (OK 1236991822 28si2840019eyg.45)
Closing connection to aspmx.l.google.com.
>>> QUIT
221 2.0.0 closing connection 28si2840019eyg.45
I then compile the mc file, disable sendmail, copy the configuration in /etc/mail/sendmail.cf, restart the service but sendmail behaves differently:
Code:
(trim)
050 250-mx.google.com at your service, [84.127.228.172]
050 250-SIZE 35651584
050 250-8BITMIME
050 250-ENHANCEDSTATUSCODES
050 250 PIPELINING
050 >>> MAIL From:<enrico@hostname.mysubdomain.mydomain.com> SIZE=342
050 250 2.1.0 OK 5si2838297eyf.22
(trim)
I really cannot understand what happens here!
Have you got some ideas?
I feel your pain....and it's not just on Solaris either. Sendmail is indeed a black art, and the books available on the subject are well worth getting.
Check out the /etc/mail/domaintable file (see here http://www.sendmail.org/m4/features.html for more info). That may help you out. I know I chased this around for quite a while too.
I *THINK* I remember there being a quick-n-dirty solution: I edited the /etc/mail/sendmail.cf file (yes, I know...bad practice indeed), but changed the Dj directive from:
Code:
Djdomain.com
to
Code:
Dj domain.com
The space seemed to make a difference, if I remember correctly. I've slept since then.
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Original Poster
Rep:
Thanks TB0ne, yesterday was so loooong that... I cannot even tell...
By the way, thanks for the information you posted. I was reading the Sendmail Cookbook, that's why I was so sure that it would work. Sendmail documentation and that book are both so clear...
I'll also take a look at the domaintable stuff: it seemed "overkill" just for masking an hostname, that's why I stuck trying all of the possible permutations of MASQUERADING_* and FEAUTURE that I could figure out but I failed finding something that works. Worse: it works when invoked with -bt, as I told you, but then... nothing.
One thing: I wanted to try your "dirty trick" to see if I could sleep well too but surprise! My generated cf file has no Dj... option whatsoever! Should it be there in your opinion? Have MASQUERADE_* directive some effect on it?
Thanks TB0ne, yesterday was so loooong that... I cannot even tell...
By the way, thanks for the information you posted. I was reading the Sendmail Cookbook, that's why I was so sure that it would work. Sendmail documentation and that book are both so clear...
I'll also take a look at the domaintable stuff: it seemed "overkill" just for masking an hostname, that's why I stuck trying all of the possible permutations of MASQUERADING_* and FEAUTURE that I could figure out but I failed finding something that works. Worse: it works when invoked with -bt, as I told you, but then... nothing.
One thing: I wanted to try your "dirty trick" to see if I could sleep well too but surprise! My generated cf file has no Dj... option whatsoever! Should it be there in your opinion? Have MASQUERADE_* directive some effect on it?
Thanks in advance,
Enrico
Well, if you can afford a quick bounce to sendmail, adding a Dj option is a quick thing to try.
The domaintable thing, though, is cleaner, and while it does seem like overkill, it does bring some far greater flexibility to the party, in case you need it later.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.