Offline mailing automation (scripts?)

Offline mailing automation (scripts?)

Post by tola » Fri, 01 Sep 2000 11:47:40



I have a rather complicated set of mailboxs on a variety of servers, ive
managed to get fetchmail, procmail and sendmail to deal with them,
however id know like to automate the mail drops in two ways:

1) get a certain script to be executed on any user initiated dial-up,
and perhaps periodically through out the dial-up.  Ideally a different
script depending on which provider im dialing up with (or one script
that determines this and then performs different things (i could ping
myself and then check the IP address for instance)). one difficulty with
this is that i use several 'interfaces' to pppd (wvdial, kppp, yawmppp)

2}have an additional, nightly, maildrop.  the difficulty with this isnt
using cron, but in getting the script to close the dial up connection.
i guess im going to use wvdial to connect, this requires a ctrl-C to end
it, how can i send this to wvdial only after the maildrop has run?

im a newbie (month) and and dont want to use dial on demand.  ANY ideas,
even vague hints will be appriciated.

 
 
 

Offline mailing automation (scripts?)

Post by David Efflan » Sat, 02 Sep 2000 18:35:22



>I have a rather complicated set of mailboxs on a variety of servers, ive
>managed to get fetchmail, procmail and sendmail to deal with them,
>however id know like to automate the mail drops in two ways:

>1) get a certain script to be executed on any user initiated dial-up,
>and perhaps periodically through out the dial-up.  Ideally a different
>script depending on which provider im dialing up with (or one script
>that determines this and then performs different things (i could ping
>myself and then check the IP address for instance)). one difficulty with
>this is that i use several 'interfaces' to pppd (wvdial, kppp, yawmppp)

I use an ippparam pppd option (for example: ipparam xnet.com) that tells
what I am connecting to and can read that as $6 in /etc/ppp/ip-up.local
(or maybe just ip-up in non-RedHat).  Then a case statement can do
different things for different ISP's.

You could log this info to a file and if your cron job sees something in
this file, it could be configured to do whatever it needs to for that ISP.
Then you could simply cp /dev/null to that file from /etc/ppp/ip-down (or
ip-down.local) and have the cron job not do anything if the file is empty.

Quote:>2}have an additional, nightly, maildrop.  the difficulty with this isnt
>using cron, but in getting the script to close the dial up connection.
>i guess im going to use wvdial to connect, this requires a ctrl-C to end
>it, how can i send this to wvdial only after the maildrop has run?

>im a newbie (month) and and dont want to use dial on demand.  ANY ideas,
>even vague hints will be appriciated.

This is easy to do with demand pppd, for example if I am going to be out
of town, I simply run fetchmail from cron twice a day and demand pppd
comes up as long as it is needed.  I have it stay up for 15 or 20 minutes
because I pay a max of 10 cents per call (not per minute).

The problem with manually bringing up pppd from a script is how do you
tell how long to stay connected before killing it?  And it has been my
experience that wvdial is totally useless because it seems to assume that
you need to log into a shell first, even if you can't or don't need to.  A
regular pppd connection using pap authentication works for everything I
connect to.

--

http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/

 
 
 

Offline mailing automation (scripts?)

Post by Laurens Kils-Hütt » Sat, 02 Sep 2000 16:57:36



>2}have an additional, nightly, maildrop.  the difficulty with this isnt
>using cron, but in getting the script to close the dial up connection.
>i guess im going to use wvdial to connect, this requires a ctrl-C to end
>it, how can i send this to wvdial only after the maildrop has run?

I found the problem of closing the ppp link as soon as all queues have been
flushed very annoying also, here is how I deal with it: pppd passes some
variables to the ip-up and ip-down scripts, these are:

#       $1      the interface name used by pppd (e.g. ppp3)
#       $2      the tty device name
#       $3      the tty device speed
#       $4      the local IP address for the interface
#       $5      the remote IP address
#       $6      the parameter specified by the 'ipparam' option to pppd  

I set the last variable to POLL, like this:

--- optionsfile for polling: ---
/dev/modem
115200
lock
0.0.0.0:195.222.212.162
ipcp-accept-local
ipcp-accept-remote
remotename myisp
name accountatisp
defaultroute
ipparam POLL                  <<<---- this sets the sixth variable to POLL
connect /etc/ppp/scripts/myisp
--------------------------------

I call this file "/etc/ppp/peers/myisp-poll". When I just want to poll
news and mail, I start pppd like this:

pppd call myisp-poll

In my ip-up there are the usual things like "sendmail -q" and so forth and
this line, which actually does the trick:

--- last line of my ip-up: ---

if test $6 = POLL ; then killall pppd ; fi

------------------------------

this checks out whether the sixth argument to pppd, referred to by $6 has
been set to POLL and if so brutally takes down all pppd processes, this is
of course a problem if you have more than one pppd session running, but I
usually don't so I didn't bother :-)

there is another file called "/etc/ppp/peers/myisp" which lacks the ipparam
line, so when I don't want the connection to be brought down after polling I
start pppd like this:

pppd call myisp

now seems easy to me, but it took me some time at first...

cheers,

laurens

--
Laurens Kils-Huetten    
Clasingstr. 3  
D-20255 Hamburg
Tel/Fax: +49-40-43270065

 
 
 

1. Mail automation

This is the configuration of my e-mail server:
- RedHat Linux 6.0
- Sendmail 8.0

Two questions:
1. How to set system to forward the mails of certain user to the outside mail address automatically?
2. How to set auto-reply for certain users.

Thanks & regards,

Vincent

==================================
Posted via http://nodevice.com
Linux Programmer's Site

2. Some questions on using slip

3. Linux install using OS/2 Boot Manager

4. MAIL PROGRAM...AUTOMATION....BCC????

5. xmail - Regular expression too long error ?

6. creating a automation script

7. Apache compile error

8. Unix to NT ftp automation script

9. telnet automation script

10. Looking for Admin Automation Scripts...Help..

11. Q: ftp automation script pc-> solaris

12. MINICOM and scripts using RUNSCRIPT, EXPECT and /bin/sh for automation