Sendmail - One Trick Pony
m.seaman at infracaninophile.co.uk
Fri Jul 2 06:33:29 UTC 2010
-----BEGIN PGP SIGNED MESSAGE-----
On 01/07/2010 16:12:36, J wrote:
> I'd like to set up Sendmail to facilitate e-mail (with attached jpeg)
> delivery to an internet account from my wireless IP camera. That's
> all I want it to do, nothing more. I've been a very satisfied
> FreeBSD user for a few years and am reasonably comfortable with OS
> and software configuration, but I have literally no knowledge of mail
> servers or configuring Sendmail. Some people suggest using other
> programs such as Postfix, but I'd rather get this work with Sendmail.
> I did install the cyrus-sasl2 port as well as saslauthd, since I
> thought I might have an authentication problem. Beyond that the only
> other things I've done are:
Right: by enabling sendmail to accept e-mail from one remote client, you
open the possibility of any client being able to e-mail via your server,
so you should put some thought into how you're going to secure that.
Personally, I'd be writing firewall rules to block incoming traffic to
ports 25 and 587 from anywhere other than your camera.
> 1. sendmail_enable="YES"
> in rc.conf
> 2. (camera's ip address) RELAY
> in /etc/mail/access
> I'm seeing my webmail account information (address and relay server)
> in maillog and when I use sendmail verbose, I see what looks like a
> successful transaction but the mail never gets delivered. So it
> would seem that the camera is communication fine with my FreeBSD
> server, but the mail isn't getting transmitted out to the internet.
> Any suggestions are appreciated.
You want your sendmail instance to act as a mail client and authenticate
to your webmail provider? That's certainly possible, but usually you
can avoid it.
If you need client-side auth, see the section "Using sendmail as a
client with AUTH" in:
You will need to recompile sendmail with appropriate AUTH capabilities,
as you would for providing server-side authentication.
In any case, if you need client-side auth or not, start by making sure
that you can send e-mail from your FreeBSD box to your webmail account
manually --- use the mail(1) command like so:
% mail -v -s "test message" your-name at webmail.provider
(Ie. type in the text of a message and finish with a dot on it's own on
a separate line)
Once that part works, look at relaying the e-mail from your camera.
The '-v' flag should show you a verbose transcript of the SMTP dialogue
involved when sending the message. Unfortunately nowadays that's just
the interaction with the MSP instance of sendmail, and not the delivery
to the webmail server.
Anyhow, follow the progress of the message through to delivery by
following the logging in /var/log/maillog. You can also examine the
mail queues by:
# mailq -v (Shows the main sendmail mail queue)
# mailq -Ac -v (Shows the MSP sendmail mail queue)
Usually you would have to be exceptionally fast and lucky to catch a
message actually in the MSP mail queue. Messages getting stuck there
indicates a problem with your local sendmail setup.
One thing to check is that your ISP does not block outgoing traffic to
port 25 -- this is frequently done as an anti-spam measure. In that
case, you will need to relay all mail via your ISPs servers by using the
smarthost setting described in another answer.
Beyond that, you should now see one of three results:
* Mail accepted by your webmail provider and shows up in your
mailbox. Job done.
* Mail rejected by your webmail provider. Hopefully with some sort
of error message that will tell you why the message was rejected.
In this case, you're looking at making sure the messages
generated from your camera don't look like spam. Generally this
boils down to making sure that the addresses in the message
headers can be looked up in the DNS both forwards and backwards,
and that your FreeBSD server also identifies itself (in the EHLO
part of the SMTP dialogue) with a similarly verifiable name.
* Mail accepted by your webmail provider, but then disappears
without trace. In principle this shouldn't happen, but in
practice as a SMTP service provider it's hard to avoid completely
and still provide a competent anti-spam and anti-virus filter.
In this case, you need to talk to the webmail provider and get
them to examine the mail logs and tell you what the problem was
with your message. It could be the same sort of DNS address
verification stuff as above, or it could be something to do with
the actual content you're sending.
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matthew at infracaninophile.co.uk Kent, CT11 9PW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the freebsd-questions