Operating System - Tru64 Unix
1752822 Members
4234 Online
108789 Solutions
New Discussion юеВ

Re: sendmail - execute aliases

 
lcmg-unix
Occasional Contributor

sendmail - execute aliases

Hi guys,

I am trying to setup the aliases in send mail so it will execute a script when an email receive for that aliase but it seems like sendmail having issue translating what i added in the aliases file.

This is what i have in the aliases file
vtest: "|/tmp/testscr.test >> /tmp/testscr.log 2>&1 || exit 75"

I added vtest into the local.users file and ran newaliases.

All i had in the /tmp/testscr.test script is echo `date` and has file permission 777.

I test by sending email to vtest@servername.domainname.com.au and immediately i receive the undeliverable return message like

The following recipient(s) could not be reached:

"|/tmp/testscr.test >> /tmp/testscr.log 2>&1 || exit 75"@domainname.com.au on 20/04/2007 2:33 PM
The mail protocol was unable to handle one or more requests because they were unrecognized or invalid. Please notify your system administrator.

The alias works fine when i added an email address to send to ie. abc@domainname.com.au

Hope that make sense.. please help??

The server is tru64 - V5.1 732 alpha


9 REPLIES 9
Steven Schweda
Honored Contributor

Re: sendmail - execute aliases

My VMS system handles my e-mail so I don't do
much with "sendmail" on Tru64, but I can
reproduce this problem on my system. (You're
comforted by that, right?)

I assume that there's some lame thing in the
"sendmail" configuration which causes it to
mishandle the alias, tacking on the local
domain name and sending the mess off to the
Smart Host (or whatever it's called), but
it's been a long time since I had to fiddle
seriously with "sendmail" address rules, and
I've forgotten whatever I did know.

"sendmail" does have an address-test mode,
and that can be helpful in trying to trace
its behavior in cases like this.

But you'd sure think that someone who knows
something would just pop in with the quick
fix, wouldn't you? If you're a moron, and
it's just operator error, at least you're not
the only moron. (Also great comfort, I
assume.)
lcmg-unix
Occasional Contributor

Re: sendmail - execute aliases

Hi Steven,

Thanks for the comments and spent your time reproducing the problem i had. I'm not sure i understand your moron comments.

Yes, the reason i posted my problem on this forum is hoping someone could help or point me to correct path. Isn't thats why we have this forum to help other fellow admin??

But its comforting knowing i'm not the only one with the same problem.. ;-p

Thanks
Steven Schweda
Honored Contributor

Re: sendmail - execute aliases

> I'm not sure i understand your moron
> comments.

I haven't found a way to make it work either,
so we seem to be in the same boat.

More comfort: I tried this on my Solaris
system (where I also don't do much with
"sendmail"), and it worked with no trouble.
There may be other "sendmail" configuration
differences there, too, so it may not be a
perfectly fair comparison, but it sure was
easy on that system. (The Sun "sendmail.cf"
is very different from the Tru64 one, so it's
not very simple to compare them.)

I did find my old (1993) O'Reilly "sendmail",
book, so, if I get bored, I may try a little
reading to see if there's some obvious thing
which we've overlooked. (I haven't found
that thing yet.)

> Isn't thats why we have this forum [...]

I was expecting to hear the easy solution
from someone before this, but perhaps all the
"sendmail" experts took the weekend off. As
Monday rolls around, things may improve.
Don Ritchey
Frequent Advisor

Re: sendmail - execute aliases

A couple of things to check:

1. Make sure that all the directories above your working directory are NOT group or world writeable. That is every directory above you in the $PWD path.

2. Make sure that there is a /etc/shells file and that the shell that will be executing the script is included in that file. Typically, the contents should look like:

/bin/sh
/bin/csh
/bin/ksh
/bin/rsh
/bin/rcsh
/bin/rksh
/usr/bin/sh
/usr/bin/csh
/usr/bin/ksh
/usr/bin/rsh
/usr/bin/rcsh
/usr/bin/rksh
/sbin/sh

Make sure that the rsh in /bin and/usr/bin is the restricted shell, not the remote shell.

Best wishes,

Don Ritchey
Exelon Corporation
Steven Schweda
Honored Contributor

Re: sendmail - execute aliases

urtx# diff sendmail.cf_20070219 sendmail.cf
791c791
< Msmtpr, P=[IPC], F=mDFMuX, S=13, R=23, A=TCP $h, E=\r\n
---
> Msmtpr, P=[IPC], F=mDFMuX|, S=13, R=23, A=TCP $h, E=\r\n
urtx#

Probably should really be changed in
"sendmail.m4", and then "sendmail.cf"
(re-)generated from that.

Now, why it's actually going through this
mailer is another question to which I have
not yet tried to find the answer, but this
change seems to do the job for me.

There was some stuff in the "sendmail" docs
about some of these flags (like "|") being
defaults in the old days, so there may be
some relationship between this problem and
using a "V5/Digital" configuration file with
"sendmail" "Version 8.13.6". (No bets.) If
we ever hear from a real "sendmail" expert,
perhaps more enlightenment will follow.
Steven Schweda
Honored Contributor

Re: sendmail - execute aliases

Actually, what it says is:

Configuration files prior to level 6
assume the `A', `w', `5', `:', `|', `/',
and `@' options on the mailer named
"local".


So, the problem would seem to be more that
the alias is going through the "smtpr" mailer
(which doesn't have the "|" flag set by
default), rather than going through the
"local" mailer, where it would be set by
default.

"sendmail -bt" + "=M" shows the mailer
definitions, and indeed, "local" reports
having "F=/5:@ADFMSlmnqsuw|", while the ".cf"
file says only "F=SlsDFMmnuAw5". "smtpr", on
the other hand, does not get the free bonus,
so with "F=mDFMuX" in the ".cf", "smtpr" gets
(exactly) "F=DFMXmu", and without the "|",
the "|" alias is not handled as expected.
lcmg-unix
Occasional Contributor

Re: sendmail - execute aliases

Thanks Steven/guys for all the inputs. I will try it out tomorrow and let you know how i goes.
Steven Schweda
Honored Contributor

Re: sendmail - execute aliases

> A couple of things to check:

What _are_ you talking about? How would the
properties of my, your, or anyone else's
working directory affect "sendmail"?

And who looks at "/etc/shells"? "sendmail"?
I don't think so.

Around here:

urtx# ls -l /bin
lrwxr-xr-x 1 root system 7 Jan 27 2006 /bin -> usr/bin

so "rsh in /bin and/usr/bin" is pretty likely
to be the same thing, and it doesn't look
like any "restricted shell" to me:

urtx# /bin/rsh
usage: rsh [-ndfx] [-l login] host [command]

> Best wishes,

This seems to be the most valuable
contribution in the whole posting. Are you
sure you hit the right thread?
Steven Schweda
Honored Contributor

Re: sendmail - execute aliases

Any news?