I' m fetching messages with a program called getmail that can either put the messages in Mailboxes or pass them to a MDA (mail distribution agent via stdout-stdin. As MDA, I use emailrelay-submit that places the messages in /var/spool/emailrelay.
Unfortunately, emailrelay is unable to send them. here is what it says in yhe envelope.bad file
ml@spitfire:/home/marc# cat /var/spool/emailrelay/emailrelay.14032.709829.2.envelope.bad
X-MailRelay-Format: #2821.5
X-MailRelay-Content: 7bit
X-MailRelay-From: ruchaux@lobelle.net
X-MailRelay-ToCount: 1
X-MailRelay-To-Remote: regis.lobelle@gmail.com
X-MailRelay-Authentication:
X-MailRelay-Client: 127.0.0.1
X-MailRelay-ClientCertificate:
X-MailRelay-MailFromAuthIn:
X-MailRelay-MailFromAuthOut:
X-MailRelay-End: 1
X-MailRelay-Reason: peer disconnected: ssl read
X-MailRelay-ReasonCode:
ml@spitfire:/home/marc#
The instructions to getmail are as follow
[destination]
type=MDA_external
path=/usr/local/sbin/emailrelay-submit
arguments=("--from=ruchaux@lobelle.net","--spool-dir=/var/spool/emailrelay","regis.lobelle@gmail.com")
which means the
/usr/local/sbin/emailrelay-submit --from=ruchaux@lobelle.net --spool-dir=/var/spool/emailrelay regis.lobelle@gmail.com
The messages received by emailrelay as server are forwarded without problem by emailrelay as client.
Here is the configuration in emailrlay.conf
as-server
client auth /etc/usr/local/emailrelay/emailrelay.auth
client-tls-certificate /etc/usr/local/ssl/certs/emailrelay.pem
client-tls-connection
client-tls-server-name smtp.mailfence.com
forward
forward-on-disconnect
forward-to smtp.mailfence.com:465
log
log-file /var/log/zmailrelay-%d
log-time
port 587
remote-clients
server-auth /etc/usr/local/emailrelay/emailrelay.auth
server-tls
servet-tls-certificate /etc/usr/local/ssl/certs/emailrelay.pem
server-tls-required
spool-dir /var/spool/emailrelay
verbose
poll 60
below is the record in the logs corresponding to one of the messages inserted in the spool by emailrelay-submit
emailrelay: 20250311.173349.988: info: tls/ssl protocol established with 212.3.242.80:465 certificate 1
emailrelay: 20250311.173349.989: info: smtp connection to 212.3.242.80:465
emailrelay: 20250311.173349.989: info: locking file "emailrelay.13993.709822.2.envelope"
emailrelay: 20250311.173349.998: info: rx<<: "220 smtp.mailfence.com ESMTP"
emailrelay: 20250311.173349.998: info: tx>>: "EHLO spitfire"
emailrelay: 20250311.173350.017: info: rx<<: "250-smtp.mailfence.com"
emailrelay: 20250311.173350.017: info: rx<<: "250-AUTH LOGIN PLAIN"
emailrelay: 20250311.173350.017: info: rx<<: "250-SIZE 50000000"
emailrelay: 20250311.173350.017: info: rx<<: "250 8BITMIME"
emailrelay: 20250311.173350.017: info: tx>>: "AUTH PLAIN"
emailrelay: 20250311.173350.037: info: rx<<: "334"
emailrelay: 20250311.173350.037: info: tx>>: [response not logged]
emailrelay: 20250311.173350.454: info: rx<<: "235 Authentication Successful"
emailrelay: 20250311.173350.454: info: successful authentication with remote server using mechanism [plain] and plaintext secret for [mlobelle] from line 19
emailrelay: 20250311.173350.454: info: tx>>: "MAIL FROM:ruchaux@lobelle.net BODY=8BITMIME AUTH=mlobelle"
emailrelay: 20250311.173350.475: info: rx<<: "250 OK"
emailrelay: 20250311.173350.475: info: tx>>: "RCPT TO:regis.lobelle@gmail.com"
emailrelay: 20250311.173350.509: info: rx<<: "250 OK"
emailrelay: 20250311.173350.509: info: tx>>: "DATA"
emailrelay: 20250311.173350.541: info: rx<<: "354 Start mail input; end with <crlf>.<crlf>"
emailrelay: 20250311.173350.543: info: tx>>: [470 line(s) of content]
emailrelay: 20250311.173350.543: info: tx>>: "."
emailrelay: 20250311.173352.190: info: rx<<: "554 Transaction failed. Please report this error to your system administrator (223E)"
emailrelay: 20250311.173352.190: info: failing file: "emailrelay.13993.709822.2.envelope.busy" -> "emailrelay.13993.709822.2.envelope.bad"
emailrelay: 20250311.173352.190: info: locking file "emailrelay.14006.709823.2.envelope"
emailrelay: 20250311.173352.191: info: tx>>: "MAIL FROM:ruchaux@lobelle.net BODY=8BITMIME AUTH=mlobelle"
emailrelay: 20250311.173352.191: error: forwarding: peer disconnected: ssl read
emailrelay: 20250311.173352.191: info: smtp client error: peer disconnected: ssl read
emailrelay: 20250311.173352.191: info: failing file: "emailrelay.14006.709823.2.envelope.busy" -> "emailrelay.14006.709823.2.envelope.bad"</crlf></crlf>
What is wrong or missing in the enveloppe ? How can I add it ?
Thanks for your help
Marc
The error message from the remote server says "transaction failed ... (223E)", so perhaps you could ask them if 223E is an error code and if so what it means.
Please could you compare the SMTP dialogue in the successful store-and-forward and the unsuccessful submit-and-forward, particularly the MAIL-FROM trailing options (BODY=... AUTH=...)