Fedora-Fr - Communauté francophone Fedora - Linux

Communauté francophone des utilisateurs de la distribution Linux Fedora.


Dernière news : Fedora 31 prêt à être utilisé !

#1 13/08/2019 16:02:47

Inscription : 25/06/2007
Messages : 236
Site Web

Les emails restent en queue


Je viens de configurer sendmail en suivant ce tuto.

J'ai indiqué les informations de connexion au moment de faire le "hash map" puis modifié mon  sendmail.mc :

dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl #     /etc/mail/make
dnl #
VERSIONID(`Personal setup')dnl
dnl #
dnl # Do not advertize sendmail version.
dnl #
dnl define(`confSMTP_LOGIN_MSG', `$j Sendmail; $b')dnl
dnl #
dnl # default logging level is 9, you might want to set it higher to
dnl # debug the configuration
dnl #
dnl define(`confLOG_LEVEL', `9')dnl
dnl #
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
dnl define(`SMART_HOST', `[smtp.gmail.com]')dnl
dnl #
dnl # Ask the server to relay
dnl GENERICS_DOMAIN(localhost.localdomain localhost)dnl
dnl #
define(`confDEF_USER_ID', ``8:12'')dnl
dnl define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST', `True')dnl
define(`confDONT_PROBE_INTERFACES', `True')dnl
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
dnl #
dnl # The following allows relaying if the user authenticates, and disallows
dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
dnl #
define(`confAUTH_OPTIONS', `A p')dnl
dnl #
dnl # which realm to use in SASL database (sasldb2)
dnl #
define(`confAUTH_REALM', `mail')dnl
dnl # 
dnl # PLAIN is the preferred plaintext authentication method and used by
dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
dnl # use LOGIN. Other mechanisms should be used if the connection is not
dnl # guaranteed secure.
dnl # Please remember that saslauthd needs to be running for AUTH. 
dnl #
dnl #
dnl # Basic sendmail TLS configuration with self-signed certificate for
dnl # inbound SMTP (and also opportunistic TLS for outbound SMTP).
dnl #
define(`confCACERT_PATH', `/etc/pki/tls/certs')dnl
define(`confCACERT', `/etc/pki/tls/certs/ca-bundle.crt')dnl
define(`confSERVER_CERT', `/etc/pki/tls/certs/sendmail.pem')dnl
define(`confSERVER_KEY', `/etc/pki/tls/private/sendmail.key')dnl
define(`confTLS_SRV_OPTIONS', `V')dnl
dnl #
dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
dnl # slapd, which requires the file to be readble by group ldap
dnl #
dnl define(`confDONT_BLAME_SENDMAIL', `groupreadablekeyfile')dnl
dnl #
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
define(`confTO_IDENT', `0')dnl
dnl # If you're operating in a DSCP/RFC-4594 environment with QoS
dnl define(`confINET_QOS', `AF11')dnl
dnl FEATURE(delay_checks)dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo/smtp-auth.db')dnl
FEATURE(`no_default_msa', `dnl')dnl
FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl
dnl #
dnl # Ask the server to use a correspondance table
dnl #
dnl # The following limits the number of processes sendmail can fork to accept 
dnl # incoming messages or process its message queues to 20.) sendmail refuses 
dnl # to accept connections once it has reached its quota of child processes.
dnl #
dnl define(`confMAX_DAEMON_CHILDREN', `20')dnl
dnl #
dnl # Limits the number of new connections per second. This caps the overhead 
dnl # incurred due to forking new sendmail processes. May be useful against 
dnl # DoS attacks or barrages of spam. (As mentioned below, a per-IP address 
dnl # limit would be useful but is not available as an option at this writing.)
dnl #
dnl define(`confCONNECTION_RATE_THROTTLE', `3')dnl
dnl #
dnl # The -t option will retry delivery if e.g. the user runs over his quota.
dnl #
FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl
dnl #
dnl # For using Cyrus-IMAPd as POP3/IMAP server through LMTP delivery uncomment
dnl # the following 2 definitions and activate below in the MAILER section the
dnl # cyrusv2 mailer.
dnl #
dnl define(`confLOCAL_MAILER', `cyrusv2')dnl
dnl define(`CYRUSV2_MAILER_ARGS', `FILE /var/lib/imap/socket/lmtp')dnl
dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 587 for
dnl # mail from MUAs that authenticate. Roaming users who can't reach their
dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
dnl # this useful.
dnl #
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 465, but
dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed
dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't
dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS
dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps
dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.
dnl #
dnl # For this to work your OpenSSL certificates must be configured.
dnl #
dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
dnl #
dnl # The following causes sendmail to additionally listen on the IPv6 loopback
dnl # device. Remove the loopback address restriction listen to the network.
dnl #
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
dnl #
dnl # enable both ipv6 and ipv4 in sendmail:
dnl #
dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')
dnl #
dnl # We strongly recommend not accepting unresolvable domains if you want to
dnl # protect yourself from spam. However, the laptop and users on computers
dnl # that do not have 24x7 DNS do need this.
dnl #
dnl #
dnl FEATURE(`relay_based_on_MX')dnl
dnl # 
dnl # Also accept email sent to "localhost.localdomain" as local email.
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(`smtp.gmail.com')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
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(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
dnl MAILER(cyrusv2)dnl

J'ai reconstruit la configuration de sendmail et rechargé le service.
La tentative d'envoi d'email me renvoie ceci :

[neo@Tron ~]$ clear && clear && echo "test content" | mail -v -s "20190813 153300"  [MYUSERNAME]@gmail.com
[MYUSERNAME]@gmail.com... Connecting to [] via relay...
220 Tron.local ESMTP Sendmail 8.15.2/8.15.2; Tue, 13 Aug 2019 15:58:29 +0200
>>> EHLO Tron.local
250-Tron.local Hello localhost [], pleased to meet you
250 HELP
220 2.0.0 Ready to start TLS
>>> EHLO Tron.local
250-Tron.local Hello localhost [], pleased to meet you
250 HELP
>>> MAIL From:<neo@Tron.local> SIZE=232 AUTH=neo@Tron.local
250 2.1.0 <neo@Tron.local>... Sender ok
>>> RCPT To:<[MYUSERNAME]@gmail.com>
>>> DATA
250 2.1.5 <[MYUSERNAME]@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 x7DDwTgk022042 Message accepted for delivery
[MYUSERNAME]@gmail.com... Sent (x7DDwTgk022042 Message accepted for delivery)
Closing connection to []
>>> QUIT
221 2.0.0 Tron.local closing connection

L'email reste en queue :

[neo@Tron ~]$ sudo mailq
		/var/spool/mqueue (8 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
x7DDwTgk022042*      13 Tue Aug 13 15:58 <neo@Tron.local>

J'ai dû rater quelque chose mais quoi et où ?
A moins qu'il faille absolument une adresse FAI mais là ça va être compliqué car je ne l'ai pas créée et le service de création d'adresse email est en erreur chez SFR.

MSI Z390-A PRO [+] INTEL i7-9700K [+] BALLISTIX Sport AT 2x8 Go DDR4 2666 MT/s [+] ASUS Dual -GTX1650-O4G GeForce GTX 1650 4 Go GDDR5
SSD Kingston AS400 480Go, TOSHIBA P300 3.5'' 3x 3 To (RAID 5) [+] Logitech  G510 Gaming keyboard [+] MADCATZ RAT 8+ 11b 16000dpi

Hors ligne

#2 13/08/2019 19:39:58

Lieu : Isère
Inscription : 05/03/2007
Messages : 5 135
Site Web

Re : Les emails restent en queue

Ca fonctionne de s'auto envoyer des mails chez Gmail ?

Mais sinon regarde ce qu'il se passe dans les logs, sûrement /var/log/maillog.

Tu as aussi cette documentation https://doc.fedora-fr.org/wiki/Configur … relai_SMTP, sinon l'utilisation de Postfix est de plus en plus préconisée tout de même.

F31_64 Gnome-Shell - GA-990FXA-UD3 - Phenom II X6 1100T - NH-D14 - Ati HD 5750 Fanless - 16Go RAM /&/ F31_64 Gnome-Shell - Toshiba Satellite C660D-19X - 8Go RAM
F31_64 - ASRock 960GC-GS FX - AMD FX(tm)-8300 - 16Go RAM

Hors ligne

Pied de page des forums