Jason Bailey via Postfix-users:
> I'm struggling with an odd issue and I'm hoping someone can help. I have
> an old appliance that sends out email notifications via my mail relay
> running Postfix. The problem is that it is issuing "MAIL FROM: <>", but
> only part of the time (sometimes there's an email address there,
> sometimes there isn't). Oddly, they always have a "From" address in the
> envelope.

In SMTP, MAIL FROM is the envelope sender address. It's empty for
machine-generated mesages. It is a safety mechanism to prevent
mailer loops.

Postfix does not make it easy to turn off safety.

This is what one would "normally" use Milter for:

1 - In the envfrom event handler, extract and remember the sender
    envelope address (mail from).

2 - In the header event handler, extract and remember the email
    address address in the From: header. This is non-trivial, but
    it has to work only for mail from your appliance.

3 - In the end-of-message handler, if steps [1] and [2] indicate
    that the MAIL FROM address is empty and that the message is
    from your appliance, call the Milter chgfrom method to set the
    envelope address.

Milters are available for Perl, Python, and so on.

> The problem is that when these emails eventually hit Gmail, they're
> rejected -- and for good reason. I tried setting up a
> sender_canonical_map on my aforementioned server but couldn't get it to
> work. I then switched from a hash table to pcre and still can't get it

Postfix does not look up empty strings, because some lookup tables
would return an error. Some Postfix features allow you to specify
an alternative lookup key for the empty string (usually, <>), but
canonical_maps is not one of them, because disabling a safety
mechanism should not be easy.

        Wietse
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to