Koozali.org: home of the SME Server

SMTP Autenticato

Offline systemdata

  • ***
  • 42
  • +0/-0
SMTP Autenticato
« on: December 07, 2011, 09:00:56 PM »
Tempo fà per scongiurare la possibilità che un pc interno alla mia rete infetto da virus cominciasse a fare spam ho abilitato SMTP autenticato (disabilitando così il relay automatico dei pc nella LAN) e successivamente preso da un eccesso di scrupolo ho disabilitato la porta 25 in favore della 465 con SSL (il tutto seguendo la ducumentazione del wiki che posto qui sotto). Orà però per esigenze interne (ho installato un software su sme 7.5.1) devo poter ripristinare la porta 25 lasciando però attivo l'obbligo di autenticarsi con nome utente e password per poter inviare..in pratica SMTP autenticato sulla porta 25. Ovviamente sono una bestia e non vorrei fare porcherie :x
Un saluto a tutti

ps: Dall'esterno della mia rete deve però avere sempre la possibilità di usare la porta 465 con ssl per poter inviare email utilizzando il mio server aziendale

How do I enable smtp authentication for users on the internal network

mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/local
cd /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/local
cp /etc/e-smith/templates/var/service/qpsmtpd/config/peers/0/05auth_cvm_unix_local .
signal-event email-update

(note the "." at the end of the 3rd line)
Authentication for the local network will now follow the setting of config::qpsmtpd::Authentication

ie do

config setprop qpsmtpd Authentication enabled
signal-event email-update

How do I disable SMTP relay for unauthenticated LAN clients

http://forums.contribs.org/index.php?topic=38797.msg176490#msg176490

    Enable smtp authentication as shown above
    Disable un-authenticated smtp relay for the local network(s)using:

mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/relayclients
echo "# SMTP Relay from local network denied by custom template" >\
/etc/e-smith/templates-custom/var/service/qpsmtpd/config/relayclients/80relayFromLocalNetwork
signal-event email-update

    Configure your email clients to use smtps with authentication:

- change outgoing smtp port to 465 and select SSL
- enable Authentication against the outgoing mail server
« Last Edit: December 11, 2011, 09:59:24 PM by systemdata »

Online Stefano

  • *
  • 10,894
  • +3/-0
Re: SMTP Autenticato
« Reply #1 on: December 12, 2011, 12:59:27 PM »
ok.. per riassumere.. hai custom template in utilizzo?

se si eliminali.. e partiamo da 0

Offline systemdata

  • ***
  • 42
  • +0/-0
Re: SMTP Autenticato
« Reply #2 on: December 12, 2011, 03:50:10 PM »
Se li elimino e sbaglio in ufficio mi violentano :shock:

Se per bloccare la porta 25 a clients no autenticati ho fatto questo

mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/relayclients
echo "# SMTP Relay from local network denied by custom template" >\
/etc/e-smith/templates-custom/var/service/qpsmtpd/config/relayclients/80relayFromLocalNetwork

signal-event email-update
--------------------------
Quindi se io faccio un bel
cd  /etc/e-smith/templates-custom/var/service/qpsmtpd/config/
rm -rf /relayclients/
signal-event email-update

ottengo che mi rimane smtp autenticato (cosa che voglio) e si riattiva il relay dei pc della lan sulla porta 25 senza ssl????

 

« Last Edit: December 12, 2011, 03:57:39 PM by systemdata »

Online Stefano

  • *
  • 10,894
  • +3/-0
Re: SMTP Autenticato
« Reply #3 on: December 12, 2011, 04:05:04 PM »
direi di si.. eliminando il custom fragment ripristini la situazione di prima ed il comportamento di default

Offline systemdata

  • ***
  • 42
  • +0/-0
Re: SMTP Autenticato
« Reply #4 on: December 12, 2011, 06:11:48 PM »
Ho fatto come descritto sopra ora posso usare la porta 25 per i client della rete ma questi possono mandare email anche senza mettere nome utente e pwd nell'impostazione smtp del client  :-x :-x...se faccio config show smtpd mi ritorna che l'auth è dasibilitata...sono in confusione che differnza c'è tra smtpd è qpsmtpd???

[root@xxxx.xx]# config show smtpd
smtpd=service
    Authentication=disabled
    Instances=40
    InstancesPerIP=5
    MaximumDateOffset=0
    PatternsScan=disabled
    Proxy=enabled
    TCPPort=25
    TCPProxyPort=25
    VirusScan=enabled
    access=public
    status=enabled
    tnef2mime=enabled
 - - - - - - - -

devo forse fare
 
config setprop smtpd Authentication enabled (al posto di qpsmtpd)
 signal-event email-update

Online Stefano

  • *
  • 10,894
  • +3/-0
Re: SMTP Autenticato
« Reply #5 on: December 12, 2011, 06:34:37 PM »
ma tu hai anche fatto quanto detto qui:

http://wiki.contribs.org/Email#How_do_I_enable_smtp_authentication_for_users_on_the_internal_network
?

posta il risultato di
Code: [Select]
config show qpsmtpd

Offline systemdata

  • ***
  • 42
  • +0/-0
Re: SMTP Autenticato
« Reply #6 on: December 12, 2011, 06:39:56 PM »
Ho eseguito passo passo questo e ho verificato andando nelle cartelle l'effetiva creazione del file
How do I enable smtp authentication for users on the internal network

mkdir -p /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/local
cd /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/local
cp /etc/e-smith/templates/var/service/qpsmtpd/config/peers/0/05auth_cvm_unix_local .
signal-event email-update

(note the "." at the end of the 3rd line)
Authentication for the local network will now follow the setting of config::qpsmtpd::Authentication

ie do

config setprop qpsmtpd Authentication enabled
signal-event email-update


[root@xxxxx]# config show qpsmtpd
qpsmtpd=service
    Authentication=enabled
    Bcc=disabled
    BccMode=cc
    BccUser=maillog
    DNSBL=disabled
    LogLevel=6
    MaxScannerSize=25000000
    RBLList=bl.spamcop.net:combined.njabl.org:dnsbl.ahbl.org:dnsbl-1.uceprotect.net:dnsbl-2.uceprotect.net:list.dsbl.org:multihop.dsbl.org:psbl.surriel.com:zen.spamhaus.org
    RHSBL=disabled
    RequireResolvableFromHost=no
    SBLList=bogusmx.rfc-ignorant.org:multi.surbl.org:black.uribl.com:rhsbl.sorbs.net:bulk.rhs.mailpolice.com:fraud.rhs.mailpolice.com:porn.rhs.mailpolice.com:adult.rhs.mailpolice.com:ex.dnsbl.org
    TlsBeforeAuth=1
    access=public
    qplogsumm=disabled
    status=enabled
« Last Edit: December 13, 2011, 10:42:38 AM by systemdata »

Offline systemdata

  • ***
  • 42
  • +0/-0
Re: SMTP Autenticato
« Reply #7 on: December 14, 2011, 07:23:28 PM »
le operazioni che ho seguito sono corrette? Thank you

Online Stefano

  • *
  • 10,894
  • +3/-0
Re: SMTP Autenticato
« Reply #8 on: December 15, 2011, 11:36:57 AM »
ciao

ho fatto dei test ed effettivamente ho verificato che, apparentemente, NON è possibile avere email autenticata con plain auth su porta 25.. ti consiglio di chiedere sui forum in lingua inglese.

nel caso, verrai rediretto su bugzilla
quando hai postato, metti qui il link al topic, in modo che futuri lettori abbiano il riferimento, grazie