From owner-freebsd-questions@FreeBSD.ORG Fri Jul 2 06:33:29 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82F72106566C for ; Fri, 2 Jul 2010 06:33:29 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id F17808FC19 for ; Fri, 2 Jul 2010 06:33:28 +0000 (UTC) Received: from seedling.local (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.4/8.14.4) with ESMTP id o626XLT8073519 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 2 Jul 2010 07:33:23 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-Authentication-Warning: lucid-nonsense.infracaninophile.co.uk: Host seedling.black-earth.co.uk [81.187.76.163] claimed to be seedling.local Message-ID: <4C2D8831.7070404@infracaninophile.co.uk> Date: Fri, 02 Jul 2010 07:33:21 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: J References: <800552.84775.qm@web52705.mail.re2.yahoo.com> In-Reply-To: <800552.84775.qm@web52705.mail.re2.yahoo.com> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.96.1 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_50,DKIM_ADSP_ALL, SPF_FAIL autolearn=no version=3.3.1 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lucid-nonsense.infracaninophile.co.uk Cc: freebsd-questions@freebsd.org Subject: Re: Sendmail - One Trick Pony X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2010 06:33:29 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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: http://www.sendmail.org/~ca/email/auth.html 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@webmail.provider Test message . (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. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matthew@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/ iEYEARECAAYFAkwtiDEACgkQ8Mjk52CukIzHqwCfUqyA2/lgAxvmqgOG8eZuFo/x Z68Anj98pV4Scm22Fz8NQP3xUsC6ZTGC =MsK7 -----END PGP SIGNATURE-----