Discussion:
running freebsd with sendmail and qpopper
Dennis M. Yocum
2003-12-03 16:41:22 UTC
Permalink
i am having trouble understanding the requirements of the hostname in the
/etc/hosts file and the dns. i have read many things and am just confused.
can someone find time to help me a little. i would like to respond with
specifics to someone directly. thanks. den
Steve Bertrand
2003-12-03 22:00:11 UTC
Permalink
Post by Dennis M. Yocum
i am having trouble understanding the requirements of the hostname in the
/etc/hosts file and the dns. i have read many things and am just confused.
can someone find time to help me a little. i would like to respond with
specifics to someone directly. thanks. den
Let me know what you want to know, but I feel it should be kept in the
list for others to see.

Steve
Post by Dennis M. Yocum
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
--
Steve Bertrand
President/CTO,
Northumberland Network Services

t: 905.352.2688
w: www.northnetworks.ca
Marty Landman
2003-12-03 22:33:08 UTC
Permalink
Post by Steve Bertrand
Post by Dennis M. Yocum
i am having trouble understanding the requirements of the hostname in the
/etc/hosts file and the dns. i have read many things and am just confused.
can someone find time to help me a little. i would like to respond with
specifics to someone directly. thanks. den
Let me know what you want to know, but I feel it should be kept in the
list for others to see.
Like me. So there's at least two of us on the list who need this info.
Speaking personally with some prior help I can now email within the box,
i.e. id1 can email id2 who can then reply back to id1. However going the
next step, receiving email from a remote server and sending email out to
the internet is something I have no clue how to do. Don't even know how to
start, and the stab I made at following tutorials found by googling got me
nowhere at breakneck speed. Not that I'm complaining but you did ask. :)

Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
Steve Bertrand
2003-12-04 02:53:05 UTC
Permalink
Post by Marty Landman
Like me. So there's at least two of us on the list who need this info.
Speaking personally with some prior help I can now email within the box,
i.e. id1 can email id2 who can then reply back to id1. However going the
next step, receiving email from a remote server and sending email out to
the internet is something I have no clue how to do. Don't even know how to
start, and the stab I made at following tutorials found by googling got me
nowhere at breakneck speed. Not that I'm complaining but you did ask. :)
First off, email relies very heavily on the DNS infrastructure of the
Internet. DNS or Domain Name Service is what resolves a name, such as
www.freebsd.org to it's IP address. Although it is technically possible
to bypass the name for a mail server to get your messages to their
destination, it is not proper, and many mail systems will not allow it
(especially ones that use virtual domains).

ie. In some cases, you could send a mail message to ***@192.168.0.1,
and if the server is listening for incoming mail (sendmail) then it may
pick it up and deliver it to a local user.

Now, further into DNS, a computer must know how to find a mail server
within a domain. When I send a message to fbsd-***@freebsd.org,
this is what happens:

- I send a message to ***@freebsd.org from my laptop to my smtp
server (most would use one their ISP supplied, such as mail.isp.com)
- the smtp server does a reverse name lookup in DNS to find out if the
IP that sent the mail is allowed to relay mail to the remote destination
through it. Reverse lookup is the opposite of resolving names, it is the
process of resolving an IP to a name. You can try this with the #dig
command:
# dig -x your.ip.here
Likewise, you can use dig to resolve a name as well:
# dig www.freebsd.org
- next after the server verifies that you are allowed to relay, it looks
in DNS for a Mail Exchange record (MX) of the domain you are trying to
send the message to:
# dig mx freebsd.org
- once your smtp server finds the IP for the mail exchanger for the
domain, it sends the message to it
- the remote server acknowledges the incoming message, says thanks to
the sending server and shuts down the connection
- the recipient mail server looks in certain tables and/or files to
locate which user the mail actually goes to and delivers it.

For a quick and dirty setup on a FreeBSD box, here are the steps: (I
hope I don't miss any). They assume the following:

- your domain name is example.com, and will only be used for
sending/receiving mail on an internal network
- your mail server is somehow connected to the Internet, and will be
used as an smtp server for the client computers on your network (as you
probably use your ISP s servers now
- your internal network IP scheme is 192.168.0.0/24 (or 255.255.255.0)
- the IP of your mail server is 192.168.0.10
- your default gateway for your network is 192.168.0.1
- your ip of your client computer is 192.168.0.25
- your mail server name is mail.example.com
- your client computer name is client.example.com
- your mail server will back as a qpopper and DNS server for the network
- you are not overly concerned about high security, as this is just an
example to get you up and going
- you are running as the superuser

1> Set up DNS on the server
# cd /etc/namedb
# chmod 744 make-localhost
# ./make-localhost
# ee named.conf
Add the following to the bottom of the file:

zone "example.com" {
type master;
file "example.com.zone";
allow-update { none; };
};

Then, up near the top of the file, make the following changes to this
section:

# Remove the // from this line:
// forward only;

# and remove the /* and the */ from this section, and change the
127.0.0.1 to the IP address of your ISP DNS server:
/*
forwarders {
127.0.0.1;
};
*/

Now create a zone file for this zone:

# ee /etc/namedb/example.com.zone

Add the following information to this empty file:

--- start clip here ---

$TTL 360 ; Default cached time to live for all records

example.com. IN SOA ns.example.com. ***@example.com.
(
2003120401; Serial
172800 ; Refresh every 2 days
3600 ; Retry every hour
1728000 ; Expire every 20 days
172800 ); Minimum 2 days

@ IN NS ns.example.com.

; Set the Mail Exchange record

@ IN MX 10 mail.example.com.

ns IN A 192.168.0.10
mail IN A 192.168.0.10
client IN A 192.168.0.25
router IN A 192.168.0.1

--- end clip ---

Now, tell your name server to look to itself for resolution of names:

# echo "search example.com" > /etc/resolv.conf
# echo "nameserver 127.0.0.1" >> /etc/resolv.conf

Now go configure your windows or whatever client computers to use
192.168.0.10 as it's DNS server.

2> Start the nameserver and load it at startup:
# /usr/sbin/named

Now, add the following 2 lines to your /etc/rc.conf file:

named_enable="YES"
named_program="/usr/sbin/named"

3> Configure sendmail
# cd /etc/mail
# echo "example.com" > relay-domains
# echo "example.com" > local-host-names
# echo "192.168.0 RELAY" > access

4> Reload sendmail
# kill -HUP `cat /var/run/sendmail.pid`
or just reboot

5> Add some users on the mail server
# man adduser

6> Install qpopper
# cd /usr/ports/mail/qpopperpop3 stream tcp nowait root
/usr/local/libexec/qpopper qpopper -R -s -c -T 300
# make install clean

# ee /etc/inetd.conf
Add the following line under the existing pop3 line in this file. Keep
the existing one commented. (Note that if the mail line break breaks the
line, it should be on a single line when entered in the file)

pop3 stream tcp nowait root /usr/local/libexec/qpopper qpopper -R -s -c
-T 300

7> Reload inetd
# kill -HUP `cat /var/run/inetd.pid`
or just reboot

8> Try sending the user an email (whilst logged into the server console
or ssh)

# mail -s "This is a test" ***@example.com
# This is the body of the message. The last line in a command
# line mail will always be the '.' character to denote the end
# of a message
# .

9> Check to see if sendmail delivered it to the users mailbox.
# ll /var/mail | grep user

If his file has more than 0 bytes in it, then he's got mail.

10> Configure your client machine to check email
You can set up a new account in outlook or evolution, mozilla or what
have you, just configure it with the account name the same as the user
name, and the pop3 and smtp servers both as mail.example.com. This will
resolve because as described in section 1, you have already configured
this machine to look to your DNS server, who has authority to resolve
the example.com domain.

11> Check && send email
If you receive email for this user into the account, then thank god -- I
didn't overlook anything, and you didn't miss any small things in this
howto.

Now, using your main (real, outside) email account, send a message back
to this list to tell us that things are working.(Don't forget to change
the smtp server to the new box first)

YOU WILL NOT be able to send email to the outside world from the new
test account, as when it gets to us, we will respond to someone who
honestly owns the domain, which won't be you.

Please advise on any errors or omissions. All of this was done from
memory (well, almost all).

Cheers,

Steve
Post by Marty Landman
Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
--
Steve Bertrand
President/CTO,
Northumberland Network Services

t: 905.352.2688
w: www.northnetworks.ca
Steve Bertrand
2003-12-04 04:29:59 UTC
Permalink
I noticed some errors here:

In section 4, the RELAY should say OK.
In section 6, the first line should read:
/usr/ports/mail/qpopper
delete the trailing garbage.

EOF
Post by Steve Bertrand
Post by Marty Landman
Like me. So there's at least two of us on the list who need this info.
Speaking personally with some prior help I can now email within the box,
i.e. id1 can email id2 who can then reply back to id1. However going the
next step, receiving email from a remote server and sending email out to
the internet is something I have no clue how to do. Don't even know how to
start, and the stab I made at following tutorials found by googling got me
nowhere at breakneck speed. Not that I'm complaining but you did ask. :)
First off, email relies very heavily on the DNS infrastructure of the
Internet. DNS or Domain Name Service is what resolves a name, such as
www.freebsd.org to it's IP address. Although it is technically possible
to bypass the name for a mail server to get your messages to their
destination, it is not proper, and many mail systems will not allow it
(especially ones that use virtual domains).
and if the server is listening for incoming mail (sendmail) then it may
pick it up and deliver it to a local user.
Now, further into DNS, a computer must know how to find a mail server
server (most would use one their ISP supplied, such as mail.isp.com)
- the smtp server does a reverse name lookup in DNS to find out if the
IP that sent the mail is allowed to relay mail to the remote destination
through it. Reverse lookup is the opposite of resolving names, it is the
process of resolving an IP to a name. You can try this with the #dig
# dig -x your.ip.here
# dig www.freebsd.org
- next after the server verifies that you are allowed to relay, it looks
in DNS for a Mail Exchange record (MX) of the domain you are trying to
# dig mx freebsd.org
- once your smtp server finds the IP for the mail exchanger for the
domain, it sends the message to it
- the remote server acknowledges the incoming message, says thanks to
the sending server and shuts down the connection
- the recipient mail server looks in certain tables and/or files to
locate which user the mail actually goes to and delivers it.
For a quick and dirty setup on a FreeBSD box, here are the steps: (I
- your domain name is example.com, and will only be used for
sending/receiving mail on an internal network
- your mail server is somehow connected to the Internet, and will be
used as an smtp server for the client computers on your network (as you
probably use your ISP s servers now
- your internal network IP scheme is 192.168.0.0/24 (or 255.255.255.0)
- the IP of your mail server is 192.168.0.10
- your default gateway for your network is 192.168.0.1
- your ip of your client computer is 192.168.0.25
- your mail server name is mail.example.com
- your client computer name is client.example.com
- your mail server will back as a qpopper and DNS server for the network
- you are not overly concerned about high security, as this is just an
example to get you up and going
- you are running as the superuser
1> Set up DNS on the server
# cd /etc/namedb
# chmod 744 make-localhost
# ./make-localhost
# ee named.conf
zone "example.com" {
type master;
file "example.com.zone";
allow-update { none; };
};
Then, up near the top of the file, make the following changes to this
// forward only;
# and remove the /* and the */ from this section, and change the
/*
forwarders {
127.0.0.1;
};
*/
# ee /etc/namedb/example.com.zone
--- start clip here ---
$TTL 360 ; Default cached time to live for all records
(
2003120401; Serial
172800 ; Refresh every 2 days
3600 ; Retry every hour
1728000 ; Expire every 20 days
172800 ); Minimum 2 days
@ IN NS ns.example.com.
; Set the Mail Exchange record
@ IN MX 10 mail.example.com.
ns IN A 192.168.0.10
mail IN A 192.168.0.10
client IN A 192.168.0.25
router IN A 192.168.0.1
--- end clip ---
# echo "search example.com" > /etc/resolv.conf
# echo "nameserver 127.0.0.1" >> /etc/resolv.conf
Now go configure your windows or whatever client computers to use
192.168.0.10 as it's DNS server.
# /usr/sbin/named
named_enable="YES"
named_program="/usr/sbin/named"
3> Configure sendmail
# cd /etc/mail
# echo "example.com" > relay-domains
# echo "example.com" > local-host-names
# echo "192.168.0 RELAY" > access
4> Reload sendmail
# kill -HUP `cat /var/run/sendmail.pid`
or just reboot
5> Add some users on the mail server
# man adduser
6> Install qpopper
# cd /usr/ports/mail/qpopperpop3 stream tcp nowait root
/usr/local/libexec/qpopper qpopper -R -s -c -T 300
# make install clean
# ee /etc/inetd.conf
Add the following line under the existing pop3 line in this file. Keep
the existing one commented. (Note that if the mail line break breaks the
line, it should be on a single line when entered in the file)
pop3 stream tcp nowait root /usr/local/libexec/qpopper qpopper -R -s -c
-T 300
7> Reload inetd
# kill -HUP `cat /var/run/inetd.pid`
or just reboot
8> Try sending the user an email (whilst logged into the server console
or ssh)
# This is the body of the message. The last line in a command
# line mail will always be the '.' character to denote the end
# of a message
# .
9> Check to see if sendmail delivered it to the users mailbox.
# ll /var/mail | grep user
If his file has more than 0 bytes in it, then he's got mail.
10> Configure your client machine to check email
You can set up a new account in outlook or evolution, mozilla or what
have you, just configure it with the account name the same as the user
name, and the pop3 and smtp servers both as mail.example.com. This will
resolve because as described in section 1, you have already configured
this machine to look to your DNS server, who has authority to resolve
the example.com domain.
11> Check && send email
If you receive email for this user into the account, then thank god -- I
didn't overlook anything, and you didn't miss any small things in this
howto.
Now, using your main (real, outside) email account, send a message back
to this list to tell us that things are working.(Don't forget to change
the smtp server to the new box first)
YOU WILL NOT be able to send email to the outside world from the new
test account, as when it gets to us, we will respond to someone who
honestly owns the domain, which won't be you.
Please advise on any errors or omissions. All of this was done from
memory (well, almost all).
Cheers,
Steve
Post by Marty Landman
Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
--
Steve Bertrand
President/CTO,
Northumberland Network Services

t: 905.352.2688
w: www.northnetworks.ca
Marty Landman
2003-12-08 00:07:59 UTC
Permalink
I've given this another try and got much further albeit w/o visible
success. Here are my notes interleaved in your instructions.
Post by Steve Bertrand
- your domain name is example.com
Newbie that I am not certain that my understanding of this is correct. My
/etc/rc.conf file has

hostname="SwamiSalami.face2interface.domain"

so this is my fqdn, right? And my domain name is face2interface.domain?
That's the way I set up things.
Post by Steve Bertrand
- the IP of your mail server is 192.168.0.10
The ip adr of my fbsd box, i.e. the one being configured to act as the mail
server for my lan is 192.168.0.7.
Post by Steve Bertrand
- your default gateway for your network is 192.168.0.1
Yes, I think. That's the ip adr for my workstation, the box that has the
dial up connection w/ windows ics enabled.
Post by Steve Bertrand
- your ip of your client computer is 192.168.0.25
I'm going to use my workstation as the client computer, i.e. to do testing.
Post by Steve Bertrand
- your mail server name is mail.example.com
If my other assumptions are right then this is mail.face2interface.domain -
but maybe there is something more to this and I'm ignorant???
Post by Steve Bertrand
- your client computer name is client.example.com
delliver.mshome.net
Post by Steve Bertrand
- your mail server will back as a qpopper and DNS server for the network
Meaning my lan, the local network right?
Post by Steve Bertrand
10> Configure your client machine to check email
[snip]
11> Check && send email
Steve, I get a "Diagnostic-Code: SMTP; 550 Host unknown" when trying to
send an email from the server to the client, i.e. from
SwamiSalami.face2interface.domain to ***@delliver.mshome.net and an error
on delliver 'Resolving address for "mail.face2interface.domain"' when
trying to send an email from the client to the server (It goes through the
server either way so the server is a client in this test, right?). Although
I can ping both boxes from delliver (the client) I can't ping swamisalami
from itself, can ping delliver from swamisalami.

On the bright side, everything that worked before still works afaik. So how
do I start debugging from here?

BTW, the only issue I had with the instructions were where one of the kill
-HUP `cat....` cmds didn't work as is because the cat pid output wasn't
right w/o somehow parsing first.
Post by Steve Bertrand
If you receive email for this user into the account, then thank god
And here I'd thought that email was technology rather than religion.


Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
Ruben de Groot
2003-12-08 09:10:11 UTC
Permalink
Post by Marty Landman
I've given this another try and got much further albeit w/o visible
success. Here are my notes interleaved in your instructions.
Post by Steve Bertrand
- your domain name is example.com
Newbie that I am not certain that my understanding of this is correct. My
/etc/rc.conf file has
hostname="SwamiSalami.face2interface.domain"
so this is my fqdn, right? And my domain name is face2interface.domain?
That's the way I set up things.
And there's your problem. "face2interface.domain" does not resolve in DNS,
so most if not all other mail servers on the internet will refuse to
accept email from it. You can either set your hostname to something that
does resolve, or configure sendmail to masquerade as something that
resolves.
You can read more about configuring sendmail in the file
/usr/share/sendmail/cf/README

Ruben
Post by Marty Landman
Post by Steve Bertrand
- the IP of your mail server is 192.168.0.10
The ip adr of my fbsd box, i.e. the one being configured to act as the mail
server for my lan is 192.168.0.7.
Post by Steve Bertrand
- your default gateway for your network is 192.168.0.1
Yes, I think. That's the ip adr for my workstation, the box that has the
dial up connection w/ windows ics enabled.
Post by Steve Bertrand
- your ip of your client computer is 192.168.0.25
I'm going to use my workstation as the client computer, i.e. to do testing.
Post by Steve Bertrand
- your mail server name is mail.example.com
If my other assumptions are right then this is mail.face2interface.domain -
but maybe there is something more to this and I'm ignorant???
Post by Steve Bertrand
- your client computer name is client.example.com
delliver.mshome.net
Post by Steve Bertrand
- your mail server will back as a qpopper and DNS server for the network
Meaning my lan, the local network right?
Post by Steve Bertrand
10> Configure your client machine to check email
[snip]
11> Check && send email
Steve, I get a "Diagnostic-Code: SMTP; 550 Host unknown" when trying to
send an email from the server to the client, i.e. from
on delliver 'Resolving address for "mail.face2interface.domain"' when
trying to send an email from the client to the server (It goes through the
server either way so the server is a client in this test, right?). Although
I can ping both boxes from delliver (the client) I can't ping swamisalami
from itself, can ping delliver from swamisalami.
On the bright side, everything that worked before still works afaik. So how
do I start debugging from here?
BTW, the only issue I had with the instructions were where one of the kill
-HUP `cat....` cmds didn't work as is because the cat pid output wasn't
right w/o somehow parsing first.
Post by Steve Bertrand
If you receive email for this user into the account, then thank god
And here I'd thought that email was technology rather than religion.
Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
Marty Landman
2003-12-08 19:30:34 UTC
Permalink
Post by Marty Landman
Post by Steve Bertrand
- your client computer name is client.example.com
delliver.mshome.net
Change it to delliver.face2interface.domain, and add this entry into your
DNS zone file.
AFAIK this can't be done though I don't claim to be a windows os expert. I
get to name the computer delliver and windows seems to stick in the
mshome.net part. Also if I can change it this will make the other 3 windows
boxes on the lan invisible to this client perhaps? So I might be better of
changing my hostname for the server from swamisalami.face2interface.domain
to swamisalami.mshome.net.

Can you please explain why this is even necessary? Also, assuming I do make
this change, where and how on the zone file is the required change?


Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
Steve Bertrand
2003-12-08 19:35:55 UTC
Permalink
Post by Marty Landman
Post by Marty Landman
Post by Steve Bertrand
- your client computer name is client.example.com
delliver.mshome.net
Change it to delliver.face2interface.domain, and add this entry into your
DNS zone file.
AFAIK this can't be done though I don't claim to be a windows os expert. I
get to name the computer delliver and windows seems to stick in the
mshome.net part. Also if I can change it this will make the other 3 windows
boxes on the lan invisible to this client perhaps? So I might be better of
changing my hostname for the server from swamisalami.face2interface.domain
to swamisalami.mshome.net.
Can you please explain why this is even necessary? Also, assuming I do make
this change, where and how on the zone file is the required change?
Your client computer name does not need to be changed. As long as you
have a zone file for your domain (face2interface.domain) and an mx
record within that zone, then you can send mail to
***@face2interface.domain (given that you have set up your sendmail
files correctly)

The name on the actual workstation is irrelevant as the mail server does
not care what domain or workgroup your windows computer belongs to. It
is only DNS and the mail server daemons that must know about each other
as mail coming in will be kept or discarded based on the destination
username and domain name it is sent to.

Steve
Post by Marty Landman
Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
--
Steve Bertrand
President/CTO,
Northumberland Network Services

t: 905.352.2688
w: www.northnetworks.ca
Marty Landman
2003-12-08 20:30:54 UTC
Permalink
Post by Steve Bertrand
Your client computer name does not need to be changed. As long as you
have a zone file for your domain (face2interface.domain) and an mx
record within that zone, then you can send mail to
files correctly)
Eudora on the windows client complains that it can't resolve
mail.face2interface.domain, and the results on the freebsd box are similar

Swami: ping mail.face2interface.domain
ping: cannot resolve mail.face2interface.domain: Unknown host

AFAIK I've set up everything as you said... should I post all the files to
the list?

Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
Steve Bertrand
2003-12-08 20:39:46 UTC
Permalink
Post by Marty Landman
Eudora on the windows client complains that it can't resolve
mail.face2interface.domain, and the results on the freebsd box are similar
Swami: ping mail.face2interface.domain
ping: cannot resolve mail.face2interface.domain: Unknown host
AFAIK I've set up everything as you said... should I post all the files to
the list?
Sure. One at a time though. Start with your zone file.

Steve
Post by Marty Landman
Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
--
Steve Bertrand
President/CTO,
Northumberland Network Services

t: 905.352.2688
w: www.northnetworks.ca
Marty Landman
2003-12-08 20:54:11 UTC
Permalink
Post by Steve Bertrand
Sure. One at a time though. Start with your zone file.
Ok, btw email within the fbsd email server has been unaffected so far, i.e.
it worked before and works now.

I notice that while I can ping swamisalami from both the server and client
boxes I can't ping swamisalami.face2interface.domain from either box.
swamisalami.face2interface.domain is my rc.conf specified hostname, but
since I don't actually understand most of what I'm doing here it's hardly a
stretch of the imagination to speculate that I've coded something
inconsistent elsewhere. Also I've setup the server ip 192.168.0.7 as the
dns server for the client box; on both the nic and modem properties.

FreeB cat /etc/namedb/face2interface.domain.zone
$TTL 360 ; Default cached time to live for all records


face2interface.domain. IN SOA ns.face2interface.domain.
***@face2interface.domain.
(
2003120401; Serial
172800 ; Refresh every 2 days
3600 ; Retry every hour
1728000 ; Expire every 20 days
172800 ); Minimum 2 days


@ IN NS ns.face2interface.domain.


; Set the Mail Exchange record


@ IN MX 10 mail.face2interface.domain.


ns IN A 192.168.0.7
mail IN A 192.168.0.7
client IN A 192.168.0.1
router IN A 192.168.0.1


Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
Steve Bertrand
2003-12-08 21:07:02 UTC
Permalink
Post by Marty Landman
Post by Steve Bertrand
Sure. One at a time though. Start with your zone file.
Ok, btw email within the fbsd email server has been unaffected so far, i.e.
it worked before and works now.
I notice that while I can ping swamisalami from both the server and client
boxes I can't ping swamisalami.face2interface.domain from either box.
swamisalami.face2interface.domain is my rc.conf specified hostname, but
since I don't actually understand most of what I'm doing here it's hardly a
stretch of the imagination to speculate that I've coded something
inconsistent elsewhere. Also I've setup the server ip 192.168.0.7 as the
dns server for the client box; on both the nic and modem properties.
FreeB cat /etc/namedb/face2interface.domain.zone
$TTL 360 ; Default cached time to live for all records
face2interface.domain. IN SOA ns.face2interface.domain.
(
2003120401; Serial
172800 ; Refresh every 2 days
3600 ; Retry every hour
1728000 ; Expire every 20 days
172800 ); Minimum 2 days
@ IN NS ns.face2interface.domain.
; Set the Mail Exchange record
@ IN MX 10 mail.face2interface.domain.
ns IN A 192.168.0.7
mail IN A 192.168.0.7
client IN A 192.168.0.1
router IN A 192.168.0.1
Is the A records above correct? ie: is the DNS/mail server actually
192.168.0.7, or something else?

If they are different than 0.7, change them accordingly, change the
;serial number above to 2003120801 and reload the name server:

# ndc restart && tail -10 /var/log/messages | grep named

and make sure the name server is 'ready to answer queries'.

If that fails, check to see if /etc/resolv.conf has it's primary
nameserver statement like this:

nameserver 127.0.0.1

and make sure your client computer is looking to your DNS servers IP for
DNS.

If all fails, next send the named.conf file.

Steve
Post by Marty Landman
Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
--
Steve Bertrand
President/CTO,
Northumberland Network Services

t: 905.352.2688
w: www.northnetworks.ca
Marty Landman
2003-12-08 21:35:24 UTC
Permalink
Post by Steve Bertrand
Post by Marty Landman
ns IN A 192.168.0.7
mail IN A 192.168.0.7
client IN A 192.168.0.1
router IN A 192.168.0.1
Is the A records above correct? ie: is the DNS/mail server actually
192.168.0.7, or something else?
I'm working with two computers on my lan. 192.168.0.1 runs xp, has dialup
for the lan and is acting as my client (for testing) and router, I think,
since it share dialup access via windows ics.
Post by Steve Bertrand
# ndc restart && tail -10 /var/log/messages | grep named
and make sure the name server is 'ready to answer queries'.
Did it anyway to check for the msg:

FreeB ndc restart && tail -10 /var/log/messages | grep named
new pid is 336
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone: WARNING
SOA expire value is less than SOA refresh+retry (2 < 2+600)
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone: WARNING
SOA expire value is less than refresh + 10 * retry (2 < (2 + 10 * 600))
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone: WARNING
SOA expire value is less than 7 days (2)
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone: WARNING
SOA refresh value is less than 2 * retry (2 < 600 * 2)
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone:7:
Database error near ()
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone:8:
Database error near ()
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone:9:
Database error near ()
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone:10:
Database error near ())
Dec 8 16:29:56 SwamiSalami named[327]: master zone "face2interface.domain"
(IN) rejected due to errors (serial 0)
Dec 8 16:29:56 SwamiSalami named[336]: Ready to answer queries.
FreeB

What did I do wrong in the zone file? It appears even though dns is enabled
"ready to answer queries" my master zone, the whole point to this was done
improperly. Where is the zone file instructions, assuming there is such a
thing?


Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
Steve Bertrand
2003-12-08 21:41:44 UTC
Permalink
Post by Marty Landman
Post by Steve Bertrand
Post by Marty Landman
ns IN A 192.168.0.7
mail IN A 192.168.0.7
client IN A 192.168.0.1
router IN A 192.168.0.1
Is the A records above correct? ie: is the DNS/mail server actually
192.168.0.7, or something else?
I'm working with two computers on my lan. 192.168.0.1 runs xp, has dialup
for the lan and is acting as my client (for testing) and router, I think,
since it share dialup access via windows ics.
Post by Steve Bertrand
# ndc restart && tail -10 /var/log/messages | grep named
and make sure the name server is 'ready to answer queries'.
Send back the first few lines in the zone file. Appears as there is a
syntax error.

Steve
Post by Marty Landman
FreeB ndc restart && tail -10 /var/log/messages | grep named
new pid is 336
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone: WARNING
SOA expire value is less than SOA refresh+retry (2 < 2+600)
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone: WARNING
SOA expire value is less than refresh + 10 * retry (2 < (2 + 10 * 600))
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone: WARNING
SOA expire value is less than 7 days (2)
Dec 8 16:29:56 SwamiSalami named[327]: face2interface.domain.zone: WARNING
SOA refresh value is less than 2 * retry (2 < 600 * 2)
Database error near ()
Database error near ()
Database error near ()
Database error near ())
Dec 8 16:29:56 SwamiSalami named[327]: master zone "face2interface.domain"
(IN) rejected due to errors (serial 0)
Dec 8 16:29:56 SwamiSalami named[336]: Ready to answer queries.
FreeB
What did I do wrong in the zone file? It appears even though dns is enabled
"ready to answer queries" my master zone, the whole point to this was done
improperly. Where is the zone file instructions, assuming there is such a
thing?
Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
--
Steve Bertrand
President/CTO,
Northumberland Network Services

t: 905.352.2688
w: www.northnetworks.ca
Marty Landman
2003-12-08 22:45:21 UTC
Permalink
Post by Steve Bertrand
Send back the first few lines in the zone file. Appears as there is a
syntax error.
FreeB more /etc/namedb/face2interface.domain.zone
$TTL 360 ; Default cached time to live for all records


face2interface.domain. IN SOA ns.face2interface.domain.
***@face2interface.domain.
(
2003120801; Serial
172800 ; Refresh every 2 days
3600 ; Retry every hour
1728000 ; Expire every 20 days
172800 ); Minimum 2 days


@ IN NS ns.face2interface.domain.


; Set the Mail Exchange record

[etc]
Post by Steve Bertrand
Post by Marty Landman
FreeB ndc restart && tail -10 /var/log/messages | grep named
new pid is 336
WARNING
Post by Marty Landman
SOA expire value is less than SOA refresh+retry (2 < 2+600)
WARNING
Post by Marty Landman
SOA expire value is less than refresh + 10 * retry (2 < (2 + 10 * 600))
WARNING
Post by Marty Landman
SOA expire value is less than 7 days (2)
WARNING
Post by Marty Landman
SOA refresh value is less than 2 * retry (2 < 600 * 2)
Database error near ()
Database error near ()
Database error near ()
Database error near ())
Dec 8 16:29:56 SwamiSalami named[327]: master zone
"face2interface.domain"
Post by Marty Landman
(IN) rejected due to errors (serial 0)
Dec 8 16:29:56 SwamiSalami named[336]: Ready to answer queries.
FreeB
Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml

Marty Landman
2003-12-04 21:09:57 UTC
Permalink
First, Steve it's great of you to go to all this effort. Thanks in advance.
Now I wonder if you'll be surprised at how early in the procedure things
fell apart for me. :)
Post by Steve Bertrand
and if the server is listening for incoming mail (sendmail) then it may
pick it up and deliver it to a local user.
My lan is set up as follows. My workstation 192.168.0.1 runs windows xp and
shares its dialup connection through ics. In its host file it maps my fbsd
box 192.168.0.7 to the server name swamisalami. This allows me to ftp, ssh,
and also browse to http://swamisalami from my workstation and afaik any
other box on the lan.

I use eudora as my email client on the workstation and set up a personality
for ***@SwamiSalami. I was able to successfully send the following

From ***@SwamiSalami.face2interface.domain Thu Dec 4 15:12:30 2003
X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22
Date: Thu, 04 Dec 2003 15:13:12 -0500
To: ***@SwamiSalami.face2interface.domain,
***@SwamiSalami.face2interface.domain
From: Marty Landman <***@SwamiSalami.face2interface.domain>
Subject: testing
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed

This is a test. If this were an actual email...

Ohhhhhhhhh.
However, I don't know how to receive email from outside my lan on the fbsd
box, nor how to send mail from the fbsd box to other locations.

Besides that I just managed to delete a user's mailbox and don't know how
to recreate it. But that just seems to be an omen of how much trouble this
is going to take overall. Just part of the learning hyperbola, uh curve --
yeah.

*update* - I received one of the test email msgs; apparently mail (or
sendmail) created the /var/mail/marty file on the fly, then removed it
again once I deleted the msg. btw, what is the cockamamie mbox thingie
about and how do I manage it? uh, sorry about the value judgement implied
in that stmt.
Thx, this seems a bit more informative in a way than #whois.
Post by Steve Bertrand
- the IP of your mail server is 192.168.0.10
How do I find out what sendmail's ip adr is? What about the mail server
that Eudora uses on the winxp box, does that enter into this if I want to
be able to send/receive email on the internet from the fbsd box?
Post by Steve Bertrand
- your default gateway for your network is 192.168.0.1
AFAIK that's right since this is the winxp/dialup shared box's ip.
Post by Steve Bertrand
- your mail server name is mail.example.com
Now I'm lost. Do you mean the name of my ISP's email server?
Post by Steve Bertrand
1> Set up DNS on the server
# cd /etc/namedb
# chmod 744 make-localhost
# ./make-localhost
Question here since I'm so new. Looks like make-localhost's an exec that
I've just executed. But when I created /tmp/scratch

FreeB ./tmp/scratch
./tmp/scratch: Command not found.
FreeB more /tmp/scratch
#!/bin/sh
echo Hello World
Post by Steve Bertrand
# ee named.conf
zone "example.com" {
type master;
file "example.com.zone";
allow-update { none; };
};
Stopped here since I'm unclear about how to sub for "example.com" but am
leaving the rest of your instructions intact for followup.

Marty
Post by Steve Bertrand
Then, up near the top of the file, make the following changes to this
// forward only;
# and remove the /* and the */ from this section, and change the
/*
forwarders {
127.0.0.1;
};
*/
# ee /etc/namedb/example.com.zone
--- start clip here ---
$TTL 360 ; Default cached time to live for all records
(
2003120401; Serial
172800 ; Refresh every 2 days
3600 ; Retry every hour
1728000 ; Expire every 20 days
172800 ); Minimum 2 days
@ IN NS ns.example.com.
; Set the Mail Exchange record
@ IN MX 10 mail.example.com.
ns IN A 192.168.0.10
mail IN A 192.168.0.10
client IN A 192.168.0.25
router IN A 192.168.0.1
--- end clip ---
# echo "search example.com" > /etc/resolv.conf
# echo "nameserver 127.0.0.1" >> /etc/resolv.conf
Now go configure your windows or whatever client computers to use
192.168.0.10 as it's DNS server.
# /usr/sbin/named
named_enable="YES"
named_program="/usr/sbin/named"
3> Configure sendmail
# cd /etc/mail
# echo "example.com" > relay-domains
# echo "example.com" > local-host-names
# echo "192.168.0 RELAY" > access
4> Reload sendmail
# kill -HUP `cat /var/run/sendmail.pid`
or just reboot
5> Add some users on the mail server
# man adduser
6> Install qpopper
# cd /usr/ports/mail/qpopperpop3 stream tcp nowait root
/usr/local/libexec/qpopper qpopper -R -s -c -T 300
# make install clean
# ee /etc/inetd.conf
Add the following line under the existing pop3 line in this file. Keep
the existing one commented. (Note that if the mail line break breaks the
line, it should be on a single line when entered in the file)
pop3 stream tcp nowait root /usr/local/libexec/qpopper qpopper -R -s -c
-T 300
7> Reload inetd
# kill -HUP `cat /var/run/inetd.pid`
or just reboot
8> Try sending the user an email (whilst logged into the server console
or ssh)
# This is the body of the message. The last line in a command
# line mail will always be the '.' character to denote the end
# of a message
# .
9> Check to see if sendmail delivered it to the users mailbox.
# ll /var/mail | grep user
If his file has more than 0 bytes in it, then he's got mail.
10> Configure your client machine to check email
You can set up a new account in outlook or evolution, mozilla or what
have you, just configure it with the account name the same as the user
name, and the pop3 and smtp servers both as mail.example.com. This will
resolve because as described in section 1, you have already configured
this machine to look to your DNS server, who has authority to resolve
the example.com domain.
11> Check && send email
If you receive email for this user into the account, then thank god -- I
didn't overlook anything, and you didn't miss any small things in this
howto.
Now, using your main (real, outside) email account, send a message back
to this list to tell us that things are working.(Don't forget to change
the smtp server to the new box first)
YOU WILL NOT be able to send email to the outside world from the new
test account, as when it gets to us, we will respond to someone who
honestly owns the domain, which won't be you.
Please advise on any errors or omissions. All of this was done from
memory (well, almost all).
Cheers,
Steve
Post by Marty Landman
Marty Landman Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
--
Steve Bertrand
President/CTO,
Northumberland Network Services
t: 905.352.2688
w: www.northnetworks.ca
Loading...