Não é possível enviar mensagens da instância amazon ec2

1

Estou usando uma instância do Amazon EC2 para dois projetos que possuem seu próprio nome de domínio. Preciso usar serviços de e-mail, então criei duas contas de e-mail no Zoho e pude receber e-mails de meus clientes. No entanto, também preciso enviar e-mails e não sei como consegui-lo.

Eu cumpri este formulário e a Amazon removeu meus limites de envio de e-mail. Além disso, acho que também tenho DNS reverso.

Há alguns dias, consegui enviar e-mails apenas para os endereços @gmail, mas agora não posso fazer isso:

Esteéomeuarquivosendmail.mc:

divert(-1)dnldnl#dnl#Thisisthesendmailmacroconfigfileform4.Ifyoumakechangestodnl#/etc/mail/sendmail.mc,youwillneedtoregeneratethednl#/etc/mail/sendmail.cffilebyconfirmingthatthesendmail-cfpackageisdnl#installedandthenperformingadnl#dnl#/etc/mail/makednl#include('/usr/share/sendmail-cf/m4/cf.m4')dnlVERSIONID('setupforlinux')dnlOSTYPE('linux')dnldnl#dnl#Donotadvertizesendmailversion.dnl#dnldefine('confSMTP_LOGIN_MSG','$jSendmail;$b')dnldnl#dnl#defaultlogginglevelis9,youmightwanttosetithighertodnl#debugtheconfigurationdnl#dnldefine('confLOG_LEVEL','9')dnldnl#dnl#Uncommentandeditthefollowinglineifyouroutgoingmailneedstodnl#besentoutthroughanexternalmailserver:dnl#dnldefine('SMART_HOST','smtp.your.provider')dnldnl#define('confDEF_USER_ID',''8:12'')dnldnldefine('confAUTO_REBUILD')dnldefine('confTO_CONNECT','1m')dnldefine('confTRY_NULL_MX_LIST','True')dnldefine('confDONT_PROBE_INTERFACES','True')dnldefine('PROCMAIL_MAILER_PATH','/usr/bin/procmail')dnldefine('ALIAS_FILE','/etc/aliases')dnldefine('STATUS_FILE','/var/log/mail/statistics')dnldefine('UUCP_MAILER_MAX','2000000')dnldefine('confUSERDB_SPEC','/etc/mail/userdb.db')dnldefine('confPRIVACY_FLAGS','authwarnings,novrfy,noexpn,restrictqrun')dnldefine('confAUTH_OPTIONS','A')dnldnl#dnl#Thefollowingallowsrelayingiftheuserauthenticates,anddisallowsdnl#plaintextauthentication(PLAIN/LOGIN)onnon-TLSlinksdnl#dnldefine('confAUTH_OPTIONS','Ap')dnldnl#dnl#PLAINisthepreferredplaintextauthenticationmethodandusedbydnl#MozillaMailandEvolution,thoughOutlookExpressandotherMUAsdodnl#useLOGIN.Othermechanismsshouldbeusediftheconnectionisnotdnl#guaranteedsecure.dnl#PleaserememberthatsaslauthdneedstoberunningforAUTH.dnl#dnlTRUST_AUTH_MECH('EXTERNALDIGEST-MD5CRAM-MD5LOGINPLAIN')dnldnldefine('confAUTH_MECHANISMS','EXTERNALGSSAPIDIGEST-MD5CRAM-MD5LOGINPL$dnl#dnl#RudimentaryinformationoncreatingcertificatesforsendmailTLS:dnl#cd/etc/pki/tls/certs;makesendmail.pemdnl#Completeusage:dnl#make-C/etc/pki/tls/certsusagednl#dnldefine('confCACERT_PATH','/etc/pki/tls/certs')dnldnldefine('confCACERT','/etc/pki/tls/certs/ca-bundle.crt')dnldnldefine('confSERVER_CERT','/etc/pki/tls/certs/sendmail.pem')dnldnldefine('confSERVER_KEY','/etc/pki/tls/certs/sendmail.pem')dnldnl#dnl#ThisallowssendmailtouseakeyfilethatissharedwithOpenLDAP'sdnl#slapd,whichrequiresthefiletobereadblebygroupldapdnl#dnldefine('confDONT_BLAME_SENDMAIL','groupreadablekeyfile')dnldnl#dnldefine('confTO_QUEUEWARN','4h')dnldnldefine('confTO_QUEUERETURN','5d')dnldnldefine('confQUEUE_LA','12')dnldnldefine('confREFUSE_LA','18')dnldefine('confTO_IDENT','0')dnldnlFEATURE(delay_checks)dnlFEATURE('no_default_msa','dnl')dnlFEATURE('smrsh','/usr/sbin/smrsh')dnlFEATURE('mailertable','hash-o/etc/mail/mailertable.db')dnlFEATURE('virtusertable','hash-o/etc/mail/virtusertable.db')dnlFEATURE(redirect)dnlFEATURE(always_add_domain)dnlFEATURE(use_cw_file)dnlFEATURE(use_ct_file)dnldnl#dnl#Thefollowinglimitsthenumberofprocessessendmailcanforktoacceptdnl#incomingmessagesorprocessitsmessagequeuesto20.)sendmailrefusesdnl#toacceptconnectionsonceithasreacheditsquotaofchildprocesses.dnl#dnldefine('confMAX_DAEMON_CHILDREN','20')dnldnl#dnl#Limitsthenumberofnewconnectionspersecond.Thiscapstheoverheaddnl#incurredduetoforkingnewsendmailprocesses.Maybeusefulagainstdnl#DoSattacksorbarragesofspam.(Asmentionedbelow,aper-IPaddressdnl#limitwouldbeusefulbutisnotavailableasanoptionatthiswriting.)dnl#dnldefine('confCONNECTION_RATE_THROTTLE','3')dnldnl#dnl#The-toptionwillretrydeliveryife.g.theuserrunsoverhisquota.dnl#FEATURE(local_procmail,'','procmail-t-Y-a$h-d$u')dnlFEATURE('access_db','hash-T<TMPF>-o/etc/mail/access.db')dnlFEATURE('blacklist_recipients')dnlEXPOSED_USER('root')dnldnl#dnl#ForusingCyrus-IMAPdasPOP3/IMAPserverthroughLMTPdeliveryuncommentdnl#thefollowing2definitionsandactivatebelowintheMAILERsectionthednl#cyrusv2mailer.dnl#dnldefine('confLOCAL_MAILER','cyrusv2')dnldnldefine('CYRUSV2_MAILER_ARGS','FILE/var/lib/imap/socket/lmtp')dnldnl#dnl#ThefollowingcausessendmailtoonlylistenontheIPv4loopbackaddressdnl#127.0.0.1andnotonanyothernetworkdevices.Removetheloopbackdnl#addressrestrictiontoacceptemailfromtheinternetorintranet.dnl#DAEMON_OPTIONS('Port=smtp,Addr=52.49.70.2,Name=MTA')dnlDAEMON_OPTIONS('Port=smtp,Addr=127.0.0.1,Name=MTA')dnldnl#dnl#Thefollowingcausessendmailtoadditionallylistentoport587fordnl#mailfromMUAsthatauthenticate.Roaminguserswhocan'treachtheirdnl#preferredsendmaildaemonduetoport25beingblockedorredirectedfinddnl#thisuseful.dnl#dnlDAEMON_OPTIONS('Port=submission,Name=MSA,M=Ea')dnldnl#dnl#Thefollowingcausessendmailtoadditionallylistentoport465,butdnl#startingimmediatelyinTLSmodeuponconnecting.Port25or587followeddnl#bySTARTTLSispreferred,butroamingclientsusingOutlookExpresscan'tdnl#doSTARTTLSonportsotherthan25.MozillaMailcanONLYuseSTARTTLSdnl#anddoesn'tsupportthedeprecatedsmtps;Evolution<1.1.1usessmtpsdnl#whenSSLisenabled--STARTTLSsupportisavailableinversion1.1.1.dnl#dnl#ForthistoworkyourOpenSSLcertificatesmustbeconfigured.dnl#dnlDAEMON_OPTIONS('Port=smtps,Name=TLSMTA,M=s')dnldnl#dnl#ThefollowingcausessendmailtoadditionallylistenontheIPv6loopbackdnl#device.Removetheloopbackaddressrestrictionlistentothenetwork.dnl#dnlDAEMON_OPTIONS('port=smtp,Addr=::1,Name=MTA-v6,Family=inet6')dnldnl#dnl#enablebothipv6andipv4insendmail:dnl#dnlDAEMON_OPTIONS('Name=MTA-v4,Family=inet,Name=MTA-v6,Family=inet6')dnl#dnl#Westronglyrecommendnotacceptingunresolvabledomainsifyouwanttodnl#protectyourselffromspam.However,thelaptopandusersoncomputersdnl#thatdonothave24x7DNSdoneedthis.dnl#FEATURE('accept_unresolvable_domains')dnldnl#dnlFEATURE('relay_based_on_MX')dnldnl#dnl#Alsoacceptemailsentto"localhost.localdomain" as local email.
dnl #
dnl # LOCAL_DOMAIN('localhost.localdomain')dnl
dnl #
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #
dnl MASQUERADE_AS('mydomain.com')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
dnl FEATURE(masquerade_envelope)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomain.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl

Eu tentei o que esta resposta sugere e verifiquei o emaillog e ele está vazio .

O que posso fazer para enviar e-mails para todos os meus clientes dos meus endereços domain1.com e domain2.com? Devo usar o Amazon SES? Eu acho que não é muito caro por isso, se ajudou com o meu problema eu poderia tentar

Obrigado antecipadamente

    
por Alberto Fernández 22.04.2016 / 12:47

1 resposta

1

Você deve usar o Amazon SES. Manter um servidor SMTP no EC2 é caro e não vale a pena o esforço.

No entanto, lembre-se de que a Amazon recomenda um comportamento adequado de e-mail para que você acompanhe seus retornos e remova esses endereços de e-mail inválidos. Você pode ter sua cota de envio reduzida ou até mesmo bloqueada se houver rejeições.

Eles têm o documento de práticas recomendadas do SES - link , que deve ajudá-lo a aproveitar ao máximo o SES

    
por 22.04.2016 / 12:55