Make sendmail read the SMART_HOST from a file
NB: This is a 'I need something which works and it needs to be a text
file with a simple format' solution. I don't claim that it is
particularly elegant or that better solutions to the same problem are
In order to facilitate setting the value mentioned in the Subject:
from a web less-than-masterfully programmed web interface, I needed to
change a 'stock' Debian sendmail configuration such that it reads that
from a file. This can be done by creating a text file with the
following (example) content (assumed to be /etc/mail/smart-host):
Then, a suitable text map needs to be defined in sendmail.cf (going
via any route you're comfortable with)
Ksmart_host text -v1 -k0 /etc/mail/smart-host
Then, a ruleset needs to be defined in order to use this map. This
ruleset is supposed to be called from the Parse1 ruleset instead of
just expanding $S:
R$+ $: $(smart_host 0$) $1
Lastly, the two lines using $S need to be changed as follows:
R$* < @ [ $+ ] > $* $: $1 < @ [ $2 ] : $>smart_host > $3 Add smart host to path
R$* < @ $* > $* $: $>MailerToTriple < $>smart_host > $1 < @ $2 > $3 glue on smarthost name
This will reread and reparse the smart host file every time the
corresponding ruleset is invoked. It is actually possible to just set
the S macro to the corresponding value and use that (I've just retyped
this out of my head) by first defining a 'macro' map:
and then using a smart_host ruleset which looks like this (based on
the assumption that no two consecutive dots will be in the argument):
R$+ $: $1 . . $&S append value of S
R$+ . . $+ $@ $2 $1 has a value? => done
R$+ . . $1 . . $(smart_host 0$) append result of lookup
R$+ . . $+ $(set S $@ $2 $) $2 $1 set S to that, return
(intended to be used in the same place).
I you feel inclined to post a 'my MTA is longer than your MTA' reply,
please skip that.
||8/2/2011 12:47:10 PM
(page loaded in 0.03 seconds)
sendmail smart host in Solaris 10 - comp.unix.solaris
Make sendmail read the SMART_HOST from a file - comp.unix ... I suggest you read the sendmail manual page for further ... The range is defined in the sendmail.cf file ...
Sol10, Sendmail, localhost and mailx - comp.unix.solaris ...
Make sendmail read the SMART_HOST from a file - comp.unix ... Sol10, Sendmail, localhost and mailx - comp.unix.solaris ..... tmp/somefile And what I see in the sm.log file ...
Sendmail not sending mails immediately - comp.unix.solaris ...
Make sendmail read the SMART_HOST from a file - comp.unix ... Sendmail not sending mails immediately - comp.unix.solaris ... I suggest you read the sendmail manual page ...
Sendmail SMTP Host Name - comp.unix.solaris
Make sendmail read the SMART_HOST from a file - comp.unix ... Sendmail SMTP Host Name - comp.unix.solaris I read about a sendmail.mc file? I looked for it and it is not on ...
sendmail: do not deliver locally when using virtusertable - comp ...
Make sendmail read the SMART_HOST from a file - comp.unix ... sendmail: do not deliver locally when using virtusertable - comp ... [fu-t set] in comp.mail.misc i read ...
MAILX and host/system address setup - comp.sys.hp.hpux
Make sendmail read the SMART_HOST from a file - comp.unix ... Sol10, Sendmail, localhost and mailx ... for it and it is not on the system. ... name lookup failure"? - comp ...
Why do I have "host name lookup failure"? - comp.mail.sendmail ...
I have sendmail setup to use my ISP as a smart host, use port 587, and ... is nothing like that in the sendmail.mc file ... v _recipient-email_ sendmail email read over ...
comp.mail.sendmail - page 2
This is page 2 of the comp.mail.sendmail group which ... Conditional SMART_HOST IPv4/IPv6 3 99 (11/13/2009 10:08:51 AM ... you please tell me what to put in my aliases file, so ...
How to read mail in HP UX through Command line - comp.unix ...
... Test Mail" "email@example.com" I want a similar command for reading the file? ... need to do some stuf with creating and honoring lock files to make sure you and sendmail ...
how restrict recipients addresses on backup mailserver - comp.mail ...
>>> >>> And regarding use of access table - I somewhere read, that using this ... VIRTUSER_STOP_ONE_LEVEL_RECURSION_ is "documented" in cf/m4/proto.m4 >> file in sendmail ...
The sendmail.cf and sendmail.mc Files
A sendmail.mc file for a minimal ... is piqued, you can read about these in the sendmail ... we must tell sendmail that it is not to send local mail via the smart host.
Configure sendmail as a smart host - nixCraft: Linux Tips, Hacks ...7/14/2012 6:40:55 PM
How to configure sendmail Smart host, which is ... Open your configuration file:# vi /etc/mail/sendmail.mcAppend or modify macro that read as follows :define(`SMART_HOST ...