The percent hack is way cool and simple, but depends on the target
relay host supporting the percent hack. Our postfix machines do, but
our sendmail does not out of the box, and who knows about other mailers
or windows machines.
I could implement this through the transport table which is way
complicated but should give generic results.
Example, emerald is the buddy server, and machine1 and machine2 are
monitored by emerald sending e-mail through them back to itself.
The following is complex:
Create a DNS record for each monitored machine:
machine1.emerald.lightlink.com. IN CNAME machine1.lightlink.com.
machine2.emerald.lightlink.com. IN CNAME machine2.lightlink.com.
...
Then in transport on emerald:
machine1.emerald.lightlink.com smtp:[machine1.lightlink.com]
machine2.emerald.lightlink.com smtp:[machine2.lightlink.com]
Then in /etc/sendmail.cw on emerald:
machine1.emerald.lightlink.com
machine2.emerald.lightlink.com
Then monitor with
echo yak | sendmail bu...@machine1.emerald.lightlink.com
echo you | sendmail bu...@machine2.emerald.lightlink.com
------------------------------------------------------------------------
Homer Wilson Smith Clean Air, Clear Water, Art Matrix - Lightlink
(607) 277-0959 A Green Earth, and Peace, Internet, Ithaca NY
ho...@lightlink.com Is that too much to ask? http://www.lightlink.com
On Tue, 17 Dec 2013, Homer Wilson Smith wrote:
All fixed.
Sorry for my stupidity, the target server majesty.lightlink.com
did not have 'majesty.lightlink.com' in its /etc/sendmail.cw file,
as its 'real' name is mail1.lightlink.com.
The command works perfectly if using the real name
echo ping | /usr/lib/sendmail
buddy%emerald.lightlink....@mail1.lightlink.com
Homer
On Tue, 17 Dec 2013, Noel Jones wrote:
On 12/17/2013 6:45 PM, Wietse Venema wrote:
Homer Wilson Smith:
From: adore.lightlink.com
echo Subject: ping | /usr/lib/sendmail
buddy%emerald.lightlink....@majesty.lightlink.com
majesty.lightlink.com returns mail loops back to myself.
Both running postfix and allow_percent_hack = yes
Are you lazy?
What hostname is named in
This is the mail system at XXX
I'm sorry etc...
What warnings are logged on that host.
Maybe that will give you a clue.
Wietse
------------------------------------------------------------------------
Homer Wilson Smith Clean Air, Clear Water, Art Matrix - Lightlink
(607) 277-0959 A Green Earth, and Peace, Internet, Ithaca NY
ho...@lightlink.com Is that too much to ask? http://www.lightlink.com
On Mon, 16 Dec 2013, Wietse Venema wrote:
Homer Wilson Smith:
We are trying to get server A, to send mail through many other
servers, back to server A.
What about
$ echo Subject: ping | /usr/sbin/sendmail user%hosta@hostb \
user%hosta@hostc user%hosta@hostd
Out of the box (*), Postfix will send mail to hostb, hostc, and hostd
that they are supposed to deliver to user@hosta.
(*) main.cf:allow_percent_hack=yes
It would be useful if the 'smart host' could be specified on
the sendmail command line, but alas I don't think this is possible.
Sorry, that would open up all kinds of security holes.
Wietse
It's probably easier to use a command line SMTP tool to inject a
message directly to the remote server. No routing issues and you get
immediate feedback about the SMTP exit status.
I like to use mini_sendmail for this, but there are a dozen others.
See google for details.
(this is one line; beware wrapping)
# mini_sendmail -smajesty.lightlink.com bu...@emerald.lightlink.com
</path/to/some_text
-- Noel Jones