sendmail: hoe configureer ik sendmail op ubuntu?

Toen ik zocht naar het configureren van sendmail op ubuntu kreeg ik geen duidelijk antwoord, elk van hen ging ervan uit dat ik weet waar ze het over hebben,

Ik wil alleen een basisconfiguratie om het verzenden van e-mail mogelijk te maken, in principe zal ik het gebruiken met de Google-app-engine om het verzenden van e-mail vanaf de dev-server mogelijk te maken.

Ik heb dit al gedaan:

sudo apt-get install sendmail

dan

sudo sendmailconfig

maar ik weet niet wat de laatste deed.


Antwoord 1, autoriteit 100%

Toen je sudo sendmailconfigtypte, zou je gevraagd moeten zijn om sendmail te configureren.

Ter referentie: de bestanden die tijdens de configuratie worden bijgewerkt, bevinden zich op het volgende (voor het geval u ze handmatig wilt bijwerken):

/etc/mail/sendmail.conf
/etc/cron.d/sendmail
/etc/mail/sendmail.mc

U kunt sendmail testen om te zien of het correct is geconfigureerd en ingesteld door het volgende in de opdrachtregel te typen:

$ echo "My test email being sent from sendmail" | /usr/sbin/sendmail [email protected]

Het volgende stelt u in staat om smtp-relay toe te voegen aan sendmail:

#Change to your mail config directory:
cd /etc/mail
#Make a auth subdirectory
mkdir auth
chmod 700 auth
#Create a file with your auth information to the smtp server
cd auth
touch client-info
#In the file, put the following, matching up to your smtp server:
AuthInfo:your.isp.net "U:root" "I:user" "P:password"
#Generate the Authentication database, make both files readable only by root
makemap hash client-info < client-info
chmod 600 client-info
cd ..

Voeg de volgende regels toe aan sendmail.mc, maar voorde MAILERDEFINITIONS. Zorg ervoor dat u uw smtp-server bijwerkt.

define(`SMART_HOST',`your.isp.net')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/auth/client-info.db')dnl

Voer aanmaak sendmail.cf aan (of voer make -C /etc/mailuit):

m4 sendmail.mc > sendmail.cf

Herstart de sendmail-daemon:

service sendmail restart

Antwoord 2, autoriteit 23%

Ik heb het beste antwoord werkend gekregen (kan nog niet antwoorden) na een kleine bewerking

Dit werkte niet voor mij:

FEATURE('authinfo','hash /etc/mail/auth/client-info')dnl

Het eerste enkele aanhalingsteken voor elke tekenreeks moet worden gewijzigd in een backtick (`) als volgt:

FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

Na de wijziging voer ik uit:

sudo sendmailconfig

En ik doe zaken 🙂


Antwoord 3, autoriteit 9%

Combineer twee antwoorden hierboven en ik krijg het eindelijk voor elkaar. Wees voorzichtig dat het eerste enkele aanhalingsteken voor elke string een backtick (`)is in het bestand sendmail.mc.

#Change to your mail config directory:
cd /etc/mail
#Make a auth subdirectory
mkdir auth
chmod 700 auth  #maybe not, because I cannot apply cmd "cd auth" if I do so.
#Create a file with your auth information to the smtp server
cd auth
touch client-info
#In the file, put the following, matching up to your smtp server:
AuthInfo:your.isp.net "U:root" "I:user" "P:password"
#Generate the Authentication database, make both files readable only by root
makemap hash client-info < client-info
chmod 600 client-info
cd ..
#Add the following lines to sendmail.mc. Make sure you update your smtp server
#The first single quote for each string should be changed to a backtick (`) like this:
define(`SMART_HOST',`your.isp.net')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl
#run 
sudo sendmailconfig

Other episodes