Ubuntu – Change Exim4 www-data user (Ubuntu)

dovecotemaileximUbuntuwww-data

How can I change Exim4's default user for sending mail? I hate the www-data thing. When I try sending mail to certain people I get this error (found in /var/log/exim4/mainlog):

2011-04-24 01:10:54 1QDraw-0001mS-QS <= www-data@mydomain.com U=www-data P=local S=385
2011-04-24 01:10:55 1QDraw-0001mS-QS ** trey@receiverdomain.com R=dnslookup T=remote_smtp: SMTP error from remote mail server after RCPT TO:<trey@receiverdomain.com>: host receiverdomain.com [66.147.242.169]: 550-Verification failed for <www-data@mydomain.com>\n550-The mail server could not deliver mail to www-data@mydomain.com.  The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.\n550 Sender verify failed
2011-04-24 01:10:55 1QDrax-0001mW-Gk <= <> R=1QDraw-0001mS-QS U=Debian-exim P=local S=1536
2011-04-24 01:10:55 1QDraw-0001mS-QS Completed
2011-04-24 01:10:55 1QDrax-0001mW-Gk => www-data <www-data@mydomain.com> R=local_user T=mail_spool
2011-04-24 01:10:55 1QDrax-0001mW-Gk Completed

This is super annoying. I can send mail to Gmail and Yahoo users but not other mail providers as I get that error. How can I fix this?

Best Answer

You seems to be sending emails from your webserver user account (www-data) through /usr/sbin/sendmail interface but your system doesn't accept e-mails for this address (www-data@mydomain.com) so this address fails 'sender verification' on receiving server.

You have two options. First - enable www-data account to receive messages from external systems. Second - change envelope sender address from www-data to something different by using -f option for /usr/sbin/sendmail.