Empty "from:" on certain sieve rule
Hello everyone,
Running a Dovecot 2.3.13 (Debian 11 native package) configured to deliver to Postfix lmtp and using dovecot-sieve.
Setting-up a simple vacation responder works as expected but trying to catch a missing header e.g.
if allof (not exists "X-GitLab-NotificationReason") { vacation :days 1 :addresses"SOME-NOTIFICATION@example.com" :subject "Message sent to an automated address " :from"some-sender@example.com" text: Hello,
This is an automated reply to let you know thatSOME-NOTIFICATION@example.com is an automated address and is not read by a human operator.
If you're trying to contact EXAMPLECOM please send your emails toexample@example.com . ; }
... will result in an empty "from:" field instead of the required "some-sender@example.com" e.g.
Aug 06 09:41:45 email-001.example.com postfix/smtpd[1974551]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5 Aug 06 09:41:45 email-001.example.com dovecot[1174421]: lmtp(some-notification@email.example.com)<1974562><uTh/ITkHk2giIR4AdMz+wA>: sieve: msgid=<941c2ff0-56f1-493f-973e-871f446e060b@anotherexample.com>: vacation action: sent vacation response to <some.user@anotherexample.com> Aug 06 09:41:45 email-001.example.com postfix/pickup[1956559]: B7BF8207C9: uid=18018 from=<> Aug 06 09:41:45 email-001.example.com postfix/cleanup[1974554]: B7BF8207C9: message-id=<dovecot-sieve-1754466105-562992-0@email-001.example.com> Aug 06 09:41:45 email-001.example.com postfix/qmgr[1171599]: B7BF8207C9: from=<>, size=979, nrcpt=2 (queue active) Aug 06 09:41:45 email-001.example.com postfix/smtp[1974565]: B7BF8207C9: to=<some.user@anotherexample.com>, relay=smtpconnector.upper.relay[192.168.2.14]:25, delay=0.12, delays=0.06/0.01/0.03/0.02, dsn=5.7.1, status=bounced (host smtpconnector.upper.relay[192.168.2.14] said: 554 5.7.1 <>: Sender address rejected: Access denied (in reply to RCPT TO command))
I tried forcing
sieve_user_email = some-sender@example.com
... but to no avail.
I'm well aware that I could try and fix the problem at Postfix level but blindly catching ALL mails with an empty "from:" field feels bad: one miss-configured daemon and we spam everyone plus we already do some intricate rewriting.
Any ideas?
Hello everyone,
Running a Dovecot 2.3.13 (Debian 11 native package) configured to deliver to Postfix lmtp and using dovecot-sieve.
Setting-up a simple vacation responder works as expected but trying to catch a missing header e.g.
if allof (not exists "X-GitLab-NotificationReason") { vacation :days 1 :addresses [1]"SOME-NOTIFICATION@example.com" :subject "Message sent to an automated address " :from [2]"some-sender@example.com" text: Hello,
This is an automated reply to let you know that [3]SOME-NOTIFICATION@example.com is an automated address and is not read by a human operator.
If you're trying to contact EXAMPLECOM please send your emails to [4]example@example.com . ; }
... will result in an empty "from:" field instead of the required [5]"some-sender@example.com" e.g.
Aug 06 09:41:45 email-001.example.com postfix/smtpd[1974551]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5 Aug 06 09:41:45 email-001.example.com dovecot[1174421]: lmtp([6]some-notification@email.example.com)<1974562><uTh/ITkHk2giIR4AdMz+wA>: sieve: msgid=[7]<941c2ff0-56f1-493f-973e-871f446e060b@anotherexample.com>: vacation action: sent vacation response to [8]<some.user@anotherexample.com> Aug 06 09:41:45 email-001.example.com postfix/pickup[1956559]: B7BF8207C9: uid=18018 from=<> Aug 06 09:41:45 email-001.example.com postfix/cleanup[1974554]: B7BF8207C9: message-id=[9]<dovecot-sieve-1754466105-562992-0@email-001.example.com> Aug 06 09:41:45 email-001.example.com postfix/qmgr[1171599]: B7BF8207C9: from=<>, size=979, nrcpt=2 (queue active) Aug 06 09:41:45 email-001.example.com postfix/smtp[1974565]: B7BF8207C9: to=[10]<some.user@anotherexample.com>, relay=smtpconnector.upper.relay[192.168.2.14]:25, delay=0.12, delays=0.06/0.01/0.03/0.02, dsn=5.7.1, status=bounced (host smtpconnector.upper.relay[192.168.2.14] said: 554 5.7.1 <>: Sender address rejected: Access denied (in reply to RCPT TO command))
I tried forcing
sieve_user_email = [11]some-sender@example.com
... but to no avail.
I'm well aware that I could try and fix the problem at Postfix level but blindly catching ALL mails with an empty "from:" field feels bad: one miss-configured daemon and we spam everyone plus we already do some intricate rewriting.
Any ideas?
References
Visible links
- mailto:SOME-NOTIFICATION@example.com
- mailto:some-sender@example.com
- mailto:SOME-NOTIFICATION@example.com
- mailto:example@example.com
- mailto:some-sender@example.com
- mailto:some-notification@email.example.com
- mailto:941c2ff0-56f1-493f-973e-871f446e060b@anotherexample.com
- mailto:some.user@anotherexample.com
- mailto:dovecot-sieve-1754466105-562992-0@email-001.example.com
- mailto:some.user@anotherexample.com
- mailto:some-sender@example.com
This is expected behavior. The *ENVELOPE* from is <>, while the From header will be set to the recipient address (Postfix will not show this in the logs). This can be overridden:
https://doc.dovecot.org/main/core/config/sieve/extensions/vacation.html#siev...
This protects against mail loops, so overriding this is not wise.
Regards,
Stephan.
Op 6-8-2025 om 10:03 schreef Ciprian M. Vizitiu [FDT] via dovecot:
Hello everyone, Running a Dovecot 2.3.13 (Debian 11 native package) configured to deliver to Postfix lmtp and using dovecot-sieve. Setting-up a simple vacation responder works as expected but trying to catch a missing header e.g.
if allof (not exists "X-GitLab-NotificationReason") { vacation :days 1 :addresses [1]"SOME-NOTIFICATION@example.com" :subject "Message sent to an automated address " :from [2]"some-sender@example.com" text: Hello,
This is an automated reply to let you know that [3]SOME-NOTIFICATION@example.com is an automated address and is not read by a human operator.
If you're trying to contact EXAMPLECOM please send your emails to [4]example@example.com . ; }
... will result in an empty "from:" field instead of the required [5]"some-sender@example.com" e.g. Aug 06 09:41:45 email-001.example.com postfix/smtpd[1974551]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5 Aug 06 09:41:45 email-001.example.com dovecot[1174421]: lmtp([6]some-notification@email.example.com)<1974562><uTh/ITkHk2giIR4AdMz+wA>: sieve: msgid=[7]<941c2ff0-56f1-493f-973e-871f446e060b@anotherexample.com>: vacation action: sent vacation response to [8]<some.user@anotherexample.com> Aug 06 09:41:45 email-001.example.com postfix/pickup[1956559]: B7BF8207C9: uid=18018 from=<> Aug 06 09:41:45 email-001.example.com postfix/cleanup[1974554]: B7BF8207C9: message-id=[9]<dovecot-sieve-1754466105-562992-0@email-001.example.com> Aug 06 09:41:45 email-001.example.com postfix/qmgr[1171599]: B7BF8207C9: from=<>, size=979, nrcpt=2 (queue active) Aug 06 09:41:45 email-001.example.com postfix/smtp[1974565]: B7BF8207C9: to=[10]<some.user@anotherexample.com>, relay=smtpconnector.upper.relay[192.168.2.14]:25, delay=0.12, delays=0.06/0.01/0.03/0.02, dsn=5.7.1, status=bounced (host smtpconnector.upper.relay[192.168.2.14] said: 554 5.7.1 <>: Sender address rejected: Access denied (in reply to RCPT TO command)) I tried forcing sieve_user_email = [11]some-sender@example.com ... but to no avail. I'm well aware that I could try and fix the problem at Postfix level but blindly catching ALL mails with an empty "from:" field feels bad: one miss-configured daemon and we spam everyone plus we already do some intricate rewriting. Any ideas?
References
Visible links 1. mailto:SOME-NOTIFICATION@example.com 2. mailto:some-sender@example.com 3. mailto:SOME-NOTIFICATION@example.com 4. mailto:example@example.com 5. mailto:some-sender@example.com 6. mailto:some-notification@email.example.com 7. mailto:941c2ff0-56f1-493f-973e-871f446e060b@anotherexample.com 8. mailto:some.user@anotherexample.com 9. mailto:dovecot-sieve-1754466105-562992-0@email-001.example.com
10. mailto:some.user@anotherexample.com 11. mailto:some-sender@example.com
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
participants (2)
-
Ciprian M. Vizitiu [FDT]
-
Stephan Bosch