$ sudo service sendmail stop
Shutting down sm-client:                                   [  OK  ]
Shutting down sendmail:                                    [  OK  ]
$ sudo yum install postfix
Vérifiez la version ci-dessous
$ postconf  mail_version
mail_version = 2.6.6
Cette fois, 2.6.6 est inclus
$ sudo alternatives --config mta
Il y a 2 programmes'mta'Fournir.
Sélectionnez la commande
-----------------------------------------------
*+ 1           /usr/sbin/sendmail.sendmail
   2           /usr/sbin/sendmail.postfix
Appuyez sur Entrée pour sélectionner le[+]Ou entrez le numéro de sélection
Entrez 2 pour passer à postfix
$ sudo chkconfig sendmail off
$ chkconfig --list sendmail
sendmail       	0:off	1:off	2:off	3:off	4:off	5:off	6:off
$ sudo chkconfig --add postfix
$ sudo chkconfig postfix on
$ chkconfig --list postfix
postfix        	0:off	1:off	2:on	3:on	4:on	5:on	6:off
Désactiver le démarrage automatique de sendmail, activer le démarrage automatique de postfix
$ sendmail [email protected]
From:[email protected]
To:[email protected]
Subject:Test de transmission
C'est une transmission de test
.
Vérifiez si un email a été envoyé à [email protected]
Si vous obtenez une erreur comme postdrop: warning: impossible de rechercher public / pickup: No such file or directory, agissez ci-dessous.
$ sudo service postfix restart
Shutting down postfix:                                     [FAILED]
Starting postfix:                                          [  OK  ]
setting.py
....
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = False
DEFAULT_FROM_EMAIL = 'Nom de l'expéditeur<[email protected]>'
....
Ajoutez ce qui suit
myhostname = mybox.example.com
mydestination = localhost.server.com, localhost, example.com
La partie de example.com décrit le nom de domaine de l'adresse e-mail sortante
Installez Postfix et envoyez un e-mail | Aujourd'hui également python - How do you configure Django to send mail through Postfix? - Stack Overflow
Recommended Posts