On Wed, Nov 01, 2017 at 10:31:19PM +0100, Matthias Teege wrote: > On Wed, Nov 01, 2017 at 08:43:01PM +0100, Thomas Bohl wrote: > > Hello! > > > > If I send a message from local the FQDN is added so the mail is send > > > to [email protected]. Is it possible to ignore the "host." part or > > > rewrite the address to [email protected]? > > > > # echo example.com > /etc/mail/mailname > > I've tried it but it does not solve the problem: > > $ mail -v user > <<< 220 host.example.com ESMTP OpenSMTPD > >>> EHLO localhost > <<< 250-host.example.com Hello localhost [local], pleased to meet you > <<< 250-8BITMIME > <<< 250-ENHANCEDSTATUSCODES > <<< 250-SIZE 36700160 > <<< 250 HELP > >>> MAIL FROM:<[email protected]> > <<< 250 2.0.0: Ok > >>> RCPT TO:<[email protected]> > <<< 250 2.1.5 Destination address valid: Recipient ok > >>> DATA > <<< 354 Enter mail, end with "." on a line by itself > >>> . > <<< 250 2.0.0: 1dbf7b05 Message accepted for delivery > >>> QUIT > <<< 221 2.0.0: Bye > > Nov 1 22:08:35 host smtpd[31333]: 0000000000000000 mda event=delivery > evpid=1dbf7b05c357c219 from=<[email protected]> > to=<[email protected]> user=user method=lmtp delay=1m30s result=TempFail > stat=Error ("smtpd: RCPT TO rejected: 550 5.1.1 <[email protected]> User > doesn't exist: [email protected]") > > OpenSMTP accepts the mail. The error message comes from dovecot because > dovecot only knows [email protected]. > > The server is the MX for example.com and host.example.com. Mails for > [email protected] should go to user [email protected]. Is it possible > to setup a mapping from host.example.com to example.com? > > Thanks! > Matthias >
I think you will get the desired results with aliases. # cat /etc/mail/aliases user: [email protected] > > -- > You received this mail because you are subscribed to [email protected] > To unsubscribe, send a mail to: [email protected] > -- You received this mail because you are subscribed to [email protected] To unsubscribe, send a mail to: [email protected]
