Le 17/01/2021 à 19:04, Yvan Masson a écrit :
Le 17/01/2021 à 18:55, Edgar Pettijohn a écrit :
On Sun, Jan 17, 2021 at 06:33:29PM +0100, Yvan Masson wrote:
Hi list,

I have two Debian servers that need to be able to send notification emails
via a relay. Their configuration is identical, but only the first works
properly. On the second, sending to aliases does not work:


$ echo foo | mail -s test [email protected]
-> works

$ echo foo | mail -s test root
mail: cannot send message: Process exited with a non-zero status
-> does not work :-(


Unfortunately after two hours digging I still can't find where the issue
lies??? Any pointer would be greatly appreciated!

Best regards,
Yvan


# smtpd -d -T lookup
82908be87cc7fef7 smtp event=connected address=local host=debian
lookup: check "local" as NETADDR in table static:<localhost> -> found
lookup: check "server.foo.fr" as DOMAIN in table static:<localnames> -> 0
lookup: check "local" as NETADDR in table static:<localhost> -> found
lookup: check "server.foo.fr" as DOMAIN in table static:<dynamic:0> -> 0
82908be87cc7fef7 smtp event=failed-command address=local host=debian
command="RCPT TO:<[email protected]> " result="550 Invalid recipient"

82908be87cc7fef7 smtp event=closed address=local host=debian
reason=disconnect


$ cat /etc/smtpd.conf
listen on localhost
# If you edit the file, you have to run "smtpctl update table aliases"
table aliases file:/etc/aliases
table secrets file:/etc/smtpd.secrets
accept for local \
     alias <aliases> \
     deliver to mbox
accept for domain masson-informatique.fr \
     relay via secure+auth://[email protected]:587 \
     auth <secrets> \
     as [email protected]


$ cat /etc/aliases
root: [email protected]

[email protected]:    [email protected]

Thanks Edgar for the quick reply, but unfortunately I have the same result…


$ cat /etc/hostname
127.0.0.1       localhost
127.0.1.1       server.foo.fr serveur
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

I finally found it! There was no issue with the OpenSMTPD configuration, but I had a file, /etc/mailname, which contained only the string "debian".I don't know how it came on my system. Anyway, it was sufficient to just move this file away to make it work properly.

Regards,
Yvan

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to