Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to find the from: field in sendmail

Status
Not open for further replies.

dpanimal

Programmer
Feb 1, 2008
3
0
0
I am trying to locate the config file that stores the setting for the from: field in the sendmail program on a sco box. I tried to manually overwrite it with mutt by using a .muttrc file but that doesn't seem to work.

Thanks
 
I don't know where it would be in your path but you want to open sendmail.mc with your favorite text editor. It may also be called something else. I just chose sendmail.mc because that is the most common. Sendmail will use the server's name in the from address by default. The server is usually specified in the mail client's configs. If you are using a text client or command line it uses the hostname. You didn't specify why you wanted to know so I'd have to guess and I could be wrong a lot of times before I hit the right one so I'll pass. ...But after thinking about it, I can't just let you sit there with an open file can I? If you want to have all the mail from your server show the same from: address, you can use the MASQUERADE_AS directive. Edit or add this line:

Code:
MASQUERADE_AS(`mydomain.com')dnl

There may be a 'dnl' in front of the line. That means it is commented out. Basically it's telling the macro compiler to disregard until it comes to a new line. If it's commented out, just remove the dnl. There are other forms of this directive but this one just modifies the domain part of the address. Other can modify the header or envelope. When you are done, close the file. You're gonna find out sooner or later so I might as well tell you now. Sendmail is never going to see or use this file. It needs to be compiled with other mc files to create a config file called sendmail.cf. There are a few ways to do it but the most common is to use the m4 macro compiler. It already knows where all the mc files are. It just needs to know where this particular one is. It is rare that the other mc files get edited. The command is very simple:

Code:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

This is the path on most linux disros. I'm not sure about unix so you will have to change it to whatever you path is. If you are in the same directory as both sendmail.mc and sendmail.cf, obviously you don't need the path. If this is nowhere near what you are asking, can you be a little more specific on what you are trying to do. Sometimes knowing why you want to do something is even more important the knowing what because we may be able to do it a better way.

 
Thanks RythmAce,

I found the stupid switch for mutt that allows me to change the from: field. I added the -F switch

I used mutt -F /usr/app/p/.muttrc

and .muttrc had

my_hdr from: username <username@company.com>

dpanimal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top