Sendmail says “domain does not exist”

Recently I set-up a machine in my closet to act as a backup server. One of it’s jobs is to download via pop3 all the email from our Gmail accounts just in case the cloud goes puf :). For this job I used fetchmail to fetch the emails to local users on the machine. All nice and simple … you’d think.

The mail didn’t get delivered because sendmail complained about this error.
Domain of sender address does not exist
Now this is weird – I just want to have the mails delivered locally. Well, since spam is such a big problem sendmail likes to check that the domain from which the message originated is real.

In my case this fails of course since some of the old emails we have in this accounts are from addresses that no longer exists and so sendmail refused to deliver them. So we just have to tell email to accept email coming from nonexistent domains.

Note: that this is not safe or recommended in anyway if the sendmail is running on a live email server. (Why are you running sendmail on  live machine anyway?) It’s acceptable in this case since this sendmail will only get messages downloaded by fetchmail from a few google GMail accounts.

So the setting to change in order to allow messages from nonexistent domains is found in
and it’s this one:
dnl# Turn this feature on if you don’t always have DNS, or enjoy junk mail:
dnl FEATURE(`accept_unresolvable_domains’)dnl
and after changing it should read:
After changing it you must run:
cd /usr/share/sendmail/cf/cf
m4 /usr/share/sendmail/cf/m4/cf.m4 > /etc/mail/
When I did the above again after reinstalling running simply this also worked:
m4 > /etc/mail/

Uploading big files via php

I’m updating a site for a client that only has file access to his hosting account via a php file manager (extPlorer for Joomla to be precise). He needed uploaded a few flash videos (in excess of 15 Mb each) but extPlorer stated that the file limit for php was set to 8 Mb.

I already knew that .htaccess overrides were allowed since I used .htaccess to enable a seo component for the site. So adding the following lines to .htaccess (in the root folder of his site) was enough to allow large uploads using a php upload.

If it doesn’t exist you’ll need to create a text file named .htaccess in the root of the site containing the following code:
php_value upload_max_filesize 30M
php_value post_max_size 30M
php_value max_execution_time 250
php_value max_input_time 250
If you don’t see an increase of the allowed upload size it means that you are not allowed to override this settings and you’ll need to contact your hosting provider.

Export a MySQL database using the command line.

Sometimes it’s easier to just drop to the command line then browse for fancy tools like phpMyAdmin. This is useful, especially for quick jobs.
mysqldump -u user -ppassword your_database > database_backup.sql
Of course you need to replace:

  • user – mysql username
  • password – the password
  • your_database – the database you want to backup

Adding -h would allow to backup a remote mysql database from YOUR shell, something like this:
mysqldump -u user -h -ppassword your_database > database_backup.sql