Índice
Após estabelecer a ligação de rede (veja Capítulo 5, Configuração de rede), você pode correr varias aplicações de rede.
Existem muitos pacotes de exploradores web para aceder a conteúdos remotos com Hypertext Transfer Protocol (HTTP).
Tabela 6.1. Lista de exploradores web
pacote | popcon | tamanho | tipo | descrição do explorador web |
---|---|---|---|---|
iceweasel *
|
V:30, I:48 | 3761 | X | Mozilla Firefox sem marca |
iceape-browser *
|
V:1.4, I:2 | 35686 | , , | Mozilla sem marca, removido devido a questões de segurança bug#505565 |
epiphany-browser *
|
V:13, I:34 | 1060 | , , | GNOME, HIG compliant, Epiphany |
galeon *
|
V:0.9, I:1.4 | 1776 | , , | GNOME, Galeon, substituído pelo Epiphany |
konqueror *
|
V:8, I:15 | 3584 | , , | KDE, Konqueror |
w3m
*
|
V:24, I:84 | 1992 | texto | w3m |
lynx
*
|
I:22 | 252 | , , | Lynx |
elinks *
|
V:2, I:5 | 1448 | , , | ELinks |
links
*
|
V:3, I:9 | 1380 | , , | Links (apenas texto) |
links2 *
|
V:0.7, I:3 | 3288 | gráficos | Links (gráficos de consola sem X) |
Você poderá ser capaz de usar os seguintes strings especiais de URL para alguns exploradores para confirmar as suas definições.
about:
"
about:config
"
about:plugins
"
Debian offers many free browser plugin packages in the main archive area which can handle not only Java (software platform) and Flash but also MPEG, MPEG2, MPEG4, DivX, Windows Media Video (.wmv), QuickTime (.mov), MP3 (.mp3), Ogg/Vorbis files, DVDs, VCDs, etc. Debian also offers helper programs to install non-free browser plugin packages as contrib or non-free archive area.
Tabela 6.2. Lista de pacotes plugin de exploradores
pacote | popcon | tamanho | área | descrição |
---|---|---|---|---|
icedtea6-plugin *
|
V:0.9, I:1.6 | 272 | main | Java plugin based on OpenJDK and IcedTea |
sun-java6-plugin *
|
I:10 | 100 | non-free | Java plugin for Sun's Java SE 6 (i386 only) |
mozilla-plugin-gnash *
|
V:0.4, I:4 | 60 | main | plugin de Flash baseado no Gnash |
flashplugin-nonfree *
|
V:1.3, I:15 | 132 | contrib | Ajudante de plugin de Flash para instalar o reprodutor de Flash da Adobe (apenas i386, amd64) |
mozilla-plugin-vlc *
|
V:3, I:4 | 128 | main | Plugin de multimédia baseado no reprodutor de média VLC |
totem-mozilla *
|
V:20, I:34 | 544 | main | Plugin de multimédia baseado no reprodutor de média Totem do GNOME |
gecko-mediaplayer *
|
V:0.6, I:0.8 | 724 | main | Plugin de multimédia baseado no MPlayer (GNOME) |
nspluginwrapper *
|
V:1.8, I:3 | 472 | contrib | Um wrapper para correr plugins i386 do Netscape em arquitectura amd64 |
![]() |
Dica |
---|---|
Although use of above Debian packages are much easier, browser plugins can
be still manually enabled by installing "*.so" into plugin directories
(e.g., " |
Some web sites refuse to be connected based on the user-agent string of your
browser. You can work around this situation by spoofing the user-agent string.
For example, you can do this by adding following line into user
configuration files such as
"~/.gnome2/epiphany/mozilla/epiphany/user.js
" or
"~/.mozilla/firefox/*.default/user.js
".
user_pref{"general.useragent.override","Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)"};
Alternatively, you can add and reset this variable by typing
"about:config
" into URL and right clicking its display
contents.
![]() |
Cuidado |
---|---|
Spoofed user-agent string may cause bad side effects with Java. |
![]() |
Cuidado |
---|---|
Se você está a configurar um servidor de mail para trocar mail directamente com a Internet, deverá fazer melhor do que ler esta documentação elementar. |
![]() |
Nota |
---|---|
Os exemplos seguintes de configuração são válidos apenas para a estação de trabalho móvel típica em ligações de consumidor de Internet. |
De modo a conter problemas de spam (correio não desejado nem solicitado), muitos ISPs que disponibilizam as ligações à Internet dos consumidores, estão a implementar contra medidas.
Quando configurar o seu sistema de mail ou resolver problemas de entrega de mail, você deve considerar estas novas limitações.
In light of these hostile Internet situation and limitations, some independent Internet mail ISPs such as Yahoo.com and Gmail.com offer the secure mail service which can be connected from anywhere on the Internet using Transport Layer Security (TLS) and its predecessor, Secure Sockets Layer (SSL).
![]() |
Cuidado |
---|---|
It is not realistic to run SMTP server on consumer grade network to send
mail directly to the remote host reliably. They are very likely to be
rejected. You must use some smarthost services offered by your connection
ISP or independent mail ISPs. For the simplicity, I assume that the
smarthost is located at " |
The most simple mail configuration is that the mail is sent to the ISP's
smarthost and received from ISP's POP3 server by the MUA (see Secção 6.4, “Agente utilizador de mail (MUA)”) itself. This type of configuration is
popular with full featured GUI based MUA such as
icedove
(1), evolution
(1), etc. If you
need to filter mail by their types, you use MUA's filtering function. For
this case, the local MTA (see Secção 6.3, “Agente de transporte de mail (MTA)”)
need to do local delivery only.
The alternative mail configuration is that the mail is sent via local MTA to
the ISP's smarthost and received from ISP's POP3 by the mail retriever (see
Secção 6.5, “O adquiridor de mail remoto e utilitário de reencaminhamento”) to the
local mailbox. If you need to filter mail by their types, you use MDA with
filter (see Secção 6.6, “Agente de entrega de mail (MDA) com filtro”) to
filter mail into separate mailboxes. This type of configuration is popular
with simple console based MUA such as mutt
(1),
gnus
(1), etc., although this is possible with any MUAs
(see Secção 6.4, “Agente utilizador de mail (MUA)”). For this case, the local MTA
(see Secção 6.3, “Agente de transporte de mail (MTA)”) need to do both smarthost
delivery and local delivery. Since mobile workstation does not have valid
FQDN, you must configure the local MTA to hide and spoof the real local mail
name in outgoing mail to avoid mail delivery errors (see Secção 6.3.3, “A configuração do endereço de mail”).
![]() |
Dica |
---|---|
Você pode desejar configurar o MUA/MDA para usar Maildir para armazenar as mensagens de email algures sob o seu directório home. |
Para uma estação de trabalho normal, a escolha popular para Agente de
Transporte de Mail (MTA) é ou o pacote exim4-*
ou o
postfix
. A escolha é sua.
Tabela 6.3. Lista de pacotes básicos relacionados com agente de transporte de mail para estação de trabalho
pacote | popcon | tamanho | descrição |
---|---|---|---|
exim4-daemon-light *
|
V:60, I:65 | 1104 | Agente de transporte de mail Exim4 (MTA: predefinido em Debian) |
exim4-base *
|
V:62, I:68 | 1688 | Documentação do Exim4 (texto) e ficheiros comuns |
exim4-doc-html *
|
I:0.6 | 3440 | Documentação do Exim4 (html) |
exim4-doc-info *
|
I:0.3 | 556 | Documentação do Exim4 (info) |
postfix *
|
V:18, I:20 | 3492 | Agente de transporte de mail Postfix (MTA: alternativo) |
postfix-doc *
|
I:1.9 | 3420 | Documentação do Postfix (html+texto) |
sasl2-bin *
|
V:2, I:5 | 448 | Implementação Cyrus SASL API (postfix suplementar para SMTP AUTH) |
cyrus-sasl2-doc *
|
I:2 | 284 | Cyrus SASL - documentação |
Although the popcon vote count of exim4-*
looks several
times popular than that of postfix
, this does not mean
postfix
is not popular with Debian developers. The
Debian server system uses both exim4
and
postfix
. The mail
header analysis of mailing list postings from prominent Debian
developers also indicate both of these MTAs are as popular.
The exim4-*
packages are known to have very small memory
consumption and very flexible for its configuration. The
postfix
package is known to be compact, fast, simple, and
secure. Both come with ample documentation and are as good in quality and
license.
Existem muitas escolhas para pacotes de agente de transporte de mail (MTA) com capacidades e objectivos diferentes no arquivo Debian.
Tabela 6.4. Lista de escolhas para pacotes de agente de transporte de mail (MTA) no arquivo Debian.
pacote | popcon | tamanho | capacidade e focagem |
---|---|---|---|
exim4-daemon-light *
|
V:60, I:65 | 1104 | completo |
postfix *
|
V:18, I:20 | 3492 | completo (segurança) |
exim4-daemon-heavy *
|
V:1.7, I:1.9 | 1220 | completo (flexibilidade) |
sendmail-bin *
|
V:1.9, I:2 | 2052 | completo (apenas se você já está familiarizado) |
nullmailer *
|
V:0.7, I:0.8 | 436 | nu, nenhum mail local |
ssmtp
*
|
V:1.2, I:1.7 | 0 | nu, nenhum mail local |
courier-mta *
|
V:0.14, I:0.15 | 12316 | muito completo (interface web, etc.) |
xmail
*
|
V:0.14, I:0.16 | 836 | leve |
masqmail *
|
V:0.04, I:0.05 | 624 | leve |
esmtp
*
|
V:0.09, I:0.2 | 172 | leve |
esmtp-run *
|
V:0.07, I:0.11 | 64 |
leve (extensão de compatibilidade do sendmail para esmtp )
|
msmtp
*
|
V:0.3, I:0.8 | 340 | leve |
msmtp-mta *
|
V:0.11, I:0.15 | 32 |
leve (extensão de compatibilidade do sendmail para msmtp )
|
Para mail de Internet com smarthost, você (re)configura o pacote
exim4-*
como o seguinte.
$ sudo /etc/init.d/exim4 stop $ sudo dpkg-reconfigure exim4-config
Select "mail sent by smarthost; received via SMTP or fetchmail" for "General type of mail configuration".
Set "System mail name:" to its default as the FQDN (see Secção 5.1.2, “A resolução de nome de máquina”).
Set "IP-addresses to listen on for incoming SMTP connections:" to its default as "127.0.0.1 ; ::1".
Unset contents of "Other destinations for which mail is accepted:".
Unset contents of "Machines to relay mail for:".
Set "IP address or host name of the outgoing smarthost:" to "smtp.hostname.dom:587".
Select "<No>" for "Hide local mail name in outgoing mail?". (Use
"/etc/email-addresses
" as in Secção 6.3.3, “A configuração do endereço de mail”, instead.)
Reply to "Keep number of DNS-queries minimal (Dial-on-Demand)?" as one of the following.
Defina o "Método de entrega para mail local:" para "formato mbox em /var/mail".
Seleccione "<Sim>" para "Dividir configuração em pequenos ficheiros?:".
Crie entradas de palavra-passe para o smarthost ao editar
"/etc/exim4/passwd.client
".
$ sudo vim /etc/exim4/passwd.client ... $ cat /etc/exim4/passwd.client ^smtp.*\.nome_de_máquina\.domínio:nome_de_máquina@nome_de_máquina.domínio:palavra-passe
Inicie o exim4
com o seguinte.
$ sudo /etc/init.d/exim4 start
o nome de máquina em "/etc/exim4/passwd.client
" não deve
ser o alias. Você verifica o nome de máquina real com o seguinte.
$ host smtp.hostname.dom smtp.hostname.dom é um alias para smtp99.hostname.dom. smtp99.hostname.dom possui o endereço 123.234.123.89
Eu uso expressões regulares em "/etc/exim4/passwd.client
"
para contornar o problema do alias. Provavelmente o SMTP AUTH funciona mesmo
que o ISP mova a máquina apontada pelo alias.
![]() |
Cuidado |
---|---|
Você tem de executar |
![]() |
Cuidado |
---|---|
Starting |
![]() |
Nota |
---|---|
Por favor leia o guia oficial em
" |
![]() |
Dica |
---|---|
O ficheiro de personalização local
" |
![]() |
Dica |
---|---|
If you are looking for a light weight MTA that respects
" |
For the Internet mail via smarthost, you should first read postfix documentation and key manual pages.
Tabela 6.5. Lista dos manuais importantes do postfix
comando | função |
---|---|
postfix (1)
|
Programa de controlo do postfix |
postconf (1)
|
Utilitário de configuração do postfix |
postconf (5)
|
Parâmetros de configuração do postfix |
postmap (1)
|
Manutenção da tabela de buscas do Postfix |
postalias (1)
|
Manutenção da base de dados de alias do Postfix |
Você (re)configura os pacotes postfix
e
sasl2-bin
como se segue.
$ sudo /etc/init.d/postfix stop $ sudo dpkg-reconfigure postfix
Escolha "Internet com smarthost".
Defina "SMTP relay host (blank for none):" para
"[smtp.hostname.dom]:587
" e configure-o como o seguinte.
$ sudo postconf -e 'smtp_sender_dependent_authentication = yes' $ sudo postconf -e 'smtp_sasl_auth_enable = yes' $ sudo postconf -e 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd' $ sudo postconf -e 'smtp_sasl_type = cyrus' $ sudo vim /etc/postfix/sasl_passwd
Crie entradas de palavra-passe para o smarthost.
$ cat /etc/postfix/sasl_passwd [smtp.hostname.dom]:587 nome_utilizador:palavra_passe $ sudo postmap hush:/etc/postfix/sasl_passwd
Arranque o postfix
com o seguinte.
$ sudo /etc/init.d/postfix start
Here the use of "[
" and "]
" in the
dpkg-reconfigure
dialog and
"/etc/postfix/sasl_passwd
" ensures not to check MX record
but directly use exact hostname specified. See "Enabling SASL
authentication in the Postfix SMTP client" in
"usr/share/doc/postfix/html/SASL_README.html
".
There are a few mail address configuration files for mail transport, delivery and user agents.
Tabela 6.6. Lista de ficheiros de configuração relacionados com endereços de mail
ficheiro | função | aplicação |
---|---|---|
/etc/mailname
|
nome de máquina predefinido para mail (saída) |
Específico de Debian, mailname (5)
|
/etc/email-addresses
|
host name spoofing for outgoing mail |
ficheiros_de_configuração-exim4 (5) específicos do
exim (8)
|
/etc/postfix/generic
|
host name spoofing for outgoing mail | específico do postfix (1), activado após a execução do
comando postmap (1).
|
/etc/aliases
|
alias de nome de conta para mail recebido |
geral, activado após a execução do comando newaliases (1).
|
The mailname in the
"/etc/mailname
" file is usually a fully qualified domain
name (FQDN) that resolves to one of the host's IP addresses. For the mobile
workstation which does not have a hostname with resolvable IP address, set
this mailname to the value of
"hostname -f
". (This is safe choice and works for both
exim4-*
and postfix
.)
![]() |
Dica |
---|---|
The contents of " |
![]() |
Dica |
---|---|
The |
When setting the mailname to
"hostname -f
", the spoofing of the source mail address
via MTA can be realized by the following.
/etc/email-addresses
" para
exim4
(8) como explicado em
exim4-config_files
(5)
/etc/postfix/generic
" para
postfix
(1) como explicado no
generic
(5)
Para postfix
, são necessários os seguintes passos extra.
# postmap hash:/etc/postfix/generic # postconf -e 'smtp_generic_maps = hash:/etc/postfix/generic' # postfix reload
Você pode testar a configuração do endereço de email usando o seguinte.
exim
(8) com as opções -brw, -bf, -bF, -bV,
…
postmap
(1) com a opção -q
![]() |
Dica |
---|---|
O exim vem com vários programas utilitários como o
|
Existem várias operações MTA básicas. Algumas podem ser executadas via
interface de compatibilidade do sendmail
(1).
Tabela 6.7. Lista de operações MTA básicas
comando exim | comando postfix | descrição |
---|---|---|
sendmail
|
sendmail
|
read mails from standard input and arrange for delivery
(-bm )
|
mailq
|
mailq
|
lista a lista de espera de mail com estado e ID de lista de espera
(-bp )
|
newaliases
|
newaliases
|
inicializa a base de dados e alias (-I )
|
exim4 -q
|
postqueue -f
|
enxagua mails em espera (-q )
|
exim4 -qf
|
postsuper -r ALL deferred; postqueue -f
|
enxagua todos mails |
exim4 -qff
|
postsuper -r ALL; postqueue -f
|
enxagua até mails congelados |
exim4 -Mg queue_id
|
postsuper -h queue_id
|
congela uma mensagem pelo seu ID de lista de espera |
exim4 -Mrm queue_id
|
postsuper -d queue_id
|
remove uma mensagem pelo seu ID de lista de espera |
N/D |
postsuper -d ALL
|
remove todas as mensagens |
![]() |
Dica |
---|---|
Poderá ser uma boa ideia enxaguar todos os mails por um script em
" |
If you subscribe to Debian related mailing list, it may be a good idea to
use such MUA as mutt
and gnus
which
are the de facto standard for the participant and known to behave as
expected.
Tabela 6.8. Lista de agentes utilizador de mail (MUA)
pacote | popcon | tamanho | tipo |
---|---|---|---|
iceweasel *
|
V:30, I:48 | 3761 | X GUI program (unbranded Mozilla Firefox) |
evolution *
|
V:16, I:34 | 4724 | X GUI program (part of a groupware suite) |
icedove *
|
V:8, I:12 | 38864 | X GUI program (unbranded Mozilla Thunderbird) |
mutt
*
|
V:26, I:83 | 6004 |
character terminal program probably used with vim
|
gnus
*
|
V:0.06, I:0.3 | 6453 |
character terminal program under (x)emacs
|
Customize "~/.muttrc
" as the following to use
mutt
as the mail user agent (MUA) in combination with
vim
.
# # User configuration file to override /etc/Muttrc # # spoof source mail address set use_from set hostname=example.dom set from="Name Surname <username@example.dom>" set signature="~/.signature" # vim: "gq" to reformat quotes set editor="vim -c 'set tw=72 et ft=mail'" # "mutt" goes to Inbox, while "mutt -y" lists mailboxes set mbox_type=Maildir # use qmail Maildir format for creating mbox set mbox=~/Mail # keep all mail boxes in $HOME/Mail/ set spoolfile=+Inbox # mail delivered to $HOME/Mail/Inbox set record=+Outbox # save fcc mail to $HOME/Mail/Outbox set postponed=+Postponed # keep postponed in $HOME/Mail/postponed set move=no # do not move Inbox items to mbox set quit=ask-yes # do not quit by "q" only set delete=yes # always delete w/o asking while exiting set fcc_clear # store fcc as non encrypted # Mailboxes in Maildir (automatic update) mailboxes `cd ~/Mail; /bin/ls -1|sed -e 's/^/+/' | tr "\n" " "` unmailboxes Maillog *.ev-summary ## Default #set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %s" ## Thread index with senders (collapse) set index_format="%4C %Z %{%b %d} %-15.15n %?M?(#%03M)&(%4l)? %s" ## Default #set folder_format="%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %f" ## just folder names set folder_format="%2C %t %N %f"
Adicione o seguinte ao "/etc/mailcap
" or
"~/.mailcap
" para mostrar mail em HTML e anexos do MS
Word 'inline'.
text/html; lynx -force_html %s; needsterminal; application/msword; /usr/bin/antiword '%s'; copiousoutput; description="Microsoft Word Text"; nametemplate=%s.doc
![]() |
Dica |
---|---|
O Mutt pode ser usado como o cliente IMAP e o
conversor de formato de mailbox. Você pode etiquetar as mensagens com
" |
Although fetchmail
(1) has been de facto standard for the
remote mail retrieval on GNU/Linux, the author likes
getmail
(1) now. If you want to reject mail before
downloading to save bandwidth, mailfilter
or
mpop
may be useful. Whichever mail retriever utilities
are used, it is good idea to configure system to deliver retrieved mails to
MDA, such as maildrop
, via pipe.
Tabela 6.9. Lista de adquiridores de mail remoto e utilitários de reencaminhamento
pacote | popcon | tamanho | descrição |
---|---|---|---|
fetchmail *
|
V:2, I:5 | 2588 | adquiridor de mail (POP3, APOP, IMAP) (antigo) |
getmail4 *
|
V:0.3, I:0.9 | 668 | adquiridor de mail (POP3, IMAP4, e SDPS) (simples, seguro e de confiança) |
mailfilter *
|
V:0.00, I:0.07 | 332 | adquiridor de mail (POP3) com capacidade de filtragem por expressões regulares |
mpop
*
|
V:0.01, I:0.08 | 324 | adquiridor de mail (POP3) e MDA com capacidade de filtragem |
getmail
(1) configuration is described in getmail documentation. Here is my set
up to access multiple POP3 accounts as user.
Crie "/usr/local/bin/getmails
" como o seguinte.
#!/bin/sh set -e if [ -f $HOME/.getmail/running ]; then echo "getmail já está a correr ... (se não, remova $HOME/.getmail/running)" >&2 pgrep -l "getmai[l]" exit 1 else echo "getmail não está a correr ... " >&2 fi if [ -f $HOME/.getmail/stop ]; then echo "não correr o getmail ... (se não, remova $HOME/.getmail/stop)" >&2 exit fi if [ "x$1" = "x-l" ]; then exit fi rcfiles="/usr/bin/getmail" for file in $HOME/.getmail/config/* ; do rcfiles="$rcfiles --rcfile $file" done date -u > $HOME/.getmail/running eval "$rcfiles $@" rm $HOME/.getmail/running
Configure-o como o seguinte.
$ sudo chmod 755 /usr/local/bin/getmails $ mkdir -m 0700 $HOME/.getmail $ mkdir -m 0700 $HOME/.getmail/config $ mkdir -m 0700 $HOME/.getmail/log
Crie ficheiros de configuração
"$HOME/.getmail/config/pop3_name
" para cada conta POP3
como o seguinte.
[retriever] type = SimplePOP3SSLRetriever server = pop.exemplo.com username = nome_pop3@exemplo.com password = secreta [destination] type = MDA_external path = /usr/bin/maildrop unixfrom = True [options] verbose = 0 delete = True delivered_to = False message_log = ~/.getmail/log/pop3_name.log
Configure-o como o seguinte.
$ chmod 0600 $HOME/.getmail/config/*
Schedule "/usr/local/bin/getmails
" to run every 15
minutes with cron
(8) by executing "sudo crontab
-e -u <user_name>
" and adding following to user's cron
entry.
5,20,35,50 * * * * /usr/local/bin/getmails --quiet
![]() |
Dica |
---|---|
Problems of POP3 access may not come from |
Most MTA programs, such as postfix
and
exim4
, function as MDA (mail delivery agent). There are
specialized MDA with filtering capabilities.
Although procmail
(1) has been de facto standard for MDA
with filter on GNU/Linux, author likes maildrop
(1) now.
Whichever filtering utilities are used, it is good idea to configure system
to deliver filtered mails to a qmail-style
Maildir.
Tabela 6.10. Lista de MDA com filtro
pacote | popcon | tamanho | descrição |
---|---|---|---|
procmail *
|
V:19, I:84 | 368 | MDA com filtro (antigo) |
mailagent *
|
V:0.3, I:5 | 1692 | MDA com filtro Perl |
maildrop *
|
V:0.3, I:0.8 | 1000 | MDA com linguagem de filtragem estruturada |
A configuração do maildrop
(1) está descrita em documentação do
maildropfilter. Aqui está um exemplo de configuração para
"$HOME/.mailfilter
".
# Local configuration MAILROOT="$HOME/Mail" # set this to /etc/mailname contents MAILHOST="example.dom" logfile $HOME/.maildroplog # rules are made to override the earlier value by the later one. # mailing list mails ? if ( /^Precedence:.*list/:h || /^Precedence:.*bulk/:h ) { # rules for mailing list mails # default mailbox for mails from mailing list MAILBOX="Inbox-list" # default mailbox for mails from debian.org if ( /^(Sender|Resent-From|Resent-Sender): .*debian.org/:h ) { MAILBOX="service.debian.org" } # default mailbox for mails from bugs.debian.org (BTS) if ( /^(Sender|Resent-From|Resent-sender): .*@bugs.debian.org/:h ) { MAILBOX="bugs.debian.org" } # mailbox for each properly maintained mailing list with "List-Id: foo" or "List-Id: ...<foo.bar>" if ( /^List-Id: ([^<]*<)?([^<>]*)>?/:h ) { MAILBOX="$MATCH2" } } else { # rules for non-mailing list mails # default incoming box MAILBOX="Inbox-unusual" # local mails if ( /Envelope-to: .*@$MAILHOST/:h ) { MAILBOX="Inbox-local" } # html mails (99% spams) if ( /DOCTYPE html/:b ||\ /^Content-Type: text\/html/ ) { MAILBOX="Inbox-html" } # blacklist rule for spams if ( /^X-Advertisement/:h ||\ /^Subject:.*BUSINESS PROPOSAL/:h ||\ /^Subject:.*URGENT.*ASISSTANCE/:h ||\ /^Subject: *I NEED YOUR ASSISTANCE/:h ) { MAILBOX="Inbox-trash" } # whitelist rule for normal mails if ( /^From: .*@debian.org/:h ||\ /^(Sender|Resent-From|Resent-Sender): .*debian.org/:h ||\ /^Subject: .*(debian|bug|PATCH)/:h ) { MAILBOX="Inbox" } # whiltelist rule for BTS related mails if ( /^Subject: .*Bug#.*/:h ||\ /^(To|Cc): .*@bugs.debian.org/:h ) { MAILBOX="bugs.debian.org" } # whitelist rule for getmails cron mails if ( /^Subject: Cron .*getmails/:h ) { MAILBOX="Inbox-getmails" } } # check existance of $MAILBOX `test -d $MAILROOT/$MAILBOX` if ( $RETURNCODE == 1 ) { # create maildir mailbox for $MAILBOX `maildirmake $MAILROOT/$MAILBOX` } # deliver to maildir $MAILBOX to "$MAILROOT/$MAILBOX/" exit
![]() |
Atenção |
---|---|
Unlike |
Aqui está uma configuração semelhante com
"$HOME/.procmailrc
" para procmail
(1).
MAILDIR=$HOME/Maildir DEFAULT=$MAILDIR/Inbox/ LOGFILE=$MAILDIR/Maillog # clearly bad looking mails: drop them into X-trash and exit :0 * 1^0 ^X-Advertisement * 1^0 ^Subject:.*BUSINESS PROPOSAL * 1^0 ^Subject:.*URGENT.*ASISSTANCE * 1^0 ^Subject: *I NEED YOUR ASSISTANCE X-trash/ # Delivering mailinglist messages :0 * 1^0 ^Precedence:.*list * 1^0 ^Precedence:.*bulk * 1^0 ^List- * 1^0 ^X-Distribution:.*bulk { :0 * 1^0 ^Return-path:.*debian-devel-admin@debian.or.jp jp-debian-devel/ :0 * ^Resent-Sender.*debian-user-request@lists.debian.org debian-user/ :0 * ^Resent-Sender.*debian-devel-request@lists.debian.org debian-devel/ :0 * ^Resent-Sender.*debian-announce-request@lists.debian.org debian-announce :0 mailing-list/ } :0 Inbox/
You need to manually deliver mails to the sorted mailboxes in your home
directory from "/var/mail/<username>
" if your home
directory became full and procmail
(1) failed. After
making disk space in the home directory, run the following.
# /etc/init.d/${MAILDAEMON} stop # formail -s procmail </var/mail/<nome_de_utilizador> # /etc/init.d/${MAILDAEMON} start
If you are to run a private server on LAN, you may consider to run POP3 / IMAP4 server for delivering mail to LAN clients.
Tabela 6.11. Lista de Servidores POP3/IMAP4
pacote | popcon | tamanho | tipo | descrição |
---|---|---|---|---|
qpopper *
|
V:1.1, I:4 | 636 | POP3 | Servidor POP3 Qualcomm avançado BSD |
courier-pop *
|
V:1.6, I:2 | 244 | POP3 | Servidor de mail courier - Servidor POP3 (apenas formato maildir) |
ipopd
*
|
V:0.10, I:0.18 | 212 | POP3 | O servidor POP2 e POP3 da Universidade de Washington |
cyrus-pop3d-2.2 *
|
V:0.18, I:0.3 | 852 | POP3 | Sistema de mail cyrus (suporte de POP3) |
xmail
*
|
V:0.14, I:0.16 | 836 | POP3 | Servidor de mail ESMTP/POP3 |
courier-imap *
|
V:2, I:3 | 1624 | IMAP | Servidor de mail courier - Servidor IMAP (apenas formato maildir) |
uw-imapd *
|
V:0.7, I:4 | 280 | IMAP | O servidor IMAP da Universidade de Washington |
cyrus-imapd-2.2 *
|
V:0.4, I:0.6 | 2632 | IMAP | Sistema de mail cyrus (suporte de IMAP) |
In the old Unix-like system, the BSD Line printer daemon was the standard. Since the standard print out format of the free software is PostScript on the Unix like system, some filter system was used along with Ghostscript to enable printing to the non-PostScript printer.
Recently, Common UNIX Printing System (CUPS) is the new de facto standard. The CUPS uses Internet Printing Protocol (IPP). The IPP is now supported by other OSs such as Windows XP and Mac OS X and has became new cross-platform de facto standard for remote printing with bi-directional communication capability.
The standard printable data format for the application on the Debian system is the PostScript (PS) which is a page description language. The data in PS format is fed into the Ghostscript PostScript interpreter to produce the printable data specific to the printer. See Secção 11.3.1, “Ghostscript”.
Thanks to the file format dependent auto-conversion feature of the CUPS
system, simply feeding any data to the lpr
command should
generate the expected print output. (In CUPS, lpr
can be
enabled by installing the cups-bsd
package.)
O sistema Debian tem alguns pacotes notáveis para os servidores e utilitários de impressão.
Tabela 6.12. Lista de servidores de impressoras e utilitários
pacote | popcon | tamanho | porto | descrição |
---|---|---|---|---|
lpr
*
|
V:2, I:2 | 440 | impressora (515) | BSD lpr/lpd (daemon de impressora de linha) |
lprng
*
|
V:0.6, I:1.3 | 2904 | , , | , , (Avançado) |
cups
*
|
V:33, I:44 | 15540 | IPP (631) | Servidor CUPS de Impressão em Internet |
cups-client *
|
V:17, I:46 | 908 | , , |
System V printer commands for
CUPS: lp (1), lpstat (1),
lpoptions (1), cancel (1),
lpmove (8), lpinfo (8),
lpadmin (8), …
|
cups-bsd *
|
V:7, I:41 | 420 | , , |
comandos de impressão BSD para o
CUPS: lpr (1), lpq (1),
lprm (1), lpc (8)
|
cups-driver-gutenprint *
|
V:12, I:38 | 1212 | Não aplicável | Drivers de impressoras para o CUPS |
![]() |
Dica |
---|---|
Você pode configurar o sistema CUPS ao apontar o seu explorador web para "http://localhost:631/" . |
The Secure SHell (SSH) is the secure way to connect over the Internet. A free
version of SSH called OpenSSH is available as
openssh-client
and openssh-server
packages in Debian.
Tabela 6.13. Lista de servidores de acesso remoto e utilitários
pacote | popcon | tamanho | ferramenta | descrição |
---|---|---|---|---|
openssh-client *
|
V:52, I:99 | 2104 |
ssh (1)
|
Cliente de shell segura |
openssh-server *
|
V:70, I:83 | 700 |
sshd (8)
|
Servidor de shell segura |
ssh-askpass-fullscreen *
|
V:0.08, I:0.4 | 92 |
ssh-askpass-fullscreen (1)
|
pede ao utilizador uma frase passe para ssh-add (GNOME2) |
ssh-askpass *
|
V:0.7, I:5 | 156 |
ssh-askpass (1)
|
pede ao utilizador uma frase passe para ssh-add (X simples) |
![]() |
Cuidado |
---|---|
Veja Secção 4.7.3, “Medidas de segurança extra para a Internet” se o seu SSH for acessível a partir da Internet. |
![]() |
Dica |
---|---|
Please use the |
![]() |
Atenção |
---|---|
" |
SSH tem dois protocolos de autenticação.
Tabela 6.14. Lista de protocolos e métodos de autenticação do SSH
Protocolo SSH | Método SSH | descrição |
---|---|---|
SSH-1 |
"RSAAuthentication "
|
autenticação de utilizador baseada em chave de identificação RSA |
, , |
"RhostsAuthentication "
|
autenticação baseada em ".rhosts " (insegura, desactivada)
|
, , |
"RhostsRSAAuthentication "
|
autenticação de máquina baseada em ".rhosts " combinada
com chave de máquina RSA (desactivada)
|
, , |
"ChallengeResponseAuthentication "
|
autenticação challenge-response RSA |
, , |
"PasswordAuthentication "
|
autenticação baseada em palavra-passe |
SSH-2 |
"PubkeyAuthentication "
|
autenticação do utilizador baseada em chave pública |
, , |
"HostbasedAuthentication "
|
autenticação de máquina baseada em "~/.rhosts " ou
"/etc/hosts.equiv " combinada com chave pública de
autenticação da máquina cliente (desactivada)
|
, , |
"ChallengeResponseAuthentication "
|
autenticação challenge-response |
, , |
"PasswordAuthentication "
|
autenticação baseada em palavra-passe |
![]() |
Cuidado |
---|---|
Tenha cuidado com estas diferenças se você não estiver a usar um sistema Debian. |
Veja "/usr/share/doc/ssh/README.Debian.gz
",
ssh
(1), sshd
(8),
ssh-agent
(1), e ssh-keygen
(1) para
detalhes.
Os ficheiros de configuração chave são os seguintes.
Tabela 6.15. Lista de ficheiros de configuração do SSH
ficheiro de configuração | descrição do ficheiro de configuração |
---|---|
/etc/ssh/ssh_config
|
Predefinições do cliente SSH, veja ssh_config (5)
|
/etc/ssh/sshd_config
|
Predefinições do sevidor SSH, veja sshd_config (5)
|
~/.ssh/authorized_keys
|
chaves SSH públicas predefinidas que os clientes usam para ligar a esta conta neste servidor SSH |
~/.ssh/identity
|
chave SSH-1 RSA secreta do utilizador |
~/.ssh/id_rsa
|
chave SSH-2 RSA secreta do utilizador |
~/.ssh/id_dsa
|
chave SSH-2 DSA secreta do utilizador |
![]() |
Dica |
---|---|
Veja |
![]() |
Dica |
---|---|
Certifique-se de verificar as configurações ao testar a ligação. Em caso de
problemas, use " |
![]() |
Dica |
---|---|
Você pode mudar a frase-passe para encriptar chaves SSH secretas locais mais
tarde com " |
![]() |
Dica |
---|---|
You can add options to the entries in
" |
O seguinte inicia uma ligação ssh
(1) a partir de um
cliente.
Tabela 6.16. Lista de exemplos de arranque do cliente SSH
comando | descrição |
---|---|
ssh nome_utilizador@máquina.domínio.externo
|
ligar com modo predefinido |
ssh -v nome_utilizador@máquina.domínio.externo
|
ligar com modo predefinido com mensagens de depuração |
ssh -1 nome_utilizador@máquina.domínio.externo
|
força a ligação com SSH versão 1 |
ssh -1 -o RSAAuthentication=no -l nome_utilizador
máquina.domínio.externo
|
força o uso de palavra-passe com SSH versão 1 |
ssh -o PreferredAuthentications=password -l nome_utilizador
máquina.domínio.externo
|
força o uso de palavra-passe com SSH versão 2 |
If you use the same user name on the local and the remote host, you can
eliminate typing "username@
". Even if you use different
user name on the local and the remote host, you can eliminate it using
"~/.ssh/config
". For Debian Alioth service with account name
"foo-guest
", you set "~/.ssh/config
"
to contain the following.
Host alioth.debian.org svn.debian.org git.debian.org User foo-guest
For the user, ssh
(1) functions as a smarter and more
secure telnet
(1). Unlike telnet
command, ssh
command does not bomb on the
telnet
escape character (initial default CTRL-]).
To establish a pipe to connect to port 25 of
remote-server
from port 4025 of
localhost
, and to port 110 of
remote-server
from port 4110 of
localhost
through ssh
, execute on the
local host as the following.
# ssh -q -L 4025:remote-server:25 4110:remote-server:110 username@remote-server
This is a secure way to make connections to SMTP/POP3 servers over the
Internet. Set the "AllowTcpForwarding
" entry to
"yes
" in "/etc/ssh/sshd_config
" of the
remote host.
One can avoid having to remember passwords for remote systems by using
"RSAAuthentication
" (SSH-1 protocol) or
"PubkeyAuthentication
" (SSH-2 protocol).
On the remote system, set the respective entries,
"RSAAuthentication yes
" or "PubkeyAuthentication
yes
", in "/etc/ssh/sshd_config
".
Crie chaves de autenticação localmente e instale a chave pública no sistema remoto como o seguinte.
RSAAuthentication
": chave RSA para SSH-1 (descontinuado
porque foi substituído.)
$ ssh-keygen $ cat .ssh/identity.pub | ssh utilizador1@remoto "cat - >>.ssh/authorized_keys"
PubkeyAuthentication
": chave RSA para SSH-2
$ ssh-keygen -t rsa $ cat .ssh/id_rsa.pub | ssh utilizador1@remoto "cat - >>.ssh/authorized_keys"
PubkeyAuthentication
": chave DSA para SSH-2
(descontinuado porque é lento.)
$ ssh-keygen -t dsa $ cat .ssh/id_dsa.pub | ssh utilizador1@remoto "cat - >>.ssh/authorized_keys"
![]() |
Dica |
---|---|
Use of DSA key for SSH-2 is deprecated because key is smaller and slow. There are no more reasons to work around RSA patent using DSA since it has been expired. DSA stands for Digital Signature Algorithm and slow. Also see DSA-1571-1. |
![]() |
Nota |
---|---|
For " |
Existem alguns clientes SSH livres disponíveis para outras plataformas.
Tabela 6.17. Lista de clientes SSH para outras plataformas
ambiente | programa de SSH livre |
---|---|
Windows | puTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/) (GPL) |
Windows (cygwin) | SSH em cygwin (http://www.cygwin.com/) (GPL) |
Macintosh Clássico | macSSH (http://www.macssh.com/) (GPL) |
Mac OS X |
OpenSSH; use ssh na aplicação de Terminal (GPL)
|
É mais seguro proteger as suas chaves secretas de autenticação SSH com uma
frase-passe. Se nenhuma frase-passe foi definida, use "ssh-keygen
-p
" para a definir.
Coloque a sua chave SSH pública (ex. "~/.ssh/id_rsa.pub
")
em "~/.ssh/authorized_keys
" numa máquina remota usando
uma ligação à máquina remota baseada em palavra-passe como descrito em cima.
$ ssh-agent bash $ ssh-add ~/.ssh/id_rsa Insira frase-passe para /home/<nome_de_utilizador>/.ssh/id_rsa: Identidade adicionada: /home/<nome_de_utilizador>/.ssh/id_rsa (/home/<nome_de_utilizador>/.ssh/id_rsa)
Nenhuma palavra-passe necessária desde aqui até ao próximo comando.
$ scp foo <nome_utilizador>@máquina.remota:foo
Carregue em ^D (CTRL-D) para terminar a sessão do ssh-agent.
For the X server, the normal Debian startup script executes
ssh-agent
as the parent process. So you only need to
execute ssh-add
once. For more, read
ssh-agent
(1)and ssh-add
(1).
You need to protect the process doing "shutdown -h now
"
(see Secção 1.1.8, “Como desligar o sistema”) from the termination of
SSH using the at
(1) command (see Secção 9.5.13, “Scheduling tasks once”) by the following.
# echo "shutdown -h now" | at now
Running "shutdown -h now
" in screen
(1)
(see Secção 9.1, “O programa screen”) session is another way to do the
same.
Se estiver com problemas, verifique as permissões dos ficheiros de
configuração e corra o ssh
com a opção
"-v
".
Use a opção "-P
" se você for o root e esteja a ter
problemas com a firewall; isto evita o uso dos portos de servidor 1 -- 1023.
If ssh
connections to a remote site suddenly stop
working, it may be the result of tinkering by the sysadmin, most likely a
change in "host_key
" during system maintenance. After
making sure this is the case and nobody is trying to fake the remote host by
some clever hack, one can regain a connection by removing the
"host_key
" entry from
"~/.ssh/known_hosts
" on the local host.
Aqui estão outras aplicações de servidor de rede
Tabela 6.18. Lista de outras aplicações de servidor de rede
pacote | popcon | tamanho | protocolo | descrição |
---|---|---|---|---|
telnetd *
|
V:0.4, I:1.1 | 156 | TELNET | Servidor TELNET |
telnetd-ssl *
|
V:0.10, I:0.3 | 152 | , , | . . (suporte a SSL) |
nfs-kernel-server *
|
V:12, I:21 | 412 | NFS | Partilha de ficheiros do Unix |
samba
*
|
V:18, I:31 | 23096 | SMB | Partilha de ficheiros e impressoras do Windows |
netatalk *
|
V:5, I:9 | 3428 | ATP | Partilha de ficheiros e impressoras do Apple/Mac (AppleTalk) |
proftpd-basic *
|
V:6, I:7 | 4064 | FTP | Download de ficheiros geral |
wu-ftpd *
|
V:0.4, I:0.6 | 820 | , , | , , |
apache2-mpm-prefork *
|
V:38, I:42 | 68 | HTTP | Servidor web geral |
apache2-mpm-worker *
|
V:6, I:7 | 68 | , , | , , |
squid
*
|
V:6, I:7 | 1848 | , , | servidor proxy web geral |
squid3 *
|
V:1.5, I:1.8 | 3600 | , , | , , |
slpd
*
|
V:0.14, I:0.2 | 180 | SLP | Servidor OpenSLP como servidor LDAP |
bind9
*
|
V:10, I:17 | 1080 | DNS | Endereço IP para outras máquinas |
dhcp3-server *
|
V:5, I:10 | 64 | DHCP | Endereço IP do próprio cliente |
Common Internet File System Protocol (CIFS) is the same protocol as Server Message Block (SMB) and is used widely by Microsoft Windows.
![]() |
Dica |
---|---|
Use of proxy server such as |
Aqui estão outros clientes de aplicação de rede.
Tabela 6.19. Lista de clientes de aplicação de rede
pacote | popcon | tamanho | protocolo | descrição |
---|---|---|---|---|
netcat *
|
I:28 | 36 | TCP/IP | Canivete suíço do TCP/IP |
openssl *
|
V:56, I:91 | 2380 | SSL | Binário Secure Socket Layer (SSL) e ferramentas criptográficas relacionadas |
stunnel4 *
|
V:0.6, I:2 | 512 | , , | Wrapper SSL universal |
telnet *
|
V:13, I:89 | 200 | TELNET | Cliente TELNET |
telnet-ssl *
|
V:0.2, I:1.1 | 208 | , , | . . (suporte a SSL) |
nfs-common *
|
V:49, I:81 | 660 | NFS | Partilha de ficheiros do Unix |
smbclient *
|
V:6, I:35 | 45200 | SMB | Cliente de partilha de ficheiros e impressoras do MS Windows |
smbfs
*
|
V:5, I:24 | 56 | , , | Comandos de montar e desmontar para ficheiros remotos do MS Windows |
ftp
*
|
V:9, I:85 | 168 | FTP | Cliente FTP |
lftp
*
|
V:1.3, I:6 | 1876 | , , | , , |
ncftp
*
|
V:1.4, I:7 | 1276 | , , | Cliente FTP de écran completo |
wget
*
|
V:33, I:99 | 2364 | HTTP e FTP | web downloader |
curl
*
|
V:7, I:23 | 352 | , , | , , |
bind9-host *
|
V:43, I:91 | 188 | DNS |
host (1) from bind9, "Priority:
standard "
|
dnsutils *
|
V:14, I:90 | 412 | , , |
dig (1) from bind, "Priority: standard "
|
dhcp3-client *
|
V:32, I:92 | 60 | DHCP | obter endereço IP |
ldap-utils *
|
V:2, I:7 | 672 | LDAP | obter dados de um servidor LDAP |
The telnet
program enables manual connection to the
system daemons and its diagnosis.
For testing plain POP3 service, try the following
$ telnet mail.ispname.net pop3
For testing the TLS/SSL enabled POP3 service by some ISPs, you need TLS/SSL enabled
telnet
client by the telnet-ssl
or
openssl
packages.
$ telnet -z ssl pop.gmail.com 995
$ openssl s_client -connect pop.gmail.com:995
The following RFCs provide required knowledge to each system daemon.
A utilização de portos é descrita em "/etc/services
".