Telegram- 👇 😉
-
. WIKIMERIONET
Merion Mertics , ,

CRM

5

! IP Asterisk e-mail : , , , . , , Asterisk ? :

  1. System Admin Pro $25 ( 18 1 875 ) SMTP FreePBX;
  2. Postfix . :)

, , Postfix IP . . .


.

IP SSH root. Postfix:

[root@asterisk]# vim /etc/postfix/main.cf

λ ( ):

smtp_sasl_auth_enable = yes // SMTP   SMTP - 
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd // Postfix   ,          SMTP 
smtp_sasl_security_options = noanonymous //         (   )
smtp_sasl_type = cyrus //   Cyrus SASL  
smtp_sasl_mechanism_filter = login // SMTP   SASL 
smtp_sender_dependent_authentication = yes //    
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay //      relayhost.          ,   .
sender_canonical_maps = hash:/etc/postfix/canonical //       
smtp_generic_maps = hash:/etc/postfix/generic //   ,  ,     
smtp_use_tls = yes // .   TLS
myhostname = asterisk.merionet.ru //  
mydomain = merionet.ru // 
myorigin = $mydomain //  ,       root, email    root@merionet.ru (       smtp_generic_maps)
mynetworks = 127.0.0.0/8 //  .     Asterisk     
relayhost = [smtp.yandex.ru]:465 //SMTP 

:x! Enter. , main.cf. /etc/postfix/sasl_passwd :

[root@asterisk]# vim /etc/postfix/sasl_passwd

:

[root@asterisk]# 
[smtp.yandex.ru] :

. :x! Enter. sender_relay:

, . , .
[root@asterisk]# vim /etc/postfix/sender_relay

:

[root@asterisk]# @ [smtp.yandex.ru]
@ [smtp.yandex.ru]

, hostname, . , , asterisk@ [smtp.yandex.ru]. .

canonical:

[root@asterisk]# vim /etc/postfix/canonical 

:

@  __

, . . generic:

[root@asterisk]# vim /etc/postfix/generic

. , , From: @. :

root __ 
root@localhost __ 
root@localhost.localdomain __ 
root@freepbx __ 
root@freepbx.localdomain __ 
asterisk __ 
asterisk@localhost __ 
asterisk@localhost.localdomain __ 
asterisk@freepbx __ 
asterisk@freepbx.localdomain __

:x!. , :

[root@asterisk ~]# postmap /etc/postfix/generic && postmap /etc/postfix/canonical && postmap /etc/postfix/sender_relay && postmap /etc/postfix/sasl_passwd 

Postfix:

[root@asterisk ~]# service postfix restart
Shutting down postfix:                                  [  OK  ]
Starting postfix: :                                     [  OK  ]

. :

[root@asterisk ~]#  mail -s "Postfix Test with Yandex" _email < /dev/null

, :

Postfix:     Asterisk

Postfix

. . SMTP:

  1. SSH
  2. /etc/postfix/main.cf
    • relayhost = [ip SMTP ]
  3. service postfix restart
  4. /etc/postfix/sasl_passwd
    • [ip SMTP ] :
  5. postmap hash:/etc/postfix/sasl_passwd
  6. /etc/postfix/main.cf
    • smtp_sasl_auth_enable = yes
      smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
      smtp_sasl_security_options =
      smtp_generic_maps = hash:/etc/postfix/generic
      
  7. service postfix restart
  8. /etc/postfix/generic
    • , .:
      root __ 
      asterisk __ 
      .
      
  9. postmap /etc/postfix/generic
  10. service postfix restart

:

[root@asterisk ~]# tail -f /var/log/maillog

503 5.5.4 Error: send AUTH command first. , , email SMTP ( , from=<>). , /etc/postfix/generic.

warning: SASL authentication failure: No worthy mechs found, SASL (Simple Authentication and Security Layer). :

[root@asterisk ~]# yum install cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain

bash: mail: , Unix mailx. :

[root@asterisk ~]# yum install mailx