LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2007, 06:13 AM   #1
lasantha
Member
 
Registered: Oct 2005
Location: Sri Lanka
Distribution: Red Hat, Cent OS
Posts: 38

Rep: Reputation: 16
Thumbs down sendmail.cf mail rule written language


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
 
Old 02-24-2007, 07:33 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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
 
Old 02-26-2007, 12:10 AM   #3
lasantha
Member
 
Registered: Oct 2005
Location: Sri Lanka
Distribution: Red Hat, Cent OS
Posts: 38

Original Poster
Rep: Reputation: 16
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
 
Old 02-26-2007, 10:08 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.
 
Old 02-27-2007, 12:10 AM   #5
lasantha
Member
 
Registered: Oct 2005
Location: Sri Lanka
Distribution: Red Hat, Cent OS
Posts: 38

Original Poster
Rep: Reputation: 16
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.
 
Old 09-04-2019, 01:52 PM   #6
erco
LQ Newbie
 
Registered: Nov 2018
Posts: 2

Rep: Reputation: Disabled
Sendmail O'Reilly book

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.
 
Old 09-06-2019, 11:52 AM   #7
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make Sendmail forward all incoming mail to localhost port 26 (Domino mail) speedgelb Linux - Software 3 09-27-2013 10:18 AM
Import Mail from /var/spool/mail (sendmail) to a MailDir Format in Postfix shawnbishop Linux - Software 0 04-06-2006 10:44 AM
What language was the unreal tournament installer written in? Onemessedupjedi Programming 2 07-05-2004 01:48 AM
How to control the rule of netfilter using C language? bobowd Linux - General 1 06-07-2002 10:32 PM
Sendmail - RunAsUser=sendmail:mail/What files to i have to change ForumKid Linux - Security 45 01-18-2002 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration