• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Setting up Mail Server

Lego

Well-Known Member

Thanks: 1
Messages: 404

#51
Also, I do appreciate the help, I've said this many times already. nobody said you needed to answer my post every single time, I mean don't get me wrong I really appreciate it and you've been right on with everything, But in all honesty, did it really need to be said that this is a long thread, I'm still fairly new to bsd, and setting up servers, and from what I understand mail is the hardest to get working, so I would expect a long thread, and who's to say that someone isn't reading this thread and taking from it, to help themselfs get it working? this thread covers more details then most of the articles I've read, and isn't the forum for everyone to talk and work together? Im sorry If you take offense to this post, but Im just trying to learn like the rest. Again, I do thank you for all the help and hope you will continue to help me but I felt this needed to be said as a person new to the OS and trying to get into the community and learn whatever I can about the systems. Some installation and configuration articles are so vague, the forum is the best place to learn.
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator

Thanks: 2,493
Messages: 11,097

#53
All I'm saying is that the type of actions you perform (i.e. the errors you still make) and the kind of questions you ask are covered in the documentation I pointed you to. I still think you're trying too many things at once and losing track of what causes the next error. Small steps, and read; e.g.: test mail locally before you start mailing yourself from other places, trying to interpret customised error messages from Yahoo/Hotmail, etc.
 

Lego

Well-Known Member

Thanks: 1
Messages: 404

#54
yea, I see your point. I haven't been able to send mail from root user to Lego locally. But again can send to root from Lego (locally). I have tried that. It's almost like Lego is a system user, but sendmail doesn't want to recongize the user.
Code:
blurr-ink# sendmail -bv Lego
Lego... User unknown
blurr-ink# sendmail -bv lego
lego... User unknown
 

Lego

Well-Known Member

Thanks: 1
Messages: 404

#56
yes, I have, I've tried a multitude of arrangements for Lego in the aliases file.

http://www.freebsd.org/doc/en/books/handbook/sendmail.html

In the alias section it shows:
Code:
root: localuser
ftp-bugs: joe,eric,paul
bit.bucket:  /dev/null
procmail: "|/usr/local/bin/procmail"
I've tried Lego: localuser, Lego: Lego, lego: Lego. None of which worked. I've also tried to create an alias for Lego with webmin. Oh, and It keeps removing Lego from my list of trusted Users(the webmin page 'local users trusted by sendmail' - root,daemon,uucp are the others listed), Every time I added Lego and hit save it just refreshs the page and its gone.
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator

Thanks: 2,493
Messages: 11,097

#57
But why would you want 'Lego' in your aliases at all when it is already a valid local user with a local mailbox?

Aliases is used to map non-existing local users (like 'daemon' or 'operator') to an existing local user (like 'root'). Look in /usr/src/etc/mail/aliases. Thta's what an aliases file should look like: every system account pointing to 'root', nothing else. You're already routing your email using virtusertable -- don't let aliases interfere.

The second field in the virtusertable is first checked against the aliases file, and if that field is not in there, it gets looked up in the password file (the list of local users). That should work in your case, because you have a local account Lego (and probably a mailbox in /var/mail/Lego).
 

Lego

Well-Known Member

Thanks: 1
Messages: 404

#58
I see what you mean, but I've tried it without Lego listed in the alias file. Right now All files look like this.
access only 127.0.0.1 listed as ok
aliases restored completely to original
local-hostnames:
Code:
blurr-ink.com
mx.blurr-ink.com
mailer.conf unmodified
mailertable empty
virtusertable:
Code:
root@blurr-ink.com      root
postmaster@mx.blurr-ink.com      root
lego@blurr-ink.com      Lego
Now that means that the only entry referring to Lego, is in virtusertable, So I just retarted the server and used the sendmail syntax you gave me and it says
Code:
blurr-ink# sendmail -bv Lego
Lego... User unknown
blurr-ink# sendmail -bv lego
lego... User unknown
blurr-ink# sendmail -bv lego@blurr-ink.com
lego@blurr-ink.com... User unknown
But if i change (virtusertable) lego@blurr-ink.com Lego to lego@blurr-ink.com root it delivers fine to root box, thats why I'm so confused. Everything seems to be setup properly but sendmail doesn't recongize Lego in any way other then showing the /var/mail/Lego mailbox.
 

Lego

Well-Known Member

Thanks: 1
Messages: 404

#60
sure can! lol, I must say I though you were playing with me when I first read the command.
Code:
$ su
Password:
blurr-ink# finger Lego
Login: Lego                             Name: Lego
Directory: /home/Lego                   Shell: /bin/sh
On since Mon Jun 22 19:12 (EDT) on ttyv0, idle 0:01 (messages off)
On since Mon Jun 22 19:12 (EDT) on :0 (messages off)
No Mail.
No Plan.
blurr-ink#
Does it matter that the login name and the real name are the same? or that shouldn't matter, I can change it to login Lego and real name Dan if that will help
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator

Thanks: 2,493
Messages: 11,097

#61
Your real name doesn't come into play anywhere. I don't understand why a valid account cannot serve as the right-hand side of your virtusertable.

Could you try creating an entirely new account from scratch and setting that as the right-hand side of an email address in virtusertable?

Something is obviously getting in the way between virtusertable and the mailbox, but I can't guess what that might be (well I can, but I don't assume you've installed procmail or anything like that out of the blue).
 

Lego

Well-Known Member

Thanks: 1
Messages: 404

#62
I can, and will, but I have to wait until I get home, because I'll be out of the city for a few days.
 

Lego

Well-Known Member

Thanks: 1
Messages: 404

#63
Ok, well I got back in the city then me and my fiance moved, lol. Either way, I just put the server back up yesterday, and waited for the dns to resolve, I made sure mail was sending to root again, which it is. Then created a new user Dan and put it for the right side in the virtusertable for lego@blurr-ink.com. No luck :(
 

Lego

Well-Known Member

Thanks: 1
Messages: 404

#65
Code:
$ su
Password:
blurr-ink# echo test | mail -s "Test" Dan
blurr-ink# echo test | mail -s "Test" Lego
blurr-ink# echo test | mail -s "Test" root
blurr-ink# echo test | mail -s "Test" root@blurr-ink.com
blurr-ink# echo test | mail -s "Test" lego@blurr-ink.com
blurr-ink# echo test | mail -s "Test" postmaster@mx.blurr-ink.com
blurr-ink# echo test | mail -s "Test" champagne_dan@blurr-ink.com
Code:
The original message was received at Tue, 14 Jul 2009 14:34:39 -0400 (EDT)
from localhost

   ----- The following addresses had permanent fatal errors -----
Lego
    (reason: 550 5.1.1 <Lego@blurr-ink.com>... User unknown)
    (expanded from: Lego)

   ----- Transcript of session follows -----
... while talking to [127.0.0.1]:
>>> DATA
<<< 550 5.1.1 <Lego@blurr-ink.com>... User unknown
550 5.1.1 Lego... User unknown
<<< 503 5.0.0 Need RCPT (recipient)
3 failed, Dan, Lego, lego@blurr-ink.com which was to go to Dan.
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator

Thanks: 2,493
Messages: 11,097

#66
Well, this is quite a surprise to me (after 16 years of FreeBSD mail admin-ing ...), but it did seem the only plausible explanation that was left: drop the capitals from the usernames everywhere.

I tested with a local account 'Dan' and a local account 'dan'. This was the result for 'Dan':

Code:
Diagnostic-Code: SMTP; 550 5.1.1 <Dan@box.domain.local>... User unknown
The mail to 'dan' had no problems. Of course you can use any kind of capitalization in email addresses (so Lego@yourdomain is absolutely ok), but the local username (the right-hand side of virtusertable, e.g. Lego or Dan) must be all lowercase.

In other words: accounts on your box must be all-lowercase.

Moreover: mail sent to a local user 'Dan' will end up in the mailbox of 'dan' (if user 'dan' exists), and mail to a local user 'Lego' will end up in the mailbox of 'lego' (if user 'lego' exists). They will never end up in the mailboxes of 'Dan' or 'Lego', even if these users exist.
 

Lego

Well-Known Member

Thanks: 1
Messages: 404

#67
LOL, wow, yup that fixed it. I deleted user Lego and Dan, created lego, and in virtusertable put
Code:
dan@blurr-ink.com      lego
worked perfectly. Thanks! I never would have thought that the localuser would have to be all lowercase.