Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendmail relays incoming instead of putting it into user mailbox

Status
Not open for further replies.

motiv8d

Technical User
May 19, 2003
3
AU
I have a Redhat 6.2 server with ADSL, fetchmail and sendmail. I also have a domain name, which directs (catchall) any email to my bigpond email from which I download it to the server with fetchmail. eg: someone sends email to joebloggs@mydomain.net.au; it will be relayed to my bigpond email account myemail@bigpond.net.au; Fetchmail will then fetch it for sendmail.
The problem occurs in that fetchmail retrieves it, it goes to sendmail, however, does not go to a user mailbox on my system, rather sendmail will try to relay it back to myemail@bigpond.net.au - Then there is a never ending loop of relays from my sendmail server to myemail@bigpond.net.au and back!
My internal domain is set at the domain name eg: mydomain.net.au (real name is used, this is just to illustrate). If I send an email internally to say joebloggs@mydomain.net.au it arrives internally no probs.
If I look at the header of a mail item on the bigpond email it will have
From: sender@sendersdomain.com
For: myemail@bigpond.net.au
To: joebloggs@mydomain.net.au
It seems that fetchmail/sendmail/procmail or whatever is ignoring the To: and just relaying to the For: address.
I cannot find a .forward or a .promailrc file either. Dont know if they should be there or not.
If anyone can tell me what is need to get the server to accept the To: address and not relay it to the For it would be greatly appreciated. Thanks in advance.
 
The problem may be that sendmail by default applies address mapping read from /etc/mail/aliases.db or ~/.forward only to messages that are passed to local mailer. Sendmail thinks that mail for user@bigpond.net.au must be send to bigpond.net.au and passes that message to smtp mailer, which does not perform aliases & .forward lookup. This behaviour is controlled by "A" flag in mailer definition - if you look at sendmail.cf, you can see, that Mlocal statement has "A" among flags (set by F=...), while M*smtp* don't. Add "A" there, add string

myemail@bigpond.net.au: <my_login_name>@localhost

compile the DB by

# newaliases

and restart sendmail.
Notes:
The loop is not &quot;never-ending&quot; since max hop-count exists (which is usually = 16)
If your sendmail can talk directly to MTA at bigpond.net.au, it may be that none of them looks at &quot;To:&quot; field: the remote MTA makes decision based on &quot;RCPT TO:&quot; SMTP command, not the recipient address specified in the header.
.forward usually lives in the recipient's home directory, if it is not found there - just create it! Also you can look at &quot;O ForwardPath=&quot; statement in your sendmail.cf, see /usr/share/doc/sendmail/op.me about the meaning of all those $z and $w...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top