bdf0 Sendmail recieve problems - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Web & Network Services

Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old July 29th, 2012, 04:41
danaeckel danaeckel is offline
Junior Member
 
Join Date: Feb 2012
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sendmail recieve problems

Hello all,
I have a FreeBSD 9.0 configured as a multi-use server. I decided for fun and learning I would try to use the sendmail services that is offered, then when I get that going good I would add Dovecot and webmail services.
I can send with sendmail quite well to services such as Yahoo and Gmail, and was easy to setup. However I am confused on how to configure it to recieve e-mail.
This system is setup as a gate DNSMasq as well as IPFW running and two network cards. One card faces my local ISP, and the other faces my home network. I also have a subdomain from FreeDNS as well
I have tried to e-mail direct to my public IP address as well as my FreeDNS name, and I get nothing.
I have read about MX Records and all that, and that is when I get lost. I can't find a good example how to set it up with my type of setup, and I have no clue how to go about MX Records.

Could somebody toss some hints my way?

Thanks!
Dana
Reply With Quote
  #2  
Old July 29th, 2012, 04:47
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

Look at /var/log/maillog. Does it show the mail going out? Coming in?
Reply With Quote
  #3  
Old July 29th, 2012, 06:37
danaeckel danaeckel is offline
Junior Member
 
Join Date: Feb 2012
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It shows main going out, but nothing coming in. I tried both direct IP and subdomain.

Dana
Reply With Quote
  #4  
Old July 30th, 2012, 16:15
usdmatt usdmatt is offline
Member
 
Join Date: Mar 2009
Posts: 252
Thanks: 1
Thanked 67 Times in 56 Posts
Default

1) Setup your server to handle email for your domain

Add yourdomain.com to /etc/mail/local-host-names and the email address you want to /etc/mail/virtusertable

/etc/mail/local-host-names
Code:
yourdomain.com
/etc/mail/virtusertable
Code:
@yourdomain.com     error:550 User unknown
me@yourdomain.com   mylocaluser
I've shown with the catch-all set to reject with error 550 as this is what I would recommend. You can point this at your user if you wish.
Rebuild the config files -

Code:
# cd /etc/mail
# make install restart
Make sure sendmail is enabled in your /etc/rc.conf and running.
The below command is extremely useful when you are working with sendmail and will confirm it is set up correctly locally. It should say the email address is deliverable to a local user and specify the user you added in the config above.

Code:
# sendmail -bv me@yourdomain.com
me@yourdomain.com... deliverable: mailer local, user mylocaluser
2) Allow email into your server

Make sure port 25 is allowed through your firewall (if you are running one) and if you have a NAT router you should also forward port 25 to your server.

Go to www.mxtoolbox.com and put your public IP address into their diagnostics tab to make sure the server is accessible on the Internet. You may get a few warnings about the reverse DNS (which you should get fixed eventually) but just make sure it connects for now. If you get an open relay warning (which you shouldn't with a default Sendmail config) turn Sendmail off immediately and fix that first.

This will confirm that the Internet can connect to your SMTP server.

3) Point email for yourdomain.com at your server

In BIND speak, you should have the following DNS configured on your domain, where 1.2.3.4 is your public IP:

Code:
yourdomain.com      IN MX  5 mail.yourdomain.com.
mail.yourdomain.com IN  A  1.2.3.4
Any third party sending email to *@yourdomain.com should look up the MX record for your domain, which lists mail.yourdomain.com as the mail server. They will connect to mail.yourdomain.com which should point to your server. (It doesn't have to be mail. - you could call it my-server.yourdomain.com if you wanted to.) If you already have a DNS name for your public IP, or are using DynDNS, you should be able to use that in the MX entry instead.

Last edited by usdmatt; July 30th, 2012 at 16:28. Reason: probably get told off for putting filenames in [B] instead of [FILE] :)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
console log says: backup kernel: backup sendmail: fatal: usage: sendmail makdaddy8888 Web & Network Services 1 June 28th, 2012 05:27
cannot open /etc/mail/mailer.conf, using /usr/libexec/sendmail/sendmail as default MT sjap Web & Network Services 20 January 21st, 2012 15:16
Using sendmail or sendmail from the ports? HL1234 Installation and Maintenance of FreeBSD Ports or Packages 3 December 17th, 2010 20:37
[Solved] sendmail qpai General 6 August 24th, 2010 19:26
Freebsd 7 GStreamer problems - no sound + linux->fbsd compile problems int80 General 0 December 23rd, 2008 20:13


All times are GMT +1. The time now is 13:11.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0