FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 09-18-2011, 08:43 PM
Juan Sierra Pons
 
Default crontab mails to external smtp host

Hi,

Yes, it can be done configuring Exim to send emails to external
domains using a smarthost.

1.- Configure properly /etc/aliases and add a default user to receive
emails. For example

# /etc/aliases
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: youruser
youruser; redalert.commander@gmail.com

2.- Configure exim4 to send emails using a external smarthost. As I
can see you have a gmail account. I have the same configuration in my
servers.

Modify your update-exim4.conf.conf and update the dc_smarthost variable:
dc_smarthost='smtp.gmail.com::587'

Create the /etc/exim4/passwd.client with the right permission
-rw-r----- 1 root Debian-exim 401 abr 21 21:20 passwd.client

And add the following:
# password file used when the local exim is authenticating to a remote
# host as a client.
#
# see exim4_passwd_client(5) for more documentation
#
# Example:
### target.mail.server.example:loginassword
*.google.com:redalert.commander@gmail.comassword
gmail-smtp.l.google.com:redalert.commander@gmail.comas sword
*.google.com:redalert.commander@gmail.comassword
smtp.gmail.com:redalert.commander@gmail.comasswo rd

3.- Restart the exim4 daemon

Have fun!

Regards

Juan

--------------------------------------------------------------------------------------------------------------
Juan Sierra Pons
* * *juan@elsotanillo.net
Linux User Registered: #257202
http://www.elsotanillo.net
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00 *6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------------------------------



2011/9/18 Steven <redalert.commander@gmail.com>:
> Hi list,
>
> I manage several Debian servers (etch and squeeze), not related to one
> another, and they all have some crontab jobs scheduled such as backup
> scripts. When these cronjobs are run, the output is e-mailed to the
> local admin account on the system. Is it possible to configure these
> e-mails to be delivered to an external address over an external SMTP
> server instead of locally?
>
> All systems where I would want to do this run Squeeze and use exim4 in a
> default configuration as none of them are e-mail servers.
>
> Any help is appreciated.
>
> Kind regards,
> Steven
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CABS=y9vftWdgQv4Gna4b3=YtJcU-d28Hx2pSGjtbtctMhShpgg@mail.gmail.com">http://lists.debian.org/CABS=y9vftWdgQv4Gna4b3=YtJcU-d28Hx2pSGjtbtctMhShpgg@mail.gmail.com
 
Old 09-18-2011, 08:54 PM
kuLa
 
Default crontab mails to external smtp host

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 18/09/11 21:43, Juan Sierra Pons wrote:
> Hi,
>
> Yes, it can be done configuring Exim to send emails to external
> domains using a smarthost.

hello
yee but to just send admin emails nullmailer is enough and the easiest
to confiugre from any soft of that kind

- --

|_|0|_| |
|_|_|0| "Heghlu'Meh QaQ jajVam" |
|0|0|0| -------- kuLa --------- |

gpg --keyserver pgp.mit.edu --recv-keys 0xC100B4CA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJOdlp7AAoJEOqHloDBALTKQ7kH/j9O3ivZlxzxhN8eiF2FYZZF
0XFpFUpGsWewtnNVKxRAtdtwIz7XFiPVFQFpw0Hy1XcxA8kKN/tnxe/lppqnutkK
vll1ahQ1XTf9TO+Wjsyi6sgsaEJteaClOaakx4/fCh4p1RIMDlykXNfmTu3dnc2P
7YlSk+V7urBC3ypdyXI2+RQbp2kD0m4eAzql74ok8j8mjBt8gJ 9vi1XyYNK5DX7h
ghQCZpXyia0HVCt0QPsbkVkckJmyXDyNAsA7c6PgBQ1P0upKHp 34EHhuooqcOmbt
6Fa/n4MOveNdOmYjYaLjsTOUGM6TwpZPZiNU2cBae2eSISTymhQXht TbAMQgCmE=
=CXBt
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4E765A7B.7010005@kulisz.net">http://lists.debian.org/4E765A7B.7010005@kulisz.net
 
Old 09-18-2011, 09:17 PM
Bob Proulx
 
Default crontab mails to external smtp host

Steven wrote:
> I manage several Debian servers (etch and squeeze), not related to one
> another, and they all have some crontab jobs scheduled such as backup
> scripts. When these cronjobs are run, the output is e-mailed to the
> local admin account on the system. Is it possible to configure these
> e-mails to be delivered to an external address over an external SMTP
> server instead of locally?

You can set up an alias for root in /etc/aliases to point to another
host. Then all email to root will forward to the other address.

root: root@other.example.com

Normally after changing the aliases file you need to run 'newaliases'
to rebuild the cache file. But I think exim does not need this.

Alternatively if you only want to change the crontab output and
nothing else then Vixie Cron (the default for most GNU/Linux distros)
enables you to set the MAILTO variable. If your system has a default
install of exim then very likely you can simply set the address. Put
this in your crontab file and it will only affect that particular
crontab.

MAILTO = "root@other.example.com"

> All systems where I would want to do this run Squeeze and use exim4 in a
> default configuration as none of them are e-mail servers.

But of course exim4 in a default configuration is an email server even
if you are not thinking of it that way.

The other suggestion to use nullmailer to simplify the MTA seems
reasonable to me. I always use nullmailer for chroots.

The other suggestion to reconfigure exim to use a smarthost is
reasonable too. But I think probably more complicated than you need
to do for what you are asking.

Bob
 
Old 09-18-2011, 11:16 PM
Steven
 
Default crontab mails to external smtp host

On Sun, 2011-09-18 at 22:43 +0200, Juan Sierra Pons wrote:
> Hi,
>
> Yes, it can be done configuring Exim to send emails to external
> domains using a smarthost.

Excellent.

>
> 1.- Configure properly /etc/aliases and add a default user to receive
> emails. For example
>
[...]
> 2.- Configure exim4 to send emails using a external smarthost. As I
> can see you have a gmail account. I have the same configuration in my
> servers.
>
> Modify your update-exim4.conf.conf and update the dc_smarthost variable:
> dc_smarthost='smtp.gmail.com::587'
>
> Create the /etc/exim4/passwd.client with the right permission
> -rw-r----- 1 root Debian-exim 401 abr 21 21:20 passwd.client
>
> And add the following:
> # password file used when the local exim is authenticating to a remote
> # host as a client.
> #
> # see exim4_passwd_client(5) for more documentation
> #
> # Example:
> ### target.mail.server.example:loginassword
> *.google.com:redalert.commander@gmail.comassword
> gmail-smtp.l.google.com:redalert.commander@gmail.comas sword
> *.google.com:redalert.commander@gmail.comassword
> smtp.gmail.com:redalert.commander@gmail.comasswo rd
>
> 3.- Restart the exim4 daemon
[...]
It seems you forgot to mention I need to run update-exim4.conf?
But I figured that out.

>
> Have fun!

Thanks, works like a charm when using gmail
Unfortunately I was trying to get it working with a different e-mail
address, one I have with my ISP, yet this didn't work out. When using
that one I got frozen message in the exim queues and a message in the
exim log saying my ISP's smtp rejected the message as unroutable.

But I settled for the gmail solution instead, so I'm satisfied.

Thank you very much.

Kind regards,
Steven
 
Old 09-18-2011, 11:27 PM
Steven
 
Default crontab mails to external smtp host

On Sun, 2011-09-18 at 15:17 -0600, Bob Proulx wrote:
> Steven wrote:
> > I manage several Debian servers (etch and squeeze), not related to one
> > another, and they all have some crontab jobs scheduled such as backup
> > scripts. When these cronjobs are run, the output is e-mailed to the
> > local admin account on the system. Is it possible to configure these
> > e-mails to be delivered to an external address over an external SMTP
> > server instead of locally?
>
> You can set up an alias for root in /etc/aliases to point to another
> host. Then all email to root will forward to the other address.
>
> root: root@other.example.com
>
> Normally after changing the aliases file you need to run 'newaliases'
> to rebuild the cache file. But I think exim does not need this.
>
> Alternatively if you only want to change the crontab output and
> nothing else then Vixie Cron (the default for most GNU/Linux distros)
> enables you to set the MAILTO variable. If your system has a default
> install of exim then very likely you can simply set the address. Put
> this in your crontab file and it will only affect that particular
> crontab.
>
> MAILTO = "root@other.example.com"

Unfortunately both of these solutions don't work with my default exim
config, as that won't allow you to send to external addresses. The exim
config would need to be changed anyway.

>
> > All systems where I would want to do this run Squeeze and use exim4 in a
> > default configuration as none of them are e-mail servers.
>
> But of course exim4 in a default configuration is an email server even
> if you are not thinking of it that way.
>
> The other suggestion to use nullmailer to simplify the MTA seems
> reasonable to me. I always use nullmailer for chroots.

I have no experience with nullmailer whatsoever (but none with exim
either), but as it's a separate package I needed to install, and would
need to lookup the config, I figured Juan's exim solution would be the
easiest for me.

>
> The other suggestion to reconfigure exim to use a smarthost is
> reasonable too. But I think probably more complicated than you need
> to do for what you are asking.

It does the job for me, and isn't terribly complicated, Juan explained
it exactly as needed.

>
> Bob

Thanks everyone for helping me out on this one.
Kind regards,
Steven
 

Thread Tools




All times are GMT. The time now is 10:23 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org