1

I'm trying to forward emails sent from the host to root to address admin@test.com.

I've checked that alias file is being read:

[root@localhost etc]# sendmail -d27.2 -bv root
alias(root)
root (, root) aliased to admin@test.com
self_reference(admin@test.com)
...no self ref
admin@test.com... deliverable: mailer relay, host smtp.test.com, user admin@test.com

But the email is still beeing sent to root@localhost.test.com:

[root@localhost etc]# (echo Subject: test; echo) | sendmail -v root
root... Connecting to smtp.test.com. via relay...
220 smtp.test.com ESMTP
EHLO localhost.test.com
250-smtp.test.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
STARTTLS
220 2.0.0 Ready to start TLS
EHLO localhost.test.com
250-smtp.test.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL From:root@localhost.test.com SIZE=15
250 2.1.0 Ok
RCPT To:root@localhost.test.com
DATA
250 2.1.5 Ok
354 End data with <CR><LF>.<CR><LF>
.
250 2.0.0 Ok: queued as F381570F1
root... Sent (Ok: queued as F381570F1)
Closing connection to smtp.test.com
QUIT
221 2.0.0 Bye

May be somebody knows what can be the issue?

1

Sendmail (by sendmail.org) applies aliases after delivery to local sendmail daemon listening at 127.0.0.1:25.

Have you checked where the message is delivered in log files or the recipients' mailboxes?

  • Message is actually getting delivered to the mail relay with following addresses: From:root@localhost.test.com To:root@localhost.test.com and then it's getting bounced because relay cannot deliver it to root@localhost.test.com – Roman_T Oct 13 '15 at 18:41
  • Could you post results produced by the two command below? echo '$j'| sendmail -Ac -bt, echo '$j' | sendmail -Am -bt [the second one should be executed by root] – AnFi Oct 13 '15 at 18:48
  • [root@localhost ~]# echo '$j'| sendmail -Ac -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> localhost.test.com [root@localhost ~]# [root@localhost ~]# echo '$j' | sendmail -Am -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> localhost.test.com – Roman_T Oct 13 '15 at 19:20
  • It seems that you sendmail ignores aliases for localhost.test.com domain. The following test may provide hints why : echo '3,0 root@localhost.test.com' | sendmail -Am -bt – AnFi Oct 14 '15 at 3:57
  • canonify input: root @ localhost . test . com Canonify2 input: root < @ localhost . test . com > Canonify2 returns: root < @ localhost . test . com . > canonify returns: root < @ localhost . test . com . > parse input: root < @ localhost . test . com . > Parse0 input: root < @ localhost . test . com . > Parse0 returns: root < @ localhost . test . com . > ParseLocal input: root < @ localhost . test . com . > ParseLocal returns: root < @ localhost . test . com . > Parse1 input: root < @ localhost . test . com . > Parse1 returns: $# local $: root parse returns: $# local $: root – Roman_T Oct 14 '15 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.