How Random email generation and capturing work - email

I would like to understand how can I capture emails sent to different random email ids generated by server in one inbox to run analysis on those emails something like this website does : https://www.mail-tester.com/
Here , with each page referesh, you would notice a new random email id is generated. If an email is sent to this random email id, the mail-tester server captures that email, assesses it using spamassassin and generates a report. I want to understand how can we capture emails sent to so many different random email ids in a single inbox so that they can be assessed by spamassassin or any other utility.

Practial implementation for unix/linux sendmail using procmail as its local mailer.
Use FEATURE(virtusertable) to redirect messages for xyz#test.example.net to user+xyz (user user with +xyz "detail").
~user/.procmailrc will process incoming messages upon delivery. xyz (+detail) will be available via $1.
See also: Sendmail-FAQ-3.29: How can I add a header specifying the actual recipient when having multiple users in a virtual domain go to a single mailbox?

Related

smtp: scheduling email send based on timezone

question: is it possible to send over an email to an email provider, and include datetime value to schedule the actual sending of the email?
say I run a campaign for 100 users residing in different timezones, so I execute the campaign once from my side, however, i want the ISP/email provider to queue/schedule depending on a datetime value that I can pass?

Laravel Swift add UUID

I'm sending mass messages with custom messages per subscriber, when I get the bounce-back I use my own cocktail to read the STMP emails.
What I haven't figure it out is how to add a unique ID for each email that is sent out, so in my bounce-back I can read the email's code and look for that particular ID, currently when I read the bounce I look for the recipient email compare to what I have based on creation date plus the email...
Is not efficient and 20 emails out of 1K or so gets lost cuz I can't find in bounce the headers due to some servers custom messages although it does return headers but I have nothing to compared with...
So is there a way to add this UUID in Swift services? I have seen that Swift is adding its own UUID but I haven't been able to retrieve it, when the message is sent I want that UUID so that I can save it and then latter I can read it from the bounces...
So, if I can't retrieve it, can I add my own?
I wanna have a relation email and UUID that was use when that message was sent.
$message_out = (new \Swift_Message($out->subject))
->setFrom($out->from_email, $out->from_name)
->setTo($out->email)
->setBody($content, 'text/html')
->setReplyTo('noreply#foo.com', 'No reply');
$message_out->send($mensaje_mail, $errors_sent);
Is this a header I can add the retrieve it in the bounce-back messages?
Thank you.

Can you order attachments in an e-mail so that the receiver receives them in the same order?

We're considering using an external application to send e-mails where the attachments have huge filesizes.
One of our users states the requirement: it must be possible to ORDER attachments, so that I can refer to them as "the first attachment", "the second attachment" and the receiver will see the attachments in the same order I sent them.
She claims any normal email clients support this: the sender chooses the order, the recipients client always shows the attachments in this order.
I can't verify that claim. Is this true? Is it stated anywhere? How (technically) are attachments ordered?
Well... Inside the message there is order. Attachments are sent sequentially one-after-the-other inside MIME text. But RFC makes no statement on how these should be displayed in email client. And it even might depend on your email generating software to keep the order you added the attachments in (JavaMail does so)
Things you could consider:
Prefix your attachment filenames with a number 1_first_attachment.txt 2_contract.pdf and so on.
Use HTML for your emails and create a section "attachments: a, b, c" with linkd to the attachments using Content-ID (href="cid:xxx")
Actual, when u load the document to the email, and load next, they gonna be in order anyway. They not gonna be mixed.
if u afraid that particular ur email gonna mix attachments, just add numerical order)
This is example where i just adding files. I just by holding shift click on the files in that order that i wanted and that is all.
And i receive this message with attachments in the same order as it was sent.

IMAP Envelope email address format?

If I poll an IMAP server for an Envelope structure SELECT INBOX, FETCH UID ALL - I will get an envelope structure in return.
For all fields in the envelope structure that are an email address, from, sender, reply-to, etc, I have noticed this is how an email address is represented:
(("Name on Email Account" NIL "emailaddress" "domain.com"))
or for accounts with no email name set -
((NIL NIL "emailaddressnoname" "domain.com"))
I can see the 1st value is the name, the 3rd value is the email address name & the 4th value is the domain name - but what is the 2nd value for? I've polled for hundreds of emails from many different IMAP servers and this value is always NIL & I'm afraid that one day it's not going to be NIL and it's going to mess up my parsing code.
In the part of the RFC that defines Envelope structure (https://www.rfc-editor.org/rfc/rfc822) nothing is mentioned about this.
Anybody know what's going on?
From RFC 3501, section 7.4.2 (Fetch Responses), subsection ENVELOPE:
An address structure is a parenthesized list that describes an
electronic mail address. The fields of an address structure
are in the following order: personal name, [SMTP]
at-domain-list (source route), mailbox name, and host name.
The second portion represents source routes, which are obsolete on the Internet, so can be effectively ignored.
There is also information about group list syntax, which is also nearly obsolete, but you may come across it occasionally.

Bulk email with multiple attachment using SMTP

I need a program that will be used to send email using SMTP from a local machine. I need to send about 2000 emails.
The emails addresses are located in a MS Excel document with unique ID numbers. The attachments are in a separate folder with unique ID numbers same as the excel folder.
Every recipient will receive the same email with different attachment according to the ID number.
Is there any free or low cost program available out there that will achieve the goal?
If not, what is the best and quickest way to write a program like this?
Example of MS Excel Data:
DWEL1859 jack#bla.com
DSYD1514 caleb#bla.com
DSYD1738 jen#bla.com
DNSW2736 shown#bla.com
DPRE2510 roger#bla.com
Example of zip file names:
DNSW2736.zip
DPRE2510.zip
DSYD1514.zip
DSYD1738.zip
DWEL1859.zip
Use PHPMailer with couple of any DB server (i.e. MySQL) and PHP script containing some trivial logic. Write me on email (see accaunt) if you will need help within realization.