?
Solved

RedHat 8, SENDMAIL message piping - indestructible SMRSH error!

Posted on 2005-02-24
13
Medium Priority
?
535 Views
Last Modified: 2013-12-06
I'm running Red Hat Linux 8 with Sendmail 8.12.8 and hylafax (having some success using it as email-to-fax gateway.)

I'm trying to pipe emails addressed to a certain user (attachmentfaxer@serfax.hollard.com.au) to a script called
attachmentfaxer with a line in /etc/aliases :

attachmentfaxer: "|/home/attachmentfaxer/attachmentfaxerscript"      

I'm getting an smrsh error (stat failed), so I've added a symbolic link to /home/attachmentfaxer/attachmentfaxerscript to /etc/smrsh like this:
# ln -s  /home/attachmentfaxer/attachmentfaxerscript

BUT - i still get the error! :(

Any suggestions?



The Email I get back:
___________________________________________________

The original message was received at Fri, 25 Feb 2005 16:38:19 +1100 from dska006.hollard.com.au [192.168.0.76]

   ----- The following addresses had permanent fatal errors ----- "|/home/attachmentfaxer/attachmentfaxerscript"
    (reason: Service unavailable)
    (expanded from: <attachmentfaxer@serfax.hollard.com.au>)

   ----- Transcript of session follows -----
smrsh: "attachmentfaxerscript" not available for sendmail programs (stat failed)
554 5.0.0 Service unavailable
___________________________________________________
0
Comment
Question by:M0m0nga
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 3
  • 2
13 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 1800 total points
ID: 13403074
I don't believe a sym link to /etc/smrsh will work. The script must be actually in /etc/smrsh. I'm not positive but I think the script needs to be owned by root, group mail, and be mode 0750.
0
 
LVL 34

Assisted Solution

by:PsiCop
PsiCop earned 200 total points
ID: 13404601
I believe jlevie is correct. Unless you use the DontBlameSendmail option to specifically allow it to follow symlinks, it won't do so. Put the actual script in /etc/smrsh and set the ownership and mode as jlevie suggests. Or go lower sendmail's defenses using the DontBlameSendmail options.
0
 
LVL 1

Author Comment

by:M0m0nga
ID: 13416408
Thanks, fanamazingtastic! The script seems to be running - but I must still be missing something because I get an email back saying the script didn't complete because of permissions.

It needs to be able to create and then delete some temporary files, but now it's in /etc/smrsh with root:mail and 0750 it can't create them. Can you suggest a change in permissions or a place the script would be allowed to write to?

(sorry, still pretty new to permissions and a bunch of other Linux stuff).
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 40

Expert Comment

by:jlevie
ID: 13416589
Where is your script trying to create the temp files? You should be able to specify /tmp as the place where tempoary files are placed.
0
 
LVL 1

Author Comment

by:M0m0nga
ID: 13416596
Also - it seems emails with attachments sent to this address disappear somewhere. The script doesn't run or send back any errors. Do you know where I might check out whats happening in a sendmail log or something?
0
 
LVL 1

Author Comment

by:M0m0nga
ID: 13416631
OK  jlevie, just trying /tmp/attachmentfaxer  now  ...
0
 
LVL 1

Author Comment

by:M0m0nga
ID: 13416673
Thanks, excellent, Ok I've changed the script to create a dir /tmp/attachmentfaxer and put its temp files into there. Now I get no error messages, but the script doesn't seem to run at all.

Any idea how I'd check whats going on?
0
 
LVL 1

Author Comment

by:M0m0nga
ID: 13416755
OK I found a mail log in: /var/log/maillog

and the entries that appear after I send an email to attachmentfaxer are:

Feb 28 12:30:27 serfax sendmail[2331]: j1S1URYe002331: from=<michaelo@i2b.com.au>, size=337, class=0, nrcpts=1, msgid=<e5pzou98.yzhew0rty5yj@a1ejd7rd>, proto=ESMTP, daemon=MTA, relay=dska116.holland.com.au [192.168.0.52]

Feb 28 12:30:27 serfax sendmail[2332]: j1S1URYe002331: to="|/etc/smrsh/attachmentfaxerscript", ctladdr=<attachmentfaxer@serfax.holland.com.au> (8/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=30563, dsn=2.0.0, stat=Sent
0
 
LVL 1

Author Comment

by:M0m0nga
ID: 13417208
Putting things in /tmp works good -  Is this folder is cleared out by the OS at certain times/events (?)

I want to keep a log file that the script writes to, recording what is does, so i can see what's going wrong - is there anywhere I could put it that's more "permanent" that /tmp ?
0
 
LVL 34

Expert Comment

by:PsiCop
ID: 13419917
/tmp is cleared at reboot.

Logging is customarily done to /var/log. sendmail logs to the syslogd (system log daemon) using the "mail" facility. The syslogd daemon is controlled via /etc/syslog.conf
0
 
LVL 40

Expert Comment

by:jlevie
ID: 13420471
You can use logger to write messages via syslog. See 'man logger'.
0
 
LVL 1

Author Comment

by:M0m0nga
ID: 13456251
I'm still working on this, but the first answer solved my question. Thanks jlevie and PsiCop.
0
 
LVL 1

Author Comment

by:M0m0nga
ID: 13456368
Now the script is running, I have a shell scripting/metamail question :

http://www.experts-exchange.com/Operating_Systems/Linux/Q_21337418.html
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question