Changing sendmail source address
Maybe an odd request, but still a legit one.
I need to change the 'from' address for mail coming from some users. I've tried using the 'genericstable' and 'genericsdomain' options. So far nothing is working.
I added the following options to the *.mc file I used to create the sendmail.cf file.
In genericsdomain I listed only the hostname of the server. I created /etc/mail/genericstable.tmp, which contains the following lines:
I used the makemap command create genericstable.db, which is referenced in the sendmail.cf.
Yet, when I send a message from root or daemon the genericstable isn't used. I'm stumped on this and would appreciate any hep someone can lend.
I am not sure that genericstable is what you want. You need to masquerade the domains. Sorry I cannot really help you any more... I have never done this manually. I have always used Webmin to do it for me... :D
Hope I helped. Good luck.
I have masquerading set up for the domains. That was easy enough to get going. But now what I need to do is something similar on a per-user basis.
I found some instructions on how to do this at:
Look for "Sendmail Masquerading Explained"
Despite following these instructions I still can't get this thing to work.
Masquerading will work on a per domain basis. Other than that, I do not know what to tell you. You might try another mail server such as Postfix.
Finally got it working, so if anyone else is trying to do the same thing this is what you have to do:
Add the following to your mc file used to generate sendmail.cf:
FEATURE(`genericstable', `dbm /etc/mail/genericstable')dnl
Of course you can change the names of the files to be what you want. These are only suggestions.
use the m4 command to do this. While in /usr/samples/tcpip/sendmail.cf run the command:
m4 ../m4/cf.m4 your.mc > /tmp/sendmail.cf
vi /etc/mail/genericstable. Add the users you want to change the email address for. The format is 'user firstname.lastname@example.org'. The file is tab delimited.
After you have made the file use the makemap command to get it ready for sendmail to use. 'makemap dbm genericstable < genericstable'
Run the following command as root:
sendmail -bt -d0.1 < /dev/null
This will give you an idea of what you need to place in the genericsdomain file. This does not need to have anything done to it, so just leave the file as it is.
Move sendmail.cf into place
Now that everything else is done, move /tmp/sendmail.cf to /etc/mail. Restart sendmail if it is actively running on the system.
|All times are GMT -5. The time now is 07:54 AM.|