Differences between revisions 1 and 2
Revision 1 as of 2019-11-14 21:46:46
Size: 2168
Editor: RicardoCosta
Comment: Translated this page to Brazilian Portuguese.
Revision 2 as of 2021-08-30 23:02:31
Size: 2227
Editor: ThiagoPezzo
Comment: fix language code, main title in pt_BR, add category, add fixme warning
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#language pt_BR
~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: Português Brasileiro - [[HowtoSendWithEximThroughSSH|English]]-~ 
#language pt-br
## English revision:

~-[[pt_BR/DebianWiki/EditorGuide#translation|Traduções]]: [[HowtoSendWithEximThroughSSH|English]] - Português (Brasil)-~
Line 83: Line 84:
FixMe: página desatualizada.
Line 84: Line 86:
----

Traduções: English - Português (Brasil)

Como enviar e-mails com o Exim através de um túnel SSH

A. Comece o túnel ssh

ssh $HOST -L 2525:$MSERVER:25

(onde $HOST é o serviço pelo qual fornece o túnel e $MSERVER é o serviço SMTP que você deseja usar)

B. Configure o exim

1. Adicione um novo arquivo de transporte /etc/exim4/conf.d/transport/40_tunneled_smtp :

  #################################
  # This transport is used for delivering messages over SSH-tunneled SMTP
  # connections to port 2525 on localhost

  ssh_tunneled_smtp:
    debug_print = "T: tunneled remote_smtp for $local_part@$domain"
    driver = smtp
    allow_localhost = true
    port = 2525
    hosts = 127.0.0.1
    hosts_override = true

2. Edite /etc/exim4/conf.d/router/200_exim4-config_primary. Na seão 'smarthost:', mude

      transport = remote_smtp_smarthost

para

      transport = ssh_tunneled_smtp

3. reinicie o serviço

  • /etc/init.d/exim4 reload

Algumas variações

  • Selecione que o transporte será através de um arquivo:

   transport = ${lookup{transport}lsearch{/etc/roaming/exim_options}{$value}{remote_smtp_smarthost}}

então, /etc/roaming/exim_options poderá conter:

   transport: ssh_tunneled_smtp

ou nada para usar o padrão

  • Tentativa de enviar somente através de uma rede:

1. Adicione um novo arquivo /etc/exim4/conf.d/main/04_roaming :

  # If the file /etc/roaming/not_online exists, don't send the messages but
  # enqueue them only
  queue_only_file = /etc/roaming/not_online

2. Adicione o gancho para criar e remover o arquivo:

  iface home inet static
    [...]
    up echo '' > /etc/roaming/exim_options
    up rm -f /etc/roaming/not_online

  iface work inet static
    [...]
    up echo 'transport: ssh_tunneled_smtp' > /etc/roaming/exim_options
    up touch /etc/roaming/not_online


Enrico Zini


FixMe: página desatualizada.


CategoryNetwork CategorySoftware CategoryMail