Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
Hi All,
I would like to learn language which used to write rulesets in the sendmail.cf file for write custom ruleset for mail routing. Pls send me any urls that will discribe thease?
Indika
Strictly speaking you're not supposed to update sendmail.cf but rather sendmail.mc then use m4 to "compile" it to the sendmail.cf.
Have a a look at /etc/mail/sendmail.mc for information on this.
From the top of /etc/mail/sendmail.mc on my FC4 workstations:
Quote:
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl # make -C /etc/mail
Thanks for your comment on this, I am really advised me to not to use sendmail.cf in free hand. Yes I believe that.
But I need to write my own rulesets for sendmail header rewriting and sending to given recepient via local mailer according to my own way. I need to study this mail ruleset written language because of this. Pls update me any way of learning this...
Thanks
I think you missed the point in my post. The point is you create the ruleset in the sendmail.mc then use m4 to make senmail.cf file based on what you wrote in the sendmail.mc. Otherwise you risk having someone down the road running the make on you and blowing away your cf modifications.
If you really want to figure out what it does when you do the make you can have a look at the include file that it uses (grep include /etc/mail/sendmail.cf) then look at the files that the include includes then look at the source for sendmail if it still doesn't make sense. It seems it would be a lot easier to work with the way it is designed than to try to go around it.
Thank you very much for the comment.
I have checked this But I couldnt find out any good information on writing rule-sets in sendmail.mc file in the web.
I you kone any link pls post it.
Thanks.
I know this is like 15 yrs later, but in case anyone reads this thread and is wondering for an answer to the OP's question:
The O'Reilly book entitled "Sendmail" (by Bryan Costales) has what you want.
It's huge (many pages) and has a complete breakdown of the ruleset language.
It's on 4th edition now, but I imagine the ruleset language hasn't changed much since the first edition, so you can probably find the earlier editions used for cheap.
I used it to learn sendmail.cf back in the day (1990s) when I was a systems administrator of Silicon Graphics machines, where configuring sendmail.cf was done by hand, and necessary to get mail flowing out dialup modems over PPP. My first edition copy had 792 pages, so it's a monster. I did learn it though.. wackiest syntax I ever had to learn.. and that includes regex and assembly language.
Originally on HP-UX when I wanted to do a mailer table setup I had to edit the sendmail.cf as that was all they provided. The problem I ran into modifying that was that spaces/tabs/positions within it were important and I didn't have a good guide at the time for what they should be so had to trial and error to get them right.
Later on Linux I saw sendmail.mc and also HP later provided that in one of their Sendmail for HP-UX updates. My advice to the OP was telling him it was a lot easier to modify sendmail.mc and compile it so it would deal with the sendmail.cf spacing and formatting atuomatically rather than doing a direct edit of sendmail.cf itself. Some 12 years later I still think that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.