Sendmail 'From' header rewrite
Our mailserver is on host 'castor', but we have only one registered domain name: mail.foo.bar.
When I write a mail with the mail command:
the from address is correctly rewritten: firstname.lastname@example.org, and the mail is sent.
However, when I use pine or any other MUA on castor, the From address is always rewritten as castor.foo.bar, and the mails are rejected by our ISP ('Sender domain must exist')
Why are mails sent by mail rewritten differently than those sent by pine, mutt, or neomail and the like?
How can I make sendmail to always rewrite the from header as 'mail.foo.bar'? (Or rather not to rewrite the header at all, as pine is already configured to use mail.foo.bar as From header)
Cool! Did you notice that in your post, when you wrote email@example.com, it only automatically hyperlinked everything until the "inte" and left out the rnet in internet...why is that? because there can only be a maximum of four letters in a top level domain, and the automatic hyperlinker knows that? hmmm...
Now back to your problem...i'm not sure if this would solve your problem, but try it
go to /etc/mail/ and look at sendmail.mc (or whatever your m4 config file is, ending in ".mc")
go to the end, and if you are using RH9 and looking at the config that came with the kernel, you should see:
Then, compile sendmail.mc into sendmail.cf
On my machine, i simply use
m4 sendmail.mc > sendmail.cf
and then restart your sendmail server...not sure if the m4 step would apply to you or not (RH9 i have)
Is it possible to do this by directly editing sendmail cf?
It was not me who setup this sendmail, and seems to have made all his changes by directly editing sendmail.cf, or he may have generated sendmail.cf on his own machine, as I cannot find any .mc file the settings in which would be at least close to those found in sendmail.cf.
Actually, the only .mc file I find does not contain the lines on masquerading at all, so there is nothing to uncomment.
Can I add those lines to the mc file?
Would I reset other settings in the present sendmail.cf file if I run the m4 macro on a seemingly incomplete .mc file or an mc file that only contains the masquerading lines?
Meanwhile I tried
m4 sendmail.mc > sendmail.cf
and it did nothing but inserted the lines of sendmail.mc in sendmail.cf exactly as they look like in the .mc file
Thats a slight problem...
If i were you, I would first save a copy of the original sendmail.cf file. Then, in the sendmail.mc file, make sure you have the line at the top of the file, after "divert(-1)dnl":
If it produces a sendmail.cf file, then yay!
Then just add the MASQUERADE lines into the .mc file, and do m4 again, and restart sendmail.
Oh yah, you can try editing sendmail.cf directly, but don't blame me for the headaches. :) There are lots of sources on the internet, just google for them. Maybe there's something about how to add MASQUERADE into .cf, but i've never tried, or thought about trying. Have fun
Well, looking more closely into the present sendmail.cf I see it was generated on 03/02/2000 somewhere in Germany by a German guy for a previous sendmail version (all mc file versions used for generating the sendmail.cf are ancient).
We (me and the server) are in Hungary in 08/22/2003 with a newer sendmail version, so it seems that the guy who installed sendmail on this server simply google searched the web for a sample sendmail.cf then made some manual corrections to it until it began to work.
So I think I had better start with the clean mc files and configure everything from the beginning.
Meanwhile I am getting familiar with the m4 macro, now I know how to generate a sendmail.cf :-).
For what its worth, here's the mc file that came with my RH9, so you can have a starting point:
Thanx for your help!
I could solve the problem, it actually turned out to be a misconfiguration in sendmail.cf.
I pulled together a site mc file from scratch, and built a new sendmail.cf.
I also took the occasion to download, compile and install a new version of sendmail.
The RTFM operations took several hours, but now everything works.
Another way (quick and dirty) would be to edit .pinerc in your home directory and set
to whatever you want . Ie "user-domain=domain.bhah".
But the better way is to do what you did - regenerate your MC from scratch after RTFM. You learn much more that way. Will take awhile but in the long run your better off.
|All times are GMT -5. The time now is 02:55 AM.|