# Can't send mail from inside Jails.



## Nulani (Dec 24, 2008)

I can't send mail from inside Jails. It also affects forums, such as phpBB. They can't send notices - which is how I noticed the problem in the first place. I haven't made any changes to the default setup as far as mail is concerned. 

Any suggestions on what might be wrong and how to fix it?


----------



## Nulani (Dec 24, 2008)

I can't seem to send e-mail even on the host system and not even locally. 


```
ginnungagap# mail -s Test root
Test!
EOT
ginnungagap# mail
No mail for root
```


----------



## danger@ (Dec 24, 2008)

if you want to send emails locally, you have to enable some MTA in your jails. The easiest way would be to add sendmail_enable="NO" into /etc/rc.conf in the jail...

and as the outgoing mail problems, you should check /var/log/maillong and see what's going on there. You need to be more specific to get some help here.


----------



## Nulani (Dec 24, 2008)

It seems like it continuously times out. I can ping the destination and I've tried several others. 


```
Dec 24 02:08:56 niflheim sendmail[3304]: mBO28uf6003304: from=www, size=914, class=0, nrcpts=1, msgid=<20081224020856.8bbe4f912826@valhallaforums.nulani.net>, relay=www@localhost
Dec 24 02:08:56 niflheim sm-mta[3305]: mBO28ual003305: from=<www@niflheim.nulani.net>, size=1099, class=0, nrcpts=1, msgid=<20081224020856.8bbe4f912826@valhallaforums.nulani.net>, proto=ESMTP, daemon=Daemon0, relay=niflheim.nulani.net [10.26.16.12]
Dec 24 02:08:56 niflheim sendmail[3304]: mBO28uf6003304: to=nulani@rpgclassics.com, ctladdr=www (80/80), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30914, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (mBO28ual003305 Message accepted for delivery)
Dec 24 02:10:02 niflheim sm-mta[2803]: mBO0D1oJ001603: to=<nulani@rpgclassics.com>, ctladdr=<www@niflheim.nulani.net> (80/80), delay=01:57:01, xdelay=00:01:15, mailer=esmtp, pri=391099, relay=rpgclassics.com. [72.4.203.114], dsn=4.0.0, stat=Deferred: Operation timed out with rpgclassics.com.
Dec 24 02:10:11 niflheim sm-mta[3307]: mBO28ual003305: to=<nulani@rpgclassics.com>, ctladdr=<www@niflheim.nulani.net> (80/80), delay=00:01:15, xdelay=00:01:15, mailer=esmtp, pri=31099, relay=rpgclassics.com. [72.4.203.114], dsn=4.0.0, stat=Deferred: Operation timed out with rpgclassics.com.
```

_Edit_: It times out most of the time. One or two of fifteen sent e-mails did get through. 

I've figured out what it is. Is there a way to tell Sendmail it needs to relay all e-mail to my ISP's SMTP?


----------



## Nulani (Dec 24, 2008)

Would * smtp: smtp.isp.tld in /etc/mail/mailertable followed by makemap hash /etc/mail/mailertable < /etc/mail/mailertable do the trick?


----------



## danger@ (Dec 24, 2008)

search for Smart Relay on google.


----------



## Nulani (Dec 24, 2008)

I already had. They all ignore: 


			
				&quot said:
			
		

> ######################################################################
> #####
> #####   DO NOT EDIT THIS FILE!  Only edit the source .mc file.
> #####
> ######################################################################


though, which is why I thought I'd ask. 

I take it it is safe to do so? I changed the 'Smart' relay host entry to DSsmtp.isp.tld and it's all working now.


----------

