LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-18-2012, 01:45 PM   #1
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,055

Rep: Reputation: 78
how to configure server to send *all* mail via remote smtp?


I'm in the process of setting up a server in the cloud (Amazon EC2) and, because the address space of these cloud servers blocked by most spam filters, I need for all outgoing mail to be sent by some other machine. Also, for various reasons such as limited disk space and the fact that no one will ever check email on this machine, I would like to make sure that mail is never delivered to any local mailboxes on this machine. I.e., all mail for root or root@localhost or root@whatever will be sent instead to root@mydomain.com.

I have tried a variety of settings using postfix and trying to route everything through Amazon SES using a perl script they provide but have encountered problems. In particular, these two problems:
* every sender (process/person/whatever) that wants to send mail via perl script must have their email address "verified" by the Amazon SES system. This requires me to receive a registration email and click a link for each and every different sending email on my server. this hassle is a show-stopper
* bounce notifications (which I have managed to steer to an external domain rather than being delivered locally) fail to be delivered by Amazon SES due to an "illegal content type" error:
Code:
Oct 13 16:56:50 domU-12-31-39-02-82-53 postfix/pipe[7712]: 080BC20396: to=<root@example.com>, relay=aws-email, delay=0.62, delays=0.06/0/0/0.56, dsn=5.3.0, status=bounced (Command died with status 1: "/usr/src/bin/ses-send-email.pl". Command output: Illegal content type 'message/delivery-status'. <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">   <Error>     <Type>Sender</Type>     <Code>InvalidParameterValue</Code>     <Message>Illegal content type 'message/delivery-status'.</Message>   </Error>   <RequestId>f31709af-1944-11e2-afd8-4306477b7a3c</RequestId> </ErrorResponse> )
I believe that one can set up an SMTP access point through Amazon SES and am considering that approach, but I'm not really sure how to set up my server such that ALL mail will go through this SMTP server -- meaning emails intended for root, emails sent from PHP scripts, emails sent by any user or process. I think that such a configuration might be possible using postfix, but the documentation is sprawling and I haven't managed to figure out where the access credentials -- one user/pass for the entire server -- might go. Someone suggested a null client like msmtp or esmtp, but I'm not sure I can eliminate local mail delivery with those or not.

Has anyone done something like this before? I'd very much appreciate some help figuring this out. I've been tweaking postfix and trying stuff but still haven't sorted this.
 
Old 10-20-2012, 07:53 PM   #2
herkalurk
Member
 
Registered: Oct 2012
Location: Portland
Distribution: CentOS 6/7 at home, RHEL5/6/7 at work
Posts: 32

Rep: Reputation: 2
Edit /etc/aliases

Code:
root:           root@mydomain.com
Then you'll need to add a smart relay to postfix to auto submit all SMTP to another server. I don't know postfix, so I would google it, or confer with man page.

If you want to do esmtp, you might just stop postfix and run sendmail to forward all those root emails to you. If all you want is esmtp, you should be able to just install sendmail and run it, but you said it yourself that these IPs are blocked by most spam, so if you have your own mail server, then relay to that.

In /etc/mail/sendmail.cf

Code:
# "Smart" relay host (may be null)
DSyour.smtp.server

Last edited by herkalurk; 10-20-2012 at 07:57 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPs SMTP service keeps bouncing mail when I send from my server. j.smith1981 Linux - Server 11 11-16-2011 12:09 PM
Send mail from already exist SMTP server Mouglou Linux - Server 3 04-04-2011 08:41 AM
[SOLVED] configure postfix to connect to remote smtp server mrpurple Linux - Software 5 03-17-2011 10:30 AM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 06:37 AM
Help needed to send mail using a remote smtp server with php s1mpl1c1ty Programming 4 09-19-2005 12:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration