Hi!

I have qmail server in my intranet. The server also has a modem and does IpMasq.
I have a script to send out the outgoing mail to the nearest smtp server and
fetches new mail from internet via POP3:

------------- This is the script that does Mail exchange ----------------

#!/bin/bash

export PATH="/sbin:/bin:/usr/sbin:/usr/bin:/opt/serialmail/bin:/opt/ucspi-tcp/bin"

#get the IP of ppp0!
MyIp=`/opt/iflib/ifinf ip ppp0`

#receive mail
su <user1> -c "fetchmail -a " > /tmp/named.pipe.httpdial &
su <user2> -c "fetchmail -a " > /tmp/named.pipe.httpdial &
<... and so on ... for every user>

#SEND mail
/opt/serialmail/bin/maildirsmtp ~alias/pppdir alias-ppp- <smtp server> $MyIp
-----------------------------------------------------------

This script works just fine when run from a telnet.

So other users (non Linux users) can establish ppp connection I've made a http
dialer daemon (http://www.kiss.uni-lj.si/~k4f0058/httpdial.html) with 3 buttons.
One runs conect, second disconnect and third "mail exchange" scripts. The tool
is still a bit unreliable (read beta), but the connect/disconnect scripts run
just fine. 
The problem is with the "mail exchange script". Fetchmail works just fine, but
maildirsmtp never runs :(((. I looked thru the logs but found no error; I've
tried a lot of things (exec, ...) but nothing worked.
What does maildirsmtp want ??

Some technical details:
----------------
std* is redirected to /dev/null (it is actualy the same fd, dupe2()d 3 times -
I suspect this to be the problem). 
The script is executed by this code fragment:

global.pidScriptMx=fork();
switch(global.pidScriptMx) {
case 0:
execlp(defMxScript,NULL);
syslog(LOG_ERR,"-> Unable to run the mailex script - execlp() failed.\n"); // this 
code should never be executed.
exit(-255);
break;

-- 
best regards,
Rok Papez.

Reply via email to