26.10.2019 19:06, Sergey Seacher пишет:
26.10.2019 13:51, Reio Remma пишет:
On 26/10/2019 13:35, Sergey Seacher wrote:
Hello!

How can I make, opensmtpd accept mail for all recipients: that are present in the file /etc/opensmtpd/aliases and that are not present?
I had the rule in my /etc/opensmtpd/smtpd.conf file:

    accept \
       from any \
       for domain domain.ltd alias <aliases> \
       deliver to lmtp "/run/dovecot/lmtp" rcpt-to

I have changed this rule to:

    accept \
       from any \
       for domain domain.ltd \
       deliver to lmtp "/run/dovecot/lmtp" rcpt-to

Now, if I send to any recipient in my domain, for example [email protected], I receive error 550, but I need mail to be deliver to [email protected]

Do you mean a catch all alias? Try adding to your aliases file:

@domain.ltd [email protected]

And re-add alias <aliases> to your accept rule.

Thanks! Also I have changed table aliases to table vusers. It works.
Not working again.
The contents of the file /etc/opensmtpd/aliases:

   info                  smtpd
   @domain.ltd    [email protected]

Rule in the file /etc/opensmtpd/smtpd.conf:

   accept \
       from any \
       for domain domain.ltd alias <aliases> \
       deliver to lmtp "/run/dovecot/lmtp" rcpt-to

I sended an email to [email protected] and I got an error in log:

   ac73a7d6da66117e smtp event=connected address=209.85.208.173
   host=mail-lj1-f173.google.com
   ac73a7d6da66117e smtp event=failed-command address=209.85.208.173
   host=mail-lj1-f173.google.com command="RCPT TO:<[email protected]>"
   result="550 Invalid recipient"
   ac73a7d6da66117e smtp event=closed address=209.85.208.173
   host=mail-lj1-f173.google.com reason=quit

Then I renamed the file /etc/opensmtpd/aliases to /etc/opensmtpd/vusers and changed the rule to:

   accept \
       from any \
       for domain domain.ltd virtual <vusers> \
       deliver to lmtp "/run/dovecot/lmtp" rcpt-to

And now I get an error:

   e85fb8ffeed306b1 smtp event=connected address=209.85.167.50
   host=mail-lf1-f50.google.com
   e85fb8ffeed306b1 smtp event=message address=209.85.167.50
   host=mail-lf1-f50.google.com msgid=7d1551d1
   from=<[email protected]> to=<[email protected]> size=2904
   ndest=1 proto=ESMTP
   e85fb8ffeed306b1 smtp event=closed address=209.85.167.50
   host=mail-lf1-f50.google.com reason=quit
   0000000000000000 mda event=delivery evpid=7d1551d1e9537f74
   from=<[email protected]> to=<[email protected]>
   rcpt=<[email protected]>, user=smtpd method=lmtp delay=0s
   result=TempFail stat=Error ("RCPT TO rejected: 550 5.1.1 <smtpd>
   User doesn't exist: smtpd")

--
Sergey

Reply via email to