Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 546
  • Last Modified:

RedHat 8, SENDMAIL message piping - indestructible SMRSH error!

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
M0m0nga
Asked:
M0m0nga
  • 8
  • 3
  • 2
2 Solutions
 
jlevieCommented:
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
 
PsiCopCommented:
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
 
M0m0ngaAuthor Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
jlevieCommented:
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
 
M0m0ngaAuthor Commented:
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
 
M0m0ngaAuthor Commented:
OK  jlevie, just trying /tmp/attachmentfaxer  now  ...
0
 
M0m0ngaAuthor Commented:
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
 
M0m0ngaAuthor Commented:
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
 
M0m0ngaAuthor Commented:
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
 
PsiCopCommented:
/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
 
jlevieCommented:
You can use logger to write messages via syslog. See 'man logger'.
0
 
M0m0ngaAuthor Commented:
I'm still working on this, but the first answer solved my question. Thanks jlevie and PsiCop.
0
 
M0m0ngaAuthor Commented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 8
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now