Koozali.org: home of the SME Server

delivering mail by CRON?

Patrick Schepers

delivering mail by CRON?
« on: January 30, 2002, 03:30:19 AM »
I'm using SME 4.1.2 for internet access and as e-mail server.

I retrieve the mail by ETRN.

Is it possible to deliver the mail to my ISP only by CRON at fixed times p.e. every hour.

I've looked at diald.conf and diald.filter but I can't figure it out.

Thanks

Ed Form

Re: delivering mail by CRON?
« Reply #1 on: January 30, 2002, 04:24:26 AM »
Patrick Schepers wrote:
>
> I'm using SME 4.1.2 for internet access and as e-mail server.
>
> I retrieve the mail by ETRN.
>
> Is it possible to deliver the mail to my ISP only by CRON at
> fixed times p.e. every hour.
>
> I've looked at diald.conf and diald.filter but I can't figure
> it out.

This is a very important question for UK users of the e-smith/Mitel products. A lot of smaller users have no choice here other than the use of paid-per-call dialup access. With the standard setting of delivering mail immediately telephone charges can run up to big sums of money. The best arrangement of all would be send only when online to download mail. I've asked several times if this is possible but no one ever replies.

This one factor is the single reason that I am not buying these products for more of my clients.

Ed Form

guestHH

Re: delivering mail by CRON?
« Reply #2 on: January 30, 2002, 12:04:07 PM »
Hi,

I'm not a crack at this but I was thinking

1. Copy the current working fetchmail to a new name (e.g. /etc/getmail)
2. Disable e-mail retrieval in the manager
3. Schedule a cron job calling the new getmail

How about that?

guestHH

Filippo Carletti

Re: delivering mail by CRON?
« Reply #3 on: January 30, 2002, 12:18:52 PM »
I think it has been discussed previously here. Search the archives.

Patrick Schepers

Re: delivering mail by CRON?
« Reply #4 on: January 30, 2002, 01:18:52 PM »
Filippo Carletti wrote:
>
> I think it has been discussed previously here. Search the
> archives.

Yes I've searched the archives intensive but according to me not one satisfieing solution is mentioned. Or overlooked I something

Thanks for reaction

Patrick Schepers

Peter

Re: delivering mail by CRON?
« Reply #5 on: January 31, 2002, 12:30:17 AM »
One way we have used in the passed is to put a time swirch to your external modem power switch. Have your e-smith settings to every hour for mail pick up. On line for a short duration and not weekends. Get your time switch to turn off over night then on in the morning again not weekends. You get lots of reports that your e-mail did not work but its when you have turned off the modem. This way you should only be online for approx 3 mins every hour to pick up your mail

Patrick Schepers

Re: delivering mail by CRON?
« Reply #6 on: February 01, 2002, 12:21:46 AM »
guestHH wrote

1. Copy the current working fetchmail to a new name (e.g. /etc/getmail)
2. Disable e-mail retrieval in the manager
3. Schedule a cron job calling the new getmail

How about that?

RequestedDeletion

***********************
This will trigger just getting mail. SME can do this for me.
I ment I want to trigger DELIVERING MAIL once a hour or so

Thanks for your reaction (bedankt)

Groetjes/Greetings

Patrick Schepers

Ed Form

Re: delivering mail by CRON?
« Reply #7 on: February 01, 2002, 01:07:26 AM »
guestHH wrote:
>
> I'm not a crack at this but I was thinking
>
> 1. Copy the current working fetchmail to a new name (e.g.
> /etc/getmail)
> 2. Disable e-mail retrieval in the manager
> 3. Schedule a cron job calling the new getmail

It's not retrieval that's the problem. That can be cotrolled with the facilities int he system manager.  It's sending that cannot be controlled. As far as I can tell, if you send a mail to the spools it is sent immediately. For UK conditions we need to make the send operation a timed event also.

Any one got any ideas? It could be worth quite a lot of beer!

Ed Form

Ed Form

Re: delivering mail by CRON?
« Reply #8 on: February 01, 2002, 01:12:19 AM »
Peter wrote:
>
> One way we have used in the passed is to put a time swirch to
> your external modem power switch. Have your e-smith settings
> to every hour for mail pick up. On line for a short duration
> and not weekends. Get your time switch to turn off over night
> then on in the morning again not weekends. You get lots of
> reports that your e-mail did not work but its when you have
> turned off the modem. This way you should only be online for
> approx 3 mins every hour to pick up your mail

This is also not a solution. You can turn off the retrieve routines in the manager panel, but what you cannot do is make the mailer daemon send out your mail according to a schedule - it always sends the moment the mail hits the spool. That's what results in excessive telephone costs.

It's nice to see a little discussion of this important point. ~(:oD)

Any chance of comments fromt he e-smith/mitel team? The lack of this facility is a sales killer in the UK.

Ed Form

Patrick Schepers

Re: delivering mail by CRON?
« Reply #9 on: February 01, 2002, 02:13:28 AM »
Is it an option to disable temporarely the forwarding daemon SMTPFWDD?
(I'm still using SME 4.1.2.)

guestHH

Re: delivering mail by CRON?
« Reply #10 on: February 01, 2002, 02:32:38 AM »
Patrick,

That's what I was thinking about reading the remaing answers in this thread.

In short, if you don't want it to  be delivered, stop the delivering guy and put it off automatic and call in his services by a scheduled CRON job.

One thing though, I don't know how SMTPFWDD and fetchmail work together  i.e. if fetchmail gets mails, will it deposite them 'until the end of times' before 'anybod (SMTPFWDD) will pick them up ??

Anybody can comment on this, or is this a typical case of rt....ual?

Regards,

RequestedDeletion (gegroet Patrick ;-) doei, doeg, houdoe,adiee, hoie?)

Patrick Schepers

Re: delivering mail by CRON?
« Reply #11 on: February 01, 2002, 02:54:18 AM »
I was even thinking shutting down diald by a cron job, but this isn't a good thought because if you enable diald my internetservice (e-smith-squid) won't work either.

stephen noble

Re: delivering mail by CRON?
« Reply #12 on: February 01, 2002, 05:21:32 AM »
> charges can run up to big sums of money. The best arrangement
> of all would be send only when online to download mail. I've
> asked several times if this is possible but no one ever
> replies.

dungog.net/sme/howto/isp.html
also dungog-ispconnection provides these as options:
* e-mail notification to admin and logging when a connection is made.
* sending mail doesn't bring up the link, ie it's queued.

this is one of many possible solutions

GORDON R. made the best suggestion which i unfortunatly lost
qmail can be toggled to not deliver mail remotely by
creating and removing a file something like

/var/qmail/local/remote/stopthebloodymail

regards
stephen noble

Kevin Manderson

Re: delivering mail by CRON?
« Reply #13 on: February 01, 2002, 12:33:14 PM »
Hi

Try sourceforge.net and search for emailrelay - looks like a possible answer.

http://sourceforge.net/project/showfiles.php?group_id=32691&release_id=66202

I haven't tried it but it looks like what you are after. Run it on a different port and tweak the clients on your local machines. You could (maybe??) redirect port 25 on your internal ethernet to the emailrelay port but leave port 25 on the external - no idea if that would work or not.

What would be interesting would be to modify the code so it did a store, watch the link and when up pass the stored e-mail to qmail to deliver. Get the best of both worlds :-}

regards
kevin

Filippo Carletti

Re: delivering mail by CRON?
« Reply #14 on: February 01, 2002, 01:27:44 PM »
> Is it an option to disable temporarely the forwarding daemon
> SMTPFWDD?

smtpfwdd accepts incoming mail, incoming means coming into the mail server, from both the lan and the net.
If you disable it, mail will be rejected.

To use qmail with a dialup connection djb wrote serialmail (http://cr.yp.to/serialmail.html)

Patrick Schepers

Re: delivering mail by CRON?
« Reply #15 on: February 02, 2002, 03:58:41 AM »
I've found something what the writer calles QMAIL-HOLDREMOTE PATCH.

It claims to patch qmail so that it hold outgoing e-mail.

Can anyone help me with this. I do not know how to recompile QMAIL.

Maybe this is something for Stephen Noble, he wrote also e-smith-ISP as an contrib modules

Here's the link

http://www.mimir.com/~leveret/qmail.html

Thanks

Patrick Schepers
The Netherlands

stephen noble

Re: delivering mail by CRON?
« Reply #16 on: February 02, 2002, 10:39:38 AM »
> It claims to patch qmail so that it hold outgoing e-mail.
>
> Can anyone help me with this. I do not know how to recompile
> QMAIL.
>
> Maybe this is something for Stephen Noble, he wrote also
> e-smith-ISP as an contrib modules

no way  Patrick
this has a simple answer, i just can remember it
i use another method, ie disabling diald triggers
so i an not motivated to rediscover it

stephen

Jaco Bongers

Re: delivering mail by CRON?
« Reply #17 on: February 02, 2002, 12:33:30 PM »
stephen noble wrote:
>
> > It claims to patch qmail so that it hold outgoing e-mail.
> >
> > Can anyone help me with this. I do not know how to recompile
> > QMAIL.
> >
> > Maybe this is something for Stephen Noble, he wrote also
> > e-smith-ISP as an contrib modules
>
> no way  Patrick
> this has a simple answer, i just can remember it
> i use another method, ie disabling diald triggers
> so i an not motivated to rediscover it
>
> stephen

qmail works fine, best not to tamper with it :)

The problem is the way a connection is established when you use a dialup line.

As soon as a DNS request is made (UDP port 53), then diald will up the link to allow the DNS request to be serviced. You can add a line to diald.filter which will tell diald to ignore any DNS lookups. I think Stephen Noble originally came with the line in diald.filter:
    #no udp for e-smith-isp
    ignore udp any

This line tells diald to ignore any UDP request (which will include a DNS lookup).

What you need is a similar line in diald.filter to prevent diald from bringing the link up when mail is directed outside your local network.

I would imagine that the line to add will be something like:
   ignore tcp tcp.dest=tcp.smtp

This should prevent a dialup when there is only outgoing mail. The mail will be sent next time the link is up.

I cannot test it now, but you may wish to try it and report back :)

Jaco Bongers

Patrick Schepers

Re: delivering mail by CRON?
« Reply #18 on: February 08, 2002, 07:43:46 PM »
Jaco Bongers wrote
start quote:
As soon as a DNS request is made (UDP port 53), then diald will up the link to allow the DNS request to be serviced. You can add a line to diald.filter which will tell diald to ignore any DNS lookups. I think Stephen Noble originally came with the line in diald.filter:
#no udp for e-smith-isp
ignore udp any

This line tells diald to ignore any UDP request (which will include a DNS lookup).

What you need is a similar line in diald.filter to prevent diald from bringing the link up when mail is directed outside your local network.

I would imagine that the line to add will be something like:
ignore tcp tcp.dest=tcp.smtp

end quote

I've added the lines

ignore tcp tcp.dest=tcp.smtp
ignore tcp tcp.source=tcp.smtp

I even changed everything which starts with UPD to ignore it
ending with "ignore upd any"
and still the connection to my ISP is triggered and e-mail is delivered

in the logfiles is read

trigger tcp 192.168.0.150/1170 194.109.6.49/25

can anyone help to figure out what is triggering DIALD when via a client a email is send.

Thanks

Patrick Schepers
the Netherlands

Gordon Rowell

Re: delivering mail by CRON?
« Reply #19 on: February 14, 2002, 02:27:39 AM »
Place the value '0' (the digit zero) in

 /var/qmail/control/concurrencyremote

Restart qmail

To start mail delivery, put a larger value in there and
restart qmail.

Warning: that file is templated and may be regenerated by
manager actions. You should override with a custom template.

Gordon

Patrick Schepers

Re: delivering mail by CRON?
« Reply #20 on: February 14, 2002, 02:50:21 AM »
Thanks Gordon I will try it very soon

Patrick

stephen noble

Re: delivering mail by CRON?
« Reply #21 on: February 14, 2002, 04:37:23 AM »
Gordon Rowell wrote:
>
> Place the value '0' (the digit zero) in
>
>  /var/qmail/control/concurrencyremote

excellent gordon !
i'll make an rpm so we never have to answer this question again

regards
stephen noble
dungog.net/sme

saleem

Re: delivering mail by CRON?
« Reply #22 on: June 23, 2002, 07:51:46 PM »
Was the rpm for this problem ever created ?

if so where can I find it ?

cheers.

saleem

Re: delivering mail by CRON?
« Reply #23 on: June 23, 2002, 07:51:47 PM »
Was the rpm for this problem ever created ?

if so where can I find it ?

cheers.