Re: My ISP doesn't relay my e-mail's

Frank Tegtmeyer <[email protected]> 05 Jun 2003 11:21:23 +0200
Newsgroups gmane.mail.serialmail
Message-ID <[email protected]>
Luciano Schirmer Silveira <[email protected]> writes:

> I'm working on it, but to say the truth, that script doesn't work!!
> The problem is that it runs the perl part for every file in
> ~alias/pppdir/new/, then it does not send the e-mail using the
> maildirsmtp line, but it runs the cowsay line.

You don't run the script as user alias. Maybe the files are owned by
the other user after running the script. Did you check this?

> e-mails are sent correctly. Seems like perl is fu**ing it all!!

You simply have to run the script as user alias. It will work.

> I'd appreciate more details about a way of triggering. Any information
> is welcome.

Example for using a named pipe:

Create a named pipe somewhere (for example in /var/qmail) that is
readable by alias and writeable for everyone who needs to trigger the
sending of mail (for example group users):

mkfifo /var/qmail/sendtrigger
chown alias.users /var/qmail/sendtrigger
chmod 420 /var/qmail/sendtrigger

Then create a new command script 'sendnow' in /usr/local/bin
(*not* setuid):

#!/bin/sh
echo 'go' > /var/qmail/sendtrigger

This script does nothing besides writing to the pipe.


Now you can wrap your script into something like that:

#!/bin/sh
while true
do
  read < /var/qmail/sendtrigger
  ... your script here
done

Ensure that this is started at system start under the userid of
alias. The simplest is to use this as a run script for daemontools.

Now you can use the sendnow command to trigger the sending of mail.

Regards, Frank