From: Sergey Lizogub <linthong@mail.ru>
To: community@altlinux.ru
Subject: Re: [Comm] отключаться после забора почты
Date: Mon, 12 May 2003 21:20:04 +0700
Message-ID: <20030512212004.2a75fd9c.linthong@mail.ru> (raw)
In-Reply-To: <20030512115658.GA19482@localhost.localdomain>
Mon, 12 May 2003 15:56:58 +0400
Denis Smirnov <mithraen@freesource.info> Вы писали:
> Имеется машинка, на ней есть два пользователя. Нужно чтобы
> во-первых любой из пользователей мог не зная страшных слов
> "sudo", "su", "pppd" и.т.д. соединяться с интернетом и
> отсоединяться от него. Во-вторых в дневное время (то есть когда
> ночной анлим не работает) при неактивности в 5-10 минут
> отключаться. В-третьих по крону периодически забирается и
> отсылается почта (также это может быть по пинку), в этом случае
> надо отсоединяться сразу после окончания забора/отсылки. Для
> забора почты используется fetchmail, для отправки postfix.
>
> Как всё это реализовать?
>
> --
> С уважением, Денис
>
Настройка автоматического получения почты
(уже писалось, но собрано всё в одном месте) - ответ на
интересующий вопрос - см. шаг 3.
С уважением,
Сергей Лизогуб
Шаг 1
Настраиваем fetchmail через /usr/bin/fetchmailconf.
В директории юзера получаем .fetchmailrc примерно следующего
содержания:
# Configuration created Sat Jul 6 00:13:25 2002 by fetchmailconf
set postmaster "логин_почтового_ящика"
set bouncemail
set no spambounce
set properties ""
poll mail.laotel.com with proto POP3
user 'логин_почтового_ящика' there with password 'пароль'
is 'имя_пользователя' here
Шаг 2
Настраиваем /etc/wvdial.conf
[Dialer Defaults]
Modem = /dev/modem
Baud = 115200
Init1 = ATZ
#Init2 = ATQ0 V1 E1 SO=0 &C1 &D2 S11=55
Init3 = ATM0 #Отключение звука
SetVolume = 0
Dial Command = ATDP #для пульствого набора или ATDT - для
тонового
[Dialer имя_соединения]
Username = логин_для_провайдера
Password = пароль
Phone = номер
Шаг 3
Настаиваем дозвон
В файл /etc/sysconfig/network-scripts/ifcfg-ppp0 добавляем
следующие строки (ppp on demand - "ppp по требованию"):
DEMAND="yes"
WVDIALSECT="имя_соединения"
IDLETIMEOUT="сколько-надо-секунд"
получаем ifcfg-ppp0 с содержанием что-то типа:
DEVICE="ppp0"
ONBOOT="yes" #выбрать yes, чтобы pppd запускался при загрузке
USERCTL="no"
MODEMPORT="/dev/modem"
LINESPEED="115200"
PERSIST="yes"
DEFABORT="yes"
DEBUG="yes"
INITSTRING="ATZ"
DEFROUTE="yes"
HARDFLOWCTL="yes"
ESCAPECHARS="no"
PPPOPTIONS=""
PAPNAME="логин_для_провайдера"
REMIP=""
NETMASK=""
IPADDR=""
MRU=""
MTU=""
DISCONNECTTIMEOUT="10"
RETRYTIMEOUT="60"
BOOTPROTO="none"
PEERDNS="yes"
DEMAND="yes"
WVDIALSECT="имя_соединения"
IDLETIMEOUT="60"
Шаг 4
Настраиваем cron
От юзера запускаем ctontab -u имя_пользователя -e, получаем для
пользователя таблицу в /var/spool/cron таблицу (имя
пользователя):
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.ULQ5gl installed on Sat Jul 13 21:39:04 2002)
# (Cron version -- $Id: crontab.c,v 1.11 2001/05/17 12:28:45 ldv
# Exp $)
0 6 * * * fetchmail
0 12 * * * fetchmail
45 14 * * * fetchmail
0 18 * * * fetchmail
30 20 * * * fetchmail
0 23 * * * fetchmail
Шаг 5
Настраиваем Вашу почтовую программу (я пользуюсь Sylpheed, но
будут работать и mail, pine, mutt и др.
Шаг 6
В /etc/hosts пишем адреса почтовых серверов (адреса узнаются с
помощью команды 'host имя.хоста', например 'host pop.mail.ru'):
127.0.0.1 localhost.localdomain localhost
202.137.129.1 nameserver namphou1.laotel.com
202.137.129.3 nameserver namphou2.laotel.com
202.137.135.1 proxy.laotel.com
202.137.129.3 mail.laotel.com
194.67.57.51 pop.mail.ru
Шаг 7
При создании пользователя (например, с помощью userdrake), в
разделе "Комментарий" не забыть написать реальное имя (которое
должно отображаться в обратном адресе письма (From:).
PPS
При написании использованы вопросы и ответы участников рассылки
Vitaly Lipatov
Vadim V. Zhytnikov
Виктор В Исмакаев
next prev parent reply other threads:[~2003-05-12 14:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-12 11:56 Denis Smirnov
2003-05-12 13:52 ` Igor Homyakov
2003-05-12 22:54 ` [Comm] Re: [Comm] Denis Smirnov
2003-05-12 13:58 ` [Comm] отключаться после забора почты Maxim Tyurin
2003-05-12 14:18 ` Arkadiy Pavlik
2003-05-12 22:59 ` [Comm] Re: [Comm] Denis Smirnov
2003-05-12 23:08 ` Shur
2003-05-13 11:58 ` Denis Smirnov
2003-05-13 14:49 ` Shur
2003-05-13 15:52 ` Shur
2003-05-13 20:39 ` Denis Smirnov
2003-05-12 23:59 ` Аркадий Павлик
2003-05-13 11:59 ` Denis Smirnov
2003-05-13 13:00 ` Arkadiy Pavlik
2003-05-13 13:43 ` Denis Smirnov
2003-05-12 14:20 ` Sergey Lizogub [this message]
2003-05-12 23:06 ` [Comm] отключаться пос ле забора почты Denis Smirnov
2003-05-13 8:16 ` [Comm] unsubscribe Владимир Ковалев
2003-05-14 10:42 ` [Comm] отключаться после забора почты Andrew Fefilov
2003-05-14 22:22 ` [Comm] Re: [Comm] Denis Smirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030512212004.2a75fd9c.linthong@mail.ru \
--to=linthong@mail.ru \
--cc=community@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git