0

I have been having a VERY hard time with this, have searched everywhere, and in utter desperation am posting this question.

I am using postfix and dovecot on ubuntu 12.04. I am trying very hard to trigger a php script which runs any time a new email is received by the server. In my /etc/postfix/main.cf I have added the line:

always_bcc = new_incoming_email@localhost 

In /etc/aliases I have the line:

new_incoming_email: "|/usr/bin/php -f /path/to/file/new_incoming_email.php" 

In /etc/postfix/vmaps I have the line:

new_incoming_email@localhost localhost/new_incoming_email/ 

When I run the file from the command-line I can see that the file works, as it adds a line to a log file as part of its function. From the command-line I type: /usr/bin/php -f /path/to/file/new_incoming_email.php

Here's what I get in /var/log/mail.log when I send an email to the server:

Feb 1 04:20:52 myserver postfix/smtpd[3090]: connect from nm40-vm4.bullet.mail.bf1.yahoo.com[72.30.239.212] Feb 1 04:20:52 myserver postfix/smtpd[3090]: C1EDD20630: client=nm40-vm4.bullet.mail.bf1.yahoo.com[72.30.239.212] Feb 1 04:20:52 myserver postfix/cleanup[3004]: C1EDD20630: message-id=<[email protected]> Feb 1 04:20:52 myserver postfix/qmgr[1092]: C1EDD20630: from=<[email protected]>, size=24383, nrcpt=2 (queue active) Feb 1 04:20:52 myserver postfix/error[3008]: C1EDD20630: to=<[email protected]>, relay=none, delay=0.22, delays=0.18/0/0/0.04, dsn=4.4.1, status=defferred (delivery temporarilyferred (delivery temporarily suspended: connect to localhost.com[74.125.224.72]:25: Connection timed out) suspended: connect to localhost.com[74.125.224.72]:25: Connection timed out) Feb 1 04:20:52 myserver postfix/virtual[3092]: C1EDD20630: to=<[email protected]>, relay=virtual, delay=0.22, delays=0.18/0.01/0/0.03, dsn=2.0.0, status=sent (delivered to maildir) Feb 1 04:20:53 myserver postfix/smtpd[3090]: disconnect from nm40-vm4.bullet.mail.bf1.yahoo.com[72.30.239.212] 

With example.com is domain that exist in my server.

Here is the output of "postconf -n:"

alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases always_bcc = new_incoming_email@localhost biff = no config_directory = /etc/postfix default_privs = johnvision default_transport = smtp home_mailbox = Maildir/ inet_interfaces = all inet_protocols = all mailbox_size_limit = 0 mydestination = localhost mynetworks = 127.0.0.0/8 [::1]/128 108.171.187.9 myorigin = $myhostname recipient_delimiter = + smtp_host_lookup = native smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu/GNU) virtual_gid_maps = static:5000 virtual_mailbox_base = /home/vmail virtual_mailbox_domains = /etc/postfix/vhosts virtual_mailbox_maps = hash:/etc/postfix/vmaps virtual_minimum_uid = 1000 virtual_uid_maps = static:5000 

I have been trying to get this working for quite some time. Actually, I DID have it working a while back, but I have changed something on the server (not exactly sure what) and since then it has not been working.

I really need some help with this.

5
  • 1
    Where is the rest of the log entry? You cut them off at the right side. Commented Feb 1, 2015 at 4:45
  • I edited my post with the cut-off parts included. Commented Feb 1, 2015 at 5:22
  • Please post the output of postconf -n. Looks like something wrong with your configuration Commented Feb 1, 2015 at 5:31
  • I have edited my post to include output of postconf -n. Commented Feb 1, 2015 at 5:36
  • Anyway, new_incoming_email@localhost entry in ` /etc/postfix/vmaps` is useless because the localhost was defined in mydestination not in virtual_mailbox_domains. Commented Feb 1, 2015 at 6:41

1 Answer 1

2

Based of your maillog, I can see that postfix rewrites always_bcc target from new_incoming_email@localhost to new_incoming_email@localhost.com. That caused postfix complain with error

(delivery temporarily deferred (delivery temporarily suspended: connect to localhost.com[74.125.224.72]:25: Connection timed out) 

The parameter who responsible for this rewriting is append_dot_mydomain, with default value is yes. When the value is yes, postfix will append the string .$mydomain to addresses that have no ".domain" information. That's why new_incoming_email script never be triggered.

Solution

Put append_dot_mydomain = no in main.cf should make postfix doesn't alter the domain like before.

1
  • That did it! Thank you very much...I've been at this for hours, and you've put an end to my problem! Commented Feb 1, 2015 at 6:45

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.