[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to mail (userfriendly)?



On Thu, 2001-09-13 at 22:35, Schoppitsch Dieter wrote:
> Hi all!
> 
> It's horrible - I can't install Mail Services on my Laptop.
> 
> I am a single user and have an Email-Account at my ISP.
> All I want is to dial in to my ISP and put mails from my laptop to
> this mail account and fetch mails from this account to the laptop
> (and read and answer offline).
> As my laptop is very old (486) and I am not that expert in setting up
> I search for small (no X) and simple solution (out of the box).
> 
> The last thing I tried was a mutt/masqmail/fetchmail-combination
> without setup-success.

This is two problems.  (1) receiving mail, (2) sending mail.  I can
relate my experience - I don't know if it is any help, but it might be
interesting...

Firstly, for receiving mail, I use fetchmail.  This means that I can use
any mail client I like, locally.  I run fetchmail in daemon mode, and it
checks for my mail every minute.  Fetchmail is also triggered when my
ppp connection comes up - this is done by the standard Debian install,
and you shouldn't need to do any more.

For sending mail, I use masqmail.  I set up a line for each internet
connection location.  When each connection comes up I touch a file in
the /tmp directory called masqmail.<connection>  For ppp connections I
did this through adding scripts to /etc/ppp/ip-up.d and
/etc/ppp/ip-down.d, and for network connections I use 'whereami' to do
this.  My minutely cron job then comes along and if it finds
/tmp/masqmail.*, and /var/spool/masqmail/local/* then it does a masqmail
queue run (masqmail -qo <connection>).

I'm sure this sounds all a little complicated, but I have quite a few
different places I go to where I want to be able to send and receive
mail, and I want it to 'just work' when I arrive there.

Here are some of the scripts concerned:
---------------/etc/ppp/ip-up.d/1masmqmail------------------------------
#!/bin/sh

# Exit if package was removed but not purged.
test -x /usr/sbin/masqmail || exit 0


if [ -n "$PPP_IFACE" ]; then
    # Set the provider according to the value of PPP_IPPARAM
    PROVIDER="$PPP_IPPARAM"
fi


if [ -n "$PROVIDER" ]; then

    # Record the provider name in a file. This is necessary if we're
using
    # the "online_detect = file" method (cf.
/etc/masqmail/masqmail.conf)
    echo -n "$PROVIDER" > /tmp/connect_route
    chmod 0644 /tmp/connect_route

    # When the connection goes up, we flush the MasqMail queue using the
route
    # defined for the provider by "connect_route.$PROVIDER" 
    # in /etc/masqmail/masqmail.conf
    /usr/sbin/masqmail -qo &

fi


if grep -qsx "^get.$PROVIDER.*=.*" /etc/masqmail/masqmail.conf; then

    # optionally fetch mails from POP servers, if a get method is
defined
    # in /etc/masqmail/masqmail.conf
    /usr/sbin/masqmail -g &

fi
--------------------------------------------------------------------
---------------/etc/ppp/ip-down.d/1masmqmail------------------------
#!/bin/sh

rm /tmp/masqmail.*
--------------------------------------------------------------------

Finally, the script I run every minute to send any queued mail:
---------------/root/bin/mymail-------------------------------------
#!/bin/bash

cd /tmp
MAILQUEUE=`ls | grep masqmail | cut -f2 -d.`

if [ "$MAILQUEUE" = "" ]; then
  # logger -tmymail "No mail queue active"
  MAILQUEUE=$MAILQUEUE
else
  if [ `ls /var/spool/masqmail/input/*-H 2>/dev/null | wc -l` -ge 1 ];
then
    logger -tmymail "Queue '$MAILQUEUE' is active - sending mail"
    /usr/sbin/masqmail -qo $MAILQUEUE
    logger -tmymail "Mail sent"
  fi
fi
--------------------------------------------------------------------

In my masqmail setup, for each connection I have:

  connect_route.connection = "/etc/masqmail/connection"

and in each /etc/masqmail/connection file, I have something along the
lines of:

  mail_host = mail.connection.co.nz

(I think there are newer ways of doing this, but I've been using
masqmail for a couple of years).
--------------------------------------------------------------------

I hope all this helps somewhat - feel free to ask questions if you want
to set yourself up this way.

Regards,
					Andrew.

-- 
_____________________________________________________________________
        Andrew McMillan, e-mail: Andrew @ catalyst . net . nz
Catalyst IT Ltd, PO Box 10-225, Level 22, 105 The Terrace, Wellington
Me: +64(21)635-694,  Fax:+64(4)499-5596, Office: +64(4)499-2267xtn709



Reply to: