ec7e
![]() |
|
|
|
|
|||||||
| Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I've just installed FreeBSD 9.0-RELEASE-p3 on a clean system. During the installation I created a new user 'admin' and made him/her a member of the 'wheel' group. After the installation was complete I installed the 'sudo' package and added the 'admin' user to /usr/local/etc/sudoers. Now, I plan not to login as 'root' a lot anymore. The machine will ultimately be a headless server, so my next task was to make 'root' forward all its mail to the 'admin' and then (in the future) have 'admin' forward its mail to a GMail-account. For now, however, I am logging in by ssh admin@10.0.1.xx from a different machine on the local network. To enable mail forwarding from the root-user to the admin-user I edited the /etc/mail/aliases and added this line somewhere at the top: Code:
# root: admin mailIt just says: Code:
No mail for admin The output from some tests and mailq: Code:
$ mail root
Subject: test root mail
testje root
.
EOT
$ mail admin
Subject: test admin mail
testje admin
.
EOT
$ mail
No mail for admin
$ sudo mailq
/var/spool/mqueue (18 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
q8IHEx49001287 12 Tue Sep 18 19:15 <admin@boson.local>
(host map: lookup (boson.local): deferred)
<root@boson.local>
q8IHFA3Q001292 13 Tue Sep 18 19:15 <admin@boson.local>
(host map: lookup (boson.local): deferred)
<admin@boson.local>
... 16 more tests with the same results removed ...
For those interested /etc/rc.conf: Code:
$ cat /etc/rc.conf hostname="boson.local" ifconfig_em0="DHCP" ifconfig_em0_ipv6="inet6 accept_rtadv" sshd_enable="YES" ntpd_enable="YES" # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable dumpdev="NO" $ Code:
Sep 18 18:24:17 boson sm-mta[1040]: gethostbyaddr(10.0.1.11) failed: 1 Sep 18 18:24:17 boson sm-mta[1041]: starting daemon (8.14.5): SMTP+queueing@00:30:00 Sep 18 18:24:28 boson sm-msp-queue[1045]: starting daemon (8.14.5): queueing@00:30:00 Sep 18 18:49:10 boson sendmail[1159]: gethostbyaddr(10.0.1.11) failed: 1 Sep 18 19:11:57 boson sendmail[1275]: gethostbyaddr(10.0.1.11) failed: 1 Sep 18 19:13:34 boson sendmail[1277]: gethostbyaddr(10.0.1.11) failed: 1 Sep 18 19:14:59 boson sendmail[1285]: q8IHExqh001285: from=admin, size=46, class=0, nrcpts=1, msgid=<201209181714.q8IHExqh001285@boson.local>, relay=admin@localhost Sep 18 19:15:10 boson sendmail[1290]: q8IHFAfE001290: from=admin, size=49, class=0, nrcpts=1, msgid=<201209181715.q8IHFAfE001290@boson.local>, relay=admin@localhost Sep 18 19:15:10 boson sm-mta[1287]: q8IHEx49001287: from=<admin@boson.local>, size=367, class=0, nrcpts=1, msgid=<201209181714.q8IHExqh001285@boson.local>, proto=ESMTP, daemon=Daemon0, relay=localhost [127.0.0.1] Sep 18 19:15:10 boson sm-mta[1287]: q8IHEx49001287: to=<root@boson.local>, delay=00:00:00, mailer=local, pri=30367, dsn=4.4.3, stat=queued Sep 18 19:15:10 boson sendmail[1285]: q8IHExqh001285: to=root, ctladdr=admin (1001/1001), delay=00:00:11, xdelay=00:00:11, mailer=relay, pri=30046, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8IHEx49001287 Message accepted for delivery) Sep 18 19:15:21 boson sendmail[1293]: gethostbyaddr(10.0.1.11) failed: 1 Sep 18 19:15:21 boson sm-mta[1292]: q8IHFA3Q001292: from=<admin@boson.local>, size=371, class=0, nrcpts=1, msgid=<201209181715.q8IHFAfE001290@boson.local>, proto=ESMTP, daemon=Daemon0, relay=localhost [127.0.0.1] Sep 18 19:15:21 boson sm-mta[1292]: q8IHFA3Q001292: to=<admin@boson.local>, delay=00:00:00, mailer=local, pri=30371, dsn=4.4.3, stat=queued Sep 18 19:15:21 boson sendmail[1290]: q8IHFAfE001290: to=admin, ctladdr=admin (1001/1001), delay=00:00:11, xdelay=00:00:11, mailer=relay, pri=30049, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8IHFA3Q001292 Message accepted for delivery) Sep 18 19:15:55 boson sendmail[1295]: gethostbyaddr(10.0.1.11) failed: 1 $ Okay, uhm, now answering my own question. I guess I'll just complete this post for completeness. Since I didn't find the answer anywhere else I'll add it here in the hope that it may help others. The error "gethostbyaddr(xx.xx.xx.xx) failed 1" suggests a DNS-lookup failure. Since I am on a local network and I have no DNS installed the DNS-lookup will fail and sendmail will complain and refuse to deliver the mail to the local user. To resolve this I edited the file /etc/hosts and added: Code:
10.0.1.11 boson.local boson My DHCP-server (Apple Airport Extreme) does not offer a DNS service. Also any hints on how to forward to an external email-address (gmail) are appreciated. |
|
#2
|
||||
|
||||
|
You need to run newaliases(1) after modifying /etc/mail/aliases.
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#3
|
|||
|
|||
|
Quote:
|
|
#4
|
||||
|
||||
|
NOT SOMETHING THAT YOU SHOULD BE DOING
Unless for testing purposes. But you already know that...
__________________
branch:head - root on zfs - amd64 BLUES, ELWOOD ILLINOIS LICENSE : B263-1655-2187 CURRENTLY UNDER SUSPENSION WARRANTS OUTSTANDING : PARKG. 116 MOVING VIOLATIONS : 56 ARREST DRIVER ... IMPOUND VEHICLE |
| The Following User Says Thank You to Beeblebrox For This Useful Post: | ||
Mausy5043 (September 29th, 2012) | ||
|
#5
|
|||
|
|||
|
If it would be me I will install /usr/ports/dns/dnsmasq (DNS forwarder and DHCP server) to replace DHCP-server (Apple Airport Extreme)
To be able to forward all email to gmail account change Code:
root: admin Code:
admin: your_email@gmail.com |
| The Following User Says Thank You to AlexJ For This Useful Post: | ||
Mausy5043 (September 29th, 2012) | ||
![]() |
| Tags |
| clean install, dns, mail, mailq, sendmail |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Solved] Cannot send mail to root? | tempel33 | Web & Network Services | 34 | May 17th, 2010 20:10 |
| [Solved] how user@wheel group check the root's mail | f5b | General | 5 | March 8th, 2010 08:33 |
| I have this mail in /var/mail/root | mfaridi | General | 2 | March 17th, 2009 08:16 |
| [Solved] root mail | unicyclist | General | 7 | January 3rd, 2009 16:16 |
| root mail and dbus error | mfaridi | General | 1 | December 14th, 2008 15:09 |