Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
I am looking for the syntax for a sendmail ruleset to log the message subject to the syslog service. I have found a few posts on the web, but none seem to work. The basic appear to be - add the following to the sendmail.mc file then compile the sendmail.cf file using M4. The syntax suggested follows (I believe the rewrite rule is incorrect)(I and using <T> to indicate tabs):
The post you referenced was one of the spots I found and tried. Must either be a typo or some other config issue. I am using slackerware 13 running sendmail version 8.14.3. I have retyped the lines into my .mc file (made a copy of the sendmail-slackware.mc file under /usr/share/sendmail/cf/cf called sendmail-slackware-subject-logging.mc. I then run the M4 compiler using the command line:
m4 sendmail-slackware-subject-logging.mc >sendmail-slackware-sunject-logging.cf
After compiling with no warnings or errors, copy the .cf file to /etc/mail/ (original was renamed to preserve it)
I then cd to /etc/mail and copy the sendmail-slackware-subject-logging.cf to sendmail.cf then restart sendmail.
when I send a test message, the message gets delivered - but no subject is logged to /var/log/maillog
Am I doing something in the wrong order?
could I have missed some prerequisite set related to syslog levels?
I'm also using Slackware (it's 13.1 and sendmail version is 8.14.4, but I guess it doesn't matter). I've tested both variations in that post and they both work.
Just note that you have to add the code at the end of the .mc file (I'm using sendmail-slackware-tls-sasl.mc where there is already a LOCAL_CONFIG for ssl), after the MAILER definitions.
Does anyuone have a breakdown of the rewrite rule and how it is parsed?
I guess you mean where it's written in sendmail.cf. If that's the case, then using your .mc, I have in the resulting sendmail.cf:
starting from line 171:
Code:
Klog syslog
HSubject: $>+CheckSubject
# Configuration version number
DZ8.14.4
When asking about the breakdown of the rewrite rule - I should have been more clear. I was hoping for explanations of both the RHS and LHS of the rewrite rule.
I took a stab at moving the line with the HSubject:... down below the LOCAL_RULESETS line and now it logs the subject in the /var/log/maillog file as expected.
Thanks for all the assistance. Hope I wasn't too big a pain in the @$$!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.