14de4
![]() |
|
|
|
|
|||||||
| Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I would like to know if it's possibile to configure the default sendmail in FreeBSD 9 to catch all emails and put then in a local user mail folder. Is it possibile to use the default sendmail or should I change it? I did this, in Debian with exim4, so DNS is ok for that to work. Which file should I modify? I read the handbook, but I haven't understood if it's possibile or not. Thanks. Last edited by DutchDaemon; May 8th, 2012 at 22:50. Reason: Mind your writing style: http://forums.freebsd.org/showthread.php?t=18043 / use a spell-checker |
|
#2
|
|||
|
|||
|
In main .mc file:
Code:
FEATURE(virtusertable) Code:
domain.tld username Last edited by DutchDaemon; May 8th, 2012 at 22:50. |
|
#3
|
|||
|
|||
|
It doesn't work. If I send an email to test@mydomain in /var/log/maillog I read:
Code:
relaying denied Last edited by DutchDaemon; May 10th, 2012 at 22:30. Reason: Formatting & Style: http://forums.freebsd.org/showthread.php?t=8816 / http://forums.freebsd.org/showthread.php?t=18043 |
|
#4
|
|||
|
|||
|
I've never found a need to edit the .mc file to support virtusertable, it's in there by default.
The steps I usually do are as follows: Add the domain to /etc/mail/local-host-names (one domain per line) to tell sendmail it handles mail for the domain. - This is probably why you get relaying denied. Add the following to /etc/mail/virtusertable I always put the @ at the start but it may not be required Code:
@domain.tld user Code:
make install restart I usually do the following: Code:
@domain.tld error:nouser User unknown sales@domain.tld user1 info@domain.tld user1 me@domain.tld user1 you@domain.tld user2 etc... Last edited by usdmatt; May 10th, 2012 at 14:25. Reason: clarify local-host-names format and add virtusertable example |
|
#5
|
|||
|
|||
|
It doesn't work. If I send an email to user@mydomain I get in maillog:
Code:
User unkown Last edited by DutchDaemon; May 10th, 2012 at 22:30. Reason: Formatting & Style: http://forums.freebsd.org/showthread.php?t=8816 / http://forums.freebsd.org/showthread.php?t=18043 |
|
#6
|
|||
|
|||
|
What exactly do you have in your virtusertable at the moment?
If you want everything to go to one user, you should just have what I put in the first example (the first code block in my last post). The second example (containing the error:nouser line) is just an example of what I usually do, which is to block the catch-all and set up specific addresses, because I think having a catch-all is a stupid idea (to put it bluntly). I thought maybe you weren't aware that you can set up multiple virtusertable entries for all the addresses you actually want to use. |
|
#7
|
|||
|
|||
|
In virtusertable:
Code:
@mydomain.com tony In local-host-names: Code:
mydomain.com For example mails to:etc.? thanks Last edited by DutchDaemon; May 10th, 2012 at 22:33. Reason: READ THE RULES -> http://forums.freebsd.org/showthread.php?t=11799 |
|
#8
|
|||
|
|||
|
What you have in your virtusertable and local-host-names should be enough to have the catch-all working.
You did run the following in the /etc/mail directory to rebuild the database files and restart sendmail? Code:
make install restart Code:
sendmail -bv testuser@mydomain.com |
|
#9
|
|||
|
|||
|
Yes, I did.
Quote:
Code:
testuser@mydomain.com... User unknown Last edited by DutchDaemon; May 11th, 2012 at 17:44. Reason: Proper capitalization: http://en.wikipedia.org/wiki/Capitalization |
|
#10
|
|||
|
|||
|
I'm not really sure what you can be doing wrong here. I've just tried this on a FreeBSD 9 backup machine I have that has never been configured for email previously:
Code:
backup# sendmail -bv info@mydomain.com info@mydomain.com... deliverable: mailer esmtp, host mydomain.com., user info@mydomain.com backup# echo '@mydomain.com matt' >virtusertable backup# echo 'mydomain.com' >local-host-names backup# cat virtusertable @mydomain.com matt backup# cat local-host-names mydomain.com backup# make /usr/sbin/makemap hash virtusertable.db < virtusertable chmod 0640 virtusertable.db backup# sendmail -bv info@mydomain.com info@mydomain.com... deliverable: mailer local, user matt The only thing I can think is either
|
|
#11
|
|||
|
|||
|
Ok, now it's working fine (I didn't understand what's was wrong).
Many thanks. Last edited by DutchDaemon; May 11th, 2012 at 17:45. Reason: Capitalization, punctuation. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ssh as a local user {Linux} | shuxuef | Off-Topic | 7 | March 14th, 2012 19:43 |
| cannot open /etc/mail/mailer.conf, using /usr/libexec/sendmail/sendmail as default MT | sjap | Web & Network Services | 20 | January 21st, 2012 15:16 |
| sendmail/postfix local mail delivery problem | sand_man | Web & Network Services | 5 | December 24th, 2010 01:52 |
| Using sendmail or sendmail from the ports? | HL1234 | Installation and Maintenance of FreeBSD Ports or Packages | 3 | December 17th, 2010 20:37 |
| Syncing emails from user to user | albsallu | Web & Network Services | 27 | August 12th, 2009 22:33 |