3

Refrased question

I have a VPS that only needs to send e-mail, so I don't have a pop3/imap deamon running like courier or dovecot. I have multiple domains that all have mailboxes hosted elsewhere, f.e. with Google Apps.

The websites on the VPS need to be able to sent mail from (i.e. From:) and to these domains. That's why I have installed sSMTP and configured it to let an external email/smtp service handle this (SendGrid.com).

Now, so far, this all works like I want.

My problem currently is that there are sent about 400 e-mails a day to root@vps and/or postmaster@vps and I'm looking for a way to alter the e-mail address to a working address.

I think these e-mails are (partly) sent by Cron, for each task it has performed it sents an e-mail. I have tried out different things to alter the address, like change /etc/aliases and /root/.forward (see below).

File: /etc/aliases

# See man 5 aliases for format postmaster: [email protected] root: [email protected] 

File: /root/.forward

[email protected] 

I also have edited the crontab (crontab -e) and specified a MAILTO="" on the first line to try and disable cron mails. All to no help.

I'm looking for any help on what other area's in Ubuntu I might have missed, or perhaps this is something I can handle on SendGrid's end. Or maybe I do need a (pop3/imap) mail server, then I'd like to know which one is easy to setup and if I can limit it to these two addresses.

Any solution to prevent the bounces (400 per day) I get because the address does not exist.

Hope this clears up some things :) if there are any questions left unanswered, please let me know. Thank you for any help!

  • System: Ubuntu 10.04
  • Mailer: ssmtp
  • SMTP: Sendgrid.com
1
  • 1
    Where exactly is the email bouncing? Let's see a bounce message. Commented Aug 29, 2012 at 7:59

2 Answers 2

3

You're actually receiving mail with ssmtp? That's a strange configuration. Anyway...

So ssmtp reads a file /etc/mail.rc (which may or may not exist, and which your distribution's copy may look for elsewhere, so check the man page!). If you put something like these in the mail.rc then it will forward your mail:

alias postmaster postmaster<[email protected]> alias abuse abuse<[email protected]> 

Make sure you answer to the abuse@ address as well. Certain spam blacklists will list you if mail sent to either address bounces.

5
  • Hi Michael, thank you for the info but no I'm not recieving any mail on my VPS, it is being bounced and that's probably like it should be :) But somehow, some programs are sending mail to the non-existing(generated?) address, and I need to change the address or configure/stop these programs.. any idea what programs mail to postmaster or root @ hostname? Commented Aug 27, 2012 at 7:58
  • OK, so this answer doesn't apply to your situation at all. Sorry; I obviously misunderstood. The answer, then, is to talk to your email provider and ask them to set up mail aliases for postmaster and abuse. Commented Aug 27, 2012 at 8:15
  • Aha, no problem. But I can't change these addresses I understand? I need to set up the postmaster@hostname and abuse@hostname, either locally or externally (and I also would need MX records for the hostname I assume?). Commented Aug 27, 2012 at 8:47
  • At this point I would suggest you update your question to clarify just how you have set up mail for your domain. Commented Aug 27, 2012 at 8:48
  • Okay, will do, later today :) Commented Aug 28, 2012 at 8:14
0

You need to set MAILTO in /etc/crontab, and in each file in /etc/cron.d. If you run crontab -e it edits a user-specific file, probably in /var/spool/cron/crontabs. MAILTO set in this file has no effect on the MAILTO value set in the other files.

Shame that ssmtp doesn't utilize /etc/aliases. Seems like it wouldn't conflict with anything if it did. Nevertheless each address needs to be a full email and not just a username.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.