On Tuesday 30 September 2003 13:42, Lukas Vesely wrote:
> is somehow possible to make courier run behind a dialup connection that
> when the server's not connected it delivers mail only for local domains
> and all other mails would stay in local queue and when other script would
> start a PPP connection and make 'courier flush', the queue would be sent
> to a 'smartrelay' ? Is there any way how to do it ?

Sure, we do exactly that very successfully.  Put your smartrelay into the 
/etc/courier/esmtproutes file like so:

: smartrelay.com

Then in /etc/ppp/ip-up.local (assuming your running pppd under linux) put 
"/usr/lib/courier/sbin/courier flush"  (If you running something other than 
pppd on linux you'll have to figure out what the right file is.)

Then every time pppd connects it will run the "courier flush" command to send 
the mail.  (We also run fetchmail at the same time to pull in mail at the 
same time from our main servers in the States.)

We also have users which connect to this box to get mail and I don't want 
courier trying to send mail every time they connect, so in my pppd options 
file for the dial-out connection I add the option "linkname courier" and then 
in the ip-up.local file we have

if [ $LINKNAME == "courier" ]; then
  /usr/lib/courier/sbin/courier flush
fi

So now courier only gets flushed when the actual dial-out connection gets run, 
not when someone dials in.

You may also want to tune /etc/courier/retryalpha / beta / gamma / delta to 
keep courier from trying to send the mail repeatedly when you're not 
connected.  But if not it times out immediately since it can't do a DNS 
lookup.

Hope that helps.  I've actually got a bunch of perl scripts that I use to 
bring the connection up at certain times (triggered by cron) and then 
automatically disconnect once courier is done sending all the mail.  Write me 
off list if you'd like a copy of them.

Jeff Jansen



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to